[SOLVED] Can I change the TextColor value in a custom textbox GUI?

Started by poc301, Sun 16/03/2025 11:04:00

Previous topic - Next topic

poc301

I have a custom textbox GUI, named gTextBox.  The default color for the text in the box is 0 (black).  I want to add a high contrast option for those with vision issues (or who prefer a higher contrast).  I realized I can't seem to set the gTextbox.TextColor value via script. 

Is there any way to programmatically change that value?  I have a button set up to toggle back and forth, but it doesn't want to let me...



And here is the code from my button on the control panel:

Code: ags
function settingTextColor_OnClick(GUIControl *control, MouseButton button)
{
if (textboxColorDefault == 0){  // Global variable for the color of the textbox
  gTextBox.TextColor = 15;  // Make text white
  textboxColorDefault = 1;  // Set global variable to say text is white
  settingTextColor.NormalGraphic = 714;  // Set the button graphic to show a white text
  }
else if (textboxColorDefault == 1){    // Global variable for the color of the textbox
  gTextBox.TextColor = 0;  // Make text black
  textboxColorDefault = 0;  // Set global variable to say text is black
  settingTextColor.NormalGraphic = 715;  // Set button graphic to show black text
}

}


EDIT

Solved the issue myself.  Here is the correct script (don't know how I missed it):

Code: ags
  gTextBox.AsTextWindow.TextColor = 15;

Thanks,

Bill

SMF spam blocked by CleanTalk