Jump to content

qa_foo

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by qa_foo

  1. Thanks for all the great replies, that's given me a few options and made sure I was on the right track.
  2. I probably should explain what I'm doing. I've extended the sprite class and have overridden the update method, and then added it to the tree with exsits = false for pooling/re-use at create time. I could do a 'forEach' within the state.update() but the stage.update() will call all the update() methods in the tree (exists or not) after state.update(), unless I'm not understanding things correctly. Maybe extending Phaser.Sprite and overriding update() is not the done thing. Thanks for the help.
  3. This is has been asked a few times on the forum but there never seems to be a clear answer. Looking at the 'update' code for group, it doesn't take 'exists' into consideration so update keeps getting called for all children. Having a non-existing entity 'spin' when it's not used is unnecessary and risky (performance, invalid state). How do people normally deal with it? Some options to avoid this could be to check 'exists' at the top of each update and return when it's false, or maybe it's possible to override Group and add this behaviour to update, or check for 'active/inactive' states in update. There must be a good reason it's been implemented this way but I'm not sure what it is. Thanks.
  4. Hi all, I'm just wondering if there's a way to create a sprite sheet, or ideally an atlas using Phaser.Graphics? As far as I understand it, Phaser.Graphics is vector based and it would need to be rendered out to a texture. I tried using generateTexture() (which returns a PIXI.RenderTexture), with the game.cache.addSpriteSheet function in 'create' and it doesn't seem to work or give any error in the console. I guess I could use the BitmapData class to draw on and use the canvas but I was hoping to use Phaser.Graphics for the API and so when generating textures it is scalable etc. Maybe there's a better way of doing this? Thanks for any help.
×
×
  • Create New...