Jump to content
Sign in to follow this  
Gemini

RscButton

Recommended Posts

Hi all,

How is it possible to change text colour when hovering a custom dialog button ? I know how to change background colour (colorBackgroundActive) but how about the text ?

Here is my button definition:

class RscButton
{

  access = 0;
   type = CT_BUTTON;
   text = "";
   colorText[] = {1,1,1,1};
   colorDisabled[] = {1,1,1,0.85};
   colorBackground[] = {0,0,0,1};
   colorBackgroundDisabled[] = {0,0,0,0};
   colorBackgroundActive[] = {1,1,1,0.85};
   colorFocused[] = {1,1,1,1};
   colorShadow[] = {0.023529,0,0.0313725,1};
   colorBorder[] = {0.023529,0,0.0313725,1};
   soundEnter[] = {"\A3\ui_f\data\Sound\RscButtonMenu\soundEnter", 0.09, 1};
   soundPush[] = {"\A3\ui_f\data\Sound\RscButtonMenu\soundPush", 0.0, 0};
   soundClick[] = {"\A3\ui_f\data\Sound\RscButtonMenu\soundClick", 0.07, 1};
   soundEscape[] = {"\A3\ui_f\data\Sound\RscButtonMenu\soundEscape", 0.09, 1};
   style = 2;
   x = 0;
   y = 0;
   w = 0.055589;
   h = 0.039216;
   shadow = 0;
   font = "puristaMedium";
   sizeEx = 0.03921;
   offsetX = 0.000;
   offsetY = 0.000;
   offsetPressedX = 0.002;
   offsetPressedY = 0.002;
   borderSize = 0;
};

Any idea ?

Edited by Gemini
more explicite title

Share this post


Link to post
Share on other sites

Short answer: Nope.

Long answer: Possibly using some UI event handlers (onMouseEnter and onMouseExit) combined with ctrlSetTextColor. Event handlers can be defined in the config like so:

onMouseEnter = "systemChat 'Mouse is in the control area';";

Edited by SilentSpike

Share this post


Link to post
Share on other sites
color[] = {1,1,1,1};//text color

That doesn't work but thanks for trying Squeeze ;)

Short answer: Nope.

Long answer: Possibly using some UI event handlers (onMouseEnter and onMouseExit) combined with ctrlSetTextColor. Event handlers can be defined in the config like so:

onMouseEnter = "systemChat 'Mouse is in the control area';";

This works ! Thank you very much SilentSpike :) Here is what I add to my button class:

onMouseEnter = "(_this select 0) ctrlSetTextColor [0, 0, 0, 1]";
onMouseExit = "(_this select 0) ctrlSetTextColor [1, 1, 1, 1]";

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×