Home   Help Search Login Register  

Author Topic: dynamically setting text color in a dialog (static text)  (Read 1007 times)

0 Members and 1 Guest are viewing this topic.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
I'm trying to create a customiseable dialogue MP intro to be implemented in an addon which would be initiated via a gamelogic
(Therefore the mission maker cannot access the resource file to edit the text color)



The problem i have is creating a system for the mission maker to allow him to select a colour for the text, so that it contrasts with the background color
which is required due to the  diversity of backgrounds that can be selected

There appears to be no method to dynamically alter the colour of static text, which i believe would be the best control to use for the text

I can of course use the listbox and set the text colour using:
lbSetColor [5, 0, txu_txtcolor]
however i cant get rid of the background color for a listbox, which ideally needs to be colourless nor can i remove the borderline


I think i remember somewhere reading on how to use a global var and a #define to do something similar, however testing has not provided me with any positive results

At present the only workaround i can think off is having several versions of the same dialog with differing text colours, eg Red, blue, black white etc, and then have a mission maker state a color, or a variable value for a color, which the intro script would use to decide which dialog to load


has anybody any idea of a workaround that could be used
« Last Edit: 24 Jul 2006, 23:28:38 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline nindall

  • Members
  • *
Re: dynamically setting text color in a dialog (static text)
« Reply #1 on: 25 Jul 2006, 15:04:47 »
Quote from: Terox
I think i remember somewhere reading on how to use a global var and a #define to do something similar, however testing has not provided me with any positive results

This doesn't have anything to do with #define (They are unchangeable!), but you can put global vars in place of many values in a description.ext (width, height, pos, color to name a few.), just remember to assign a value before you create the dlg.

Code: (description.ext) [Select]
colorBackground[]={Bg_Red, Bg_Green, Bg_Blue, Bg_Alpha};
colorText[]={Txt_Red, Txt_Green, Txt_Blue, Txt_Alpha};

Code: (script.sqs) [Select]
Bg_Red = 1
Bg_Green = 1
Bg_Blue = 1
Bg_Alpha = 1

Txt_Red = 0
Txt_Green = 0
Txt_Blue = 0
Txt_Alpha = 0

_ok = createDialog "Dialog"

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re: dynamically setting text color in a dialog (static text)
« Reply #2 on: 25 Jul 2006, 18:22:14 »
many thx for the help
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123