• Content count

  • Joined

  • Last visited

About lloydevans

  • Rank
    Advanced Member

Recent Profile Visitors

548 profile views
  1. Hi, I didn't say removeFrom would handle resetting any values on the scale object for you. See the first line of my reply.
  2. cacheAsBitmap may be of use to you if your generated tiles do not need to change much. http://pixijs.download/dev/docs/PIXI.Graphics.html#cacheAsBitmap Also generateTexture. http://pixijs.download/dev/docs/PIXI.SystemRenderer.html#generateTexture It sounds like you are running into problems with Pixi needing to render a lot of graphics objects on the fly. Baking things into textures where possible may help with that.
  3. You are correct that you need to make sure you have the starting properties you want before adding a new tween. As for checking for an existing tween object and disposing of it, this is only necessary if Phasers tween library lacks an override system for newly added tweens which target the same object as an existing tween in the tween manager. From a quick look at the docs, it seems that's the case. A slightly cleaner way to write it would be to use the removeFrom method. So instead of the undefined check do this: game.tweens.removeFrom(this) https://phaser.io/docs/2.4.4/Phaser.TweenManager.html#removeFrom That may avoid the necessity for holding a reference to that tween if you don't need to do anything special with it.
  4. Phaser warps text

    You also need to think about other places that interpolation and scaling may come from. The app resolution, the device pixel ratio, the font size, the font resolution. It's a big ol' kettle of fish and there is no shortage of past forum posts and references talking about this subject. Bitmap fonts are commonly used for these retro pixel art fonts with roundedPixels enabled.
  5. Phaser warps text

    I meant to say a power of grid height, and it's not really a solution anyway. Actually increasing the resolution as you did seems like one fairly reasonable way to solve it. No reason you can't increase it even further. Edit - just be wary of potential performance implications of re-rendering that text as high resolution bitmap data from the font file. Pretty sure you can do something along the lines of cacheAsBitmap in Pixi to get around it. My explanation isn't very good but I'm trying to tell you why it's happening which can inform you to find a solution.
  6. Phaser warps text

    It's a complex thing to explain but you are using a vector font which pretends to be made up of low resolution pixels. Phaser interpolates pixels when rendering those vectors because the vast majority of fonts want that to look smooth. Your font with a given font size may tell phaser that one of the squares in the grid is say 15.4 pixels in size which results in interpolated values.
  7. Phaser warps text

    Might of been a typo, but you'd want to enable "autoRound" not disable it.
  8. Can't prevent camera from being moved out of bounds

    Creating a moving camera effect can be as simple as adding objects to a container and moving the position/scale of that parent container. No need for local transform. Tip - Leave your stage container static, and create a container for your "camera scene". If you move the stage you don't have an easy option for anything to be unaffected by the "camera" movements! Edit - Container.calculateBounds could potentially offer a dynamic way to impose some restrictions on the movement (by checking if the bounding rect of your scene container is within the stage). There are many ways to go about it depending on the requirements and level of optimisation you want.
  9. Can't prevent camera from being moved out of bounds

    Yea, look at what a PIXI.Container is
  10. Issue pixi don't load images from atlas

    Try going to a maximum of 2048, if that doesn't work it may even need to be 1024 for some really old devices.
  11. Issue pixi don't load images from atlas

    What dimensions are the texture atlases you are creating?
  12. Why is text not left aligned properly?

    An empty string evaluates as 'falsy', a string with a single space doesn't. My guess is that's something to do with the reasoning behind it. You can simply set the text property without using "+=" for the first time.
  13. Why is text not left aligned properly?

    http://pixijs.download/dev/docs/core_text_Text.js.html#line648 text = String(text === '' || text === null || text === undefined ? ' ' : text);
  14. Is this a rendering issue or...

    I think the assumption in the original question was that you passed the string to the PIXI.Text constructer by a reference. You can think of strings in JS as being "passed by copy" (unless it's passed as an object with a string property). When you set PIXI.Text.text, a set method is called which updates it with the new string. In addition to that you were also joining multiple variables into a string literal when you created the PIXI.Text instance. So the assumption there was that those variables could be updated with the string literal you defined somehow knowing about that and re-creating itself.
  15. app.render would of been needed if you'd wanted to extract the pixels from the renderer, but you are extracting them from the texture itself The texture having been loaded is needed in both cases.