I'm trying to change the graphic on a FlxButtonPlus. I want to get the graphic from a spritesheet. However, if I try the ' regular' way (make an animation and play it), it refuses to use just the part of the spritesheet I want and instead insists on showing the complete spritesheet.
Creator of the sprite:
public function ButtonSprite(c:int){
loadGraphic(ImgButtons, true, false, 30, 80);
addAnimation("static", [c]);
play("static");
}
How I try to add it to the button:
currentButton = new FlxButtonPlus(30, 80, playLevel, [0], "Unlimited", buttonWidth * 3, buttonHeight);
var sprite = new ButtonSprite(1);
currentButton.loadGraphic(sprite, sprite);
Thanks!