Search the Community
Showing results for tags 'spite'.
-
Hey everyone hopefully this is worded ok and you are having a good day. I currently have a playable character which can be moved around and collide with objects. The issue i am having is once it has collided with a certain object i want the players character sprite to increase in size however when i do this using sprite.scale.setTo for some reason the position of the player sprite moves to 0,0. Apologise if that was not enough information i can provide more if needed.
-
Hey everyone hopefully this is worded ok and you are having a good day. I currently have a playable character which can be moved around and collide with objects. The issue i am having is once it has collided with a certain object i want the players character sprite to increase in size however when i do this using sprite.scale.setTo for some reason the position of the player sprite moves to 0,0. Apologise if that was not enough information i can provide more if needed.
-
Hello, Let's say that i have an "Interactive" Sprite Button (sprite.interactive = true) ready for receiving click/touch events, and above of it there is a big TilingSprite (with the size of all screen) to create a Flash effect. The tiling sprite is visible (tilingSprite.visible = true) and its alpha oscillate between 0.1 to 0.5. The problem is when i want to touch/click the Sprite button nothing happens... The only way to receive a touch/click event is by setting tilingSprite.visible = false. Is there any way to set the interaction manager to "bypass" some elements like some TilingSprites or others?
- 4 replies
-
- TilingSprite
- spite
-
(and 1 more)
Tagged with:
-
I have the animation of hero in one spritesheet file: spritesheet1.png preload: game.load.atlasJSONHash('spritesheet1', 'assets/entities/spritesheet1.png', 'assets/entities/spritesheet1.json');create: var hero = game.add.sprite(100, 100, 'spritesheet1');hero.animations.add('animName1', Phaser.Animation.generateFrameNames('animName1_', 0, 16, '', 4), 30);hero.animations.play('animName1', 30, true); also I have the "health bar" at that spitesheet1.png How is better to add that sprite from spritesheet? I do like that: var healthBar = game.add.sprite(250, 270, 'spritesheet1');healthBar.animations.add('healthBar', Phaser.Animation.generateFrameNames('healthBar_', 0, 0, '', 4), 30);healthBar.animations.play('healthBar');and I think that it's no a good way, may be is there a simple way to do? Yes, I know that I can load the healtBar as separate image (healthBar.png), but I want to keep all art in one spritesheet.