Legomite Posted July 3, 2017 Share Posted July 3, 2017 I have a preload bar that's set using the Phaser function game.load.setPreloadBar. It works fine if there is no scaling applied, but it doesn't even move or get cropped when I scale the sprite. I scaled it to 25. Anybody know what's going on? Thanks! Link to comment Share on other sites More sharing options...
samme Posted July 3, 2017 Share Posted July 3, 2017 Did you scale before or after you called setPreloadSprite? Link to comment Share on other sites More sharing options...
Legomite Posted July 4, 2017 Author Share Posted July 4, 2017 On 7/2/2017 at 6:58 PM, samme said: Did you scale before or after you called setPreloadSprite? I did it before set preload Sprite, but I also tried after and it doesn't seem to change anything... Link to comment Share on other sites More sharing options...
Skeptron Posted July 5, 2017 Share Posted July 5, 2017 Maybe it's unrelated, but I found a bug where you would need to use the original sprite dimensions when cropping a sprite. Say you have a rectangle sprite of 100x50, you want to crop it horizontally, for example, 10x50. If you scale the sprite, you will always need to write that the crop rectangle height is 50, even though the sprite might now be 10px high. Same goes with the width. Looks like the crop rectangle doesn't know and doesn't care about the scaling that can occur on the sprite. Link to comment Share on other sites More sharing options...
samme Posted July 5, 2017 Share Posted July 5, 2017 I think the crop rectangle dimensions refer to the the texture frame, not the object's display size. Link to comment Share on other sites More sharing options...
samme Posted July 5, 2017 Share Posted July 5, 2017 Link to comment Share on other sites More sharing options...
Recommended Posts