set TextColor for Text Window GUI from within a script?

Started by arj0n, Sun 04/12/2016 23:29:44

Previous topic - Next topic

arj0n

Is it possible to change the Text Color attribute of a Text Window GUI from within a script?
(Found this post from 2008, but no definitive answer was provided.)

Thanx,
-arj0n

tor.brandt

Can't you just use
Code: ags
textBoxName.TextColor = int color

where you switch "textBoxName" with the name of the text window, and "int color" with the number of the color you want to change to?

arj0n

Nope, that would only work for a regular GUI that does contain a text box.
In my case it's about a Text Window GUI, which does has a text property which apparently cannot be set/changed via scripting (?)


Cassiebsg

I'm using these for my dialog text GUI (that what you are after? if not ignore me (laugh)).

game.read_dialog_option_color
game.dialog_options_highlight_color

There are those who believe that life here began out there...

arj0n

Sorry, Cassiebsg, that's not what I am after.

In the editor, go to the 'explore project' panel.
In the GUIs section, rightmouse click on GUIs and add New Text Window GUI.
When you open this new gui, you will see the following attributes in the Appearance section:
* BackgroundColour
* BackgroundColourNumber
* BackgroundImage
* Padding
* TextColor

Now when you are in a script, either global or local, you can't set these Appearance attributes for this (type of) GUI.
(You can set the BackgroundGraphic though.)

Slasher

You can of course change in-game the text window to use as the Display which has the color you want.

Something like:
Code: ags

SetTextWindowGUI(14); // change 14 to the text window gui number you want to use.

arj0n

Yeh, that's what I've done, but I was still wondering if it's possible to change the textcolor attribute from within a script...
I guess it cannot be done that way...

dayowlron

Only way I can see to do that is create a different text window gui with each of the different colors you will use then switch between them.
Pro is the opposite of Con                       Kids of today are so much different
This fact can clearly be seen,                  Don't you know?
If progress means to move forward         Just ask them where they are from
Then what does congress mean?             And they tell you where you can go.  --Nipsey Russell

arj0n

That's what I did. But that way I had to create 10 variants for each only because of a different text color... :(

SMF spam blocked by CleanTalk