changing color issue

Post in this thread issues and solution you find with the MainLobby 3 Client
User avatar
hakha4
Member
Member
Posts: 88
Joined: Wed Dec 24, 2008 3:18 am
Location: Moholm Sweden
Contact:

changing color issue

Postby hakha4 » Sat Jan 08, 2011 3:26 am

Hi
I want to change color in a textbox depending on value ( trough a script). I've searched the forum but can't find how to. Can anyone give me an example howto
Thank's in advance
Regards Håkan

User avatar
DaveB
Simply Incredible
Simply Incredible
Posts: 3143
Joined: Sun May 30, 2004 10:57 pm
Location: Mays Landing, NJ
Contact:

Re: changing color issue

Postby DaveB » Sat Jan 08, 2011 11:10 am

Color of a graphic or color of text only? There is a difference. The way to change a color of a graphic, like a button with text, is via the value of a variable. The variable can be numeric, or alpha. Select the graphic and go to the states panel. Set the "Off" state to either the off or on value depending on what you need. Make sure that the variable for the value you choose is also in the label for the graphic.

Example: Button Label: Pause{{mlirrigation_active_program_status}}

Off State for graphic: Pause


So when the variable {{mlirrigation_active_program_status}} has a value of Pause, the button turns green (or whatever color you want). When the value is anything other than pause, it is white (or whatever color you want)
Thanks!

Dave Bruner
:shock:

User avatar
hakha4
Member
Member
Posts: 88
Joined: Wed Dec 24, 2008 3:18 am
Location: Moholm Sweden
Contact:

Re: changing color issue

Postby hakha4 » Sun Jan 09, 2011 2:47 am

Thanks for reply,I was unclear in my question,I want to change the color of the text in a sizable textbox depending on a value unrelated to text caption but to a on/off/auto value in a another variable. Appreciate i you could help me out with this.
Regards Håkan

User avatar
mcascio
Founder
Founder
Posts: 8270
Joined: Tue Jan 28, 2003 4:03 pm
Location: Kenosha, Wi
Contact:

Re: changing color issue

Postby mcascio » Mon Jan 10, 2011 1:08 pm

If you are using Text.Sizable - I believe this will work.

Set your font color to a light gray so it is tintable. A black font will not be tintable.

Then you can put two labels in your Label Field and check HIDE VALUE - this will hide the second variable that will affect your tinting:
{{VariableToDisplayInTextField}}{{VariableToAffectTinting}}

Then using the STATES you can set the ON / OFF tinting colors that are affected by the second variable in your label field. The first variable will just be displayed in the text field and will have no affect on tinting.
Mario Cascio
Cinemar, Inc.
http://www.cinemaronline.com

User avatar
hakha4
Member
Member
Posts: 88
Joined: Wed Dec 24, 2008 3:18 am
Location: Moholm Sweden
Contact:

Re: changing color issue

Postby hakha4 » Mon Jan 10, 2011 1:44 pm

Works perfect,Thanks!

User avatar
mcascio
Founder
Founder
Posts: 8270
Joined: Tue Jan 28, 2003 4:03 pm
Location: Kenosha, Wi
Contact:

Re: changing color issue

Postby mcascio » Mon Jan 10, 2011 11:25 pm

Your welcome.
Mario Cascio

Cinemar, Inc.

http://www.cinemaronline.com


Return to “MainLobby 3 Client”

Who is online

Users browsing this forum: No registered users and 1 guest