Search the Community
Showing results for tags 'margin'.
-
My goal is to make the player stay centered on the canvas at all times, even when he reaches the boundaries of the world. This is how it is now: https://gyazo.com/ea478d70b78201ad51aa6ae09b2649a6 And I've modified the code to be like this: deadland = game.add.tileSprite(world.x1 - 1200, world.y1 - 1200, world.x2*2, world.y2*2, 'deadland'); land = game.add.tileSprite(world.x1, world.y1, world.x2, world.y2, 'earth'); land.fixedToCamera = false; land.boundsPadding = 100; game.world.setBounds(world.x1 -1200, world.y1 -1200, world.x2*2, world.y2*2); game.physics.startSystem(Phaser.Physics.P2JS); deadland.alpha = 0.7; land.alpha = 1; But now the player isn't stopping at the 'earth' size bounds. He goes all the way to the 'deadzone': https://gyazo.com/634d578985d1aef1f6ccb6f51e17f65f How do I do it so the player won't go beyond the 'earth' bounds? Thanks!
-
Hi guys, I'm having an issue with a tileSprite I'm using to cover my game screen. It looks like the repeating texture has spacing/margin added on all sides which creates this grid like effect in the screenshot below. I have no idea how this has happened because yesterday when I was working on the game (and all times previously) the tileSprite formed a solid texture the size of the game world. I've tried this with 2 separate textures, in different states/browsers and I'm starting to think I'm going crazy. Any help advice would be greatly appreciated. Thanks!
- 2 replies
-
- tilesprite
- padding
-
(and 1 more)
Tagged with:
-
I've written a simple outline shader that adds a single pixel border around a sprite. It works well, except because sprite textures are commonly cropped, the outline is missing at the edges of the image. I've included a blown up image to show you what I mean. See how the border is missing at the tops of the ears and at the extremities of the limbs? What's the common way of dealing with shaders (like outline, blur, glow, etc.) that go over the edge of a cropped texture? Is there an easy way of adding a transparent margin around a texture? Or do I need to write a vertex shader to expand the size? I'm a little new to this, so I'd be grateful to learn of any solutions people might have.
-
I've been trying to squash an annoying situation where the full screen mobile template messes up on Firefox on Android. I found another game that's set up basically as mine: http://gamepyong.com/ints/ints.php It has the same problem. I'm having this issue in both 2.04 and 2.05. SO - what's the issue? Well, the javascript seems to think the game, or the webpage is/should be larger than the game's height. So it pushes the game down 10/20 pixels, and then if you touch that area you can scroll down. Since you then can scroll down, the page is never stationary; you can touch and drag the page which ruins many games basically. I'm seeing this problem on a Samsung Galaxy Tab, SM-T310 Android 4.2.2 Any idea on where to start to troubleshoot this? Pic of the problem, notice the black bar under the nav bar, it should not be there:
- 1 reply
-
- fullscreen
- android
-
(and 4 more)
Tagged with: