flixel-ui icon indicating copy to clipboard operation
flixel-ui copied to clipboard

Icons on FlxUIButtons are stamped on top of each other

Open happinesssam opened this issue 7 years ago • 0 comments

I recently updated from 1.0.2 to 2.2.0. I've been creating some FlxUIButtons dynamically and previously I was stamping them from another FlxSprite that has all the frames. On updating it seemed that the icons were all getting stamped on top of each other.

After scratching my head and looking into it I found what I think is the issue - on line 192 of FlxUIButton it loads the new graphic, but the new bitmap isn't unique and the keys will be the same since the buttons and icon all share the same assets. When I amended it so that the new bitmap was unique the issue was resolved and the icons displayed correctly. I am not sure if there would be any problems down the line from doing this.

In summary, currently line 192 of FlxUIButton is loadGraphic(newGraphic, true, Std.int(width), Std.int(height)); and my icons look like this: image

If I amend that line to loadGraphic(newGraphic, true, Std.int(width), Std.int(height), true); my icons look like this: image

happinesssam avatar Oct 13 '16 23:10 happinesssam