Displaying part of sprite

126 views
Skip to first unread message

Apôtre Zara

unread,
Jan 31, 2016, 1:45:30 PM1/31/16
to HaxeFlixel
Hi,

I've got a sprite to represent the percentage of completion of a quest (basically a bar).
I'd like to display parts of this sprite as the quest is going on (filling the bar).

I thought about masking, but I can't move the mask so that's not a dynamic solution.
I found a solution : using makeGraphic with the width I want, and then stamping the bar's sprite on it. But I have to implement it in the update() loop. Isn't it to costful performance-wise ?

How would you handle that ?

Thanks !

Gama11

unread,
Jan 31, 2016, 4:05:57 PM1/31/16
to HaxeFlixel
What flixel version are you using? On the dev branch, FlxSprite has a clipRect property.

Apôtre Zara

unread,
Jan 31, 2016, 4:22:38 PM1/31/16
to HaxeFlixel
I'm using 3.3.12, which doesn't include clipRect. I'm looking forward the day it's pushed to the stable branch !
Reply all
Reply to author
Forward
0 new messages