Change color of the text in the button

Got a question? Need help? Post here!

Change color of the text in the button

Postby papaRobot » Fri Jan 03, 2014 5:09 am

Hello everyone! How I can change color of the text in the AxButton? I use build in button.
papaRobot
Corporal
 
Posts: 12
Joined: Thu Jan 02, 2014 7:27 am

Re: Change color of the text in the button

Postby Arkeus » Fri Jan 03, 2014 6:06 pm

One way you can do it right now is to use text codes. When you set the text of the button, you can use the built in color codes, and do something like "Button @[ff0000]Name@[] Here" and the word Name would be red while the rest white (assuming using the default font or a custom white font). You can surround the whole thing to make it all the same like button.text("@[00ff00]Label Name"). There's also the other text format which I think is @[255,0,0] for specifying red green blue between 0 and 255.

Changes I should think about making in AxButton:

1. Make the label field in AxButton.as public, and then you can do "button.label.color = new Color(blah)" or "button.label.color.hex = 0xffff0000".
or
2. Allow the user to specify options to AxButton to control things like this.
Image
User avatar
Arkeus
Site Admin
 
Posts: 363
Joined: Mon Mar 26, 2012 12:43 am

Re: Change color of the text in the button

Postby papaRobot » Sat Jan 04, 2014 6:57 am

Thanks! Its very helpful.
papaRobot
Corporal
 
Posts: 12
Joined: Thu Jan 02, 2014 7:27 am


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron