FlxUIList: Changue Next and Previous Sprite

38 views
Skip to first unread message

Miguel Mariano

unread,
Mar 1, 2015, 6:09:11 PM3/1/15
to haxef...@googlegroups.com
Hi, I was testing the FlxUIList class, I see that the Next and Previous buttons use the default Sprite.

Try changing the Sprite using:

var Next_Button = new FlxSprite (0, 0, "assets/gfx/ui/Next.png");
var Previous_Button = new FlxSprite (0, 0, "assets/gfx/ui/Previous.png");

var ArrayList = new Array<IFlxUIWidget>();
ArrayList[0] = new FlxSprite (0, 0, "assets/image/u0.png");
ArrayList[1] = new FlxSprite (0, 0, "assets/image/u1.png");
ArrayList[2] = new FlxSprite (0, 0, "assets/image/u2.png");
ArrayList[3] = new FlxSprite (0, 0, "assets/image/u3.png");
ArrayList[4] = new FlxSprite (0, 0, "assets/image/u4.png");
ArrayList[5] = new FlxSprite (0, 0, "assets/image/u5.png");

var List = new FlxUIList (0,0, ArrayList, FlxG.width, 100, "", FlxUIList.STACK_HORIZONTAL, 10, null, null, new FlxUISpriteButton (0,0, Previous_Button, null), new FlxUISpriteButton (0,0, Next_Button , null));

add(List);

There is another way to change the Next and Previous buttons to FlxUIList???

Ohmnivore

unread,
Mar 2, 2015, 12:08:31 PM3/2/15
to haxef...@googlegroups.com
You can use this after you initialize your list:
L.nextButton.loadGraphicsUpOverDown("assets/gfx/ui/Next.png");
L.prevButton.loadGraphicsUpOverDown("assets/gfx/ui/Previous.png");
Reply all
Reply to author
Forward
0 new messages