PDA

View Full Version : is it possible to change the color of a frame of its contols ?



drvolk
June 15th, 2019, 08:28
I have a string control like that:



<label_fieldtop name="label">
<anchored position="insidetopleft" offset="10,5" width="30" />
<frame name="abilityscore" />
</label_fieldtop>


How can i change the color of the bitmap, set in frame "abilityscor", is it possible ?

I tried:

label.setColor("ff0000") which changed the text color.
label.setBackColor("ff0000") which changed the color behind the frame ...
label.abilityscore.setColor("ff0000") which results in a "attempt to index .. nil value .." error ...

damned
June 15th, 2019, 10:40
No - the frame is a graphic file.
What is the game trigger for the frame changing colour?

drvolk
June 15th, 2019, 12:15
No - the frame is a graphic file.
What is the game trigger for the frame changing colour?

"onInit" of the control i want to set the color of the frame for the label text (default is a white "label" bitmap) to the color depending of the name of the database control (e.g. ability: Strength -> red, Constitution -> blue etc.).
I have allready a workaround for that by setting a corresponding frame with "label.setFrame(name_of_the_colored_frame)", but i thought maybe it could be done in a more generic way.

But ok, good to know , thanks for your answer!