setting scale causes FlxSprite to disappear in flashplayer

49 views
Skip to first unread message

drew tenenbaum

unread,
Nov 21, 2015, 7:43:07 PM11/21/15
to HaxeFlixel
Anytime i change my FlxSprite's scale.x, it is no longer drawn to the screen.

for example:
sprite.x = 100 //sprite is still drawn to screen, but in new location
sprite
.scale.x = 1; //still being displayed
sprite
.scale.x = 0.5; //dissapears from the screen

I'm testing this in flashplayer 20.
when i test it in windows or android, the sprite scaling works fine.

does flashplayer not support scaling of sprites?
is there a way to make it support scaling?

thanks!

Michael Zehnich

unread,
Nov 22, 2015, 2:31:31 AM11/22/15
to HaxeFlixel
Hmm I can't reproduce this in flashplayer 19 or 20, scaling is working for me on the dev branch of flixel.

As a quick suggestion, try doing
centerOffsets();
and
centerOrigin();

Sometimes when working with stuff like scale a sprite can get offcentered and move around in ways you don't expect... although in the code you posted above it should be fine.

Also try seeing if the sprite's hitbox shows up? (~ to open console and hit the top right button in the console, or do FlxG.debugger.drawDebug = true somewhere in your code)
Reply all
Reply to author
Forward
0 new messages