riouken 15 Posted April 22, 2011 I am trying to create a simple mission timer that shows time since mission start. This will be in my already working Dialog. I have been reading about the syntax for ctrlSetStructuredText and parseText and I just cant seem to get it to display in my dialog. I have a structured text box in my dialog. Here is the script that im running to populate the box. Thanks to Hoz for the formating. while {true} do { _seconds = time; _hours = floor(_seconds / 3600); _seconds = _seconds - (_hours * 3600); _tensOfMinutes = floor(_seconds / 600); _seconds = _seconds - (_tensOfMinutes * 600); _minutes = floor(_seconds / 60); _seconds = _seconds - (_minutes * 60); _tensOfSeconds = floor(_seconds / 10); _wholeSeconds = floor(_seconds - (_tensOfSeconds * 10)); _elapsed =""; _elapsed = format ["%1:%2%3:%4%5", _hours, _tensOfMinutes, _minutes,_tensOfSeconds, _wholeSeconds]; (opcominterface displayCtrl 1100) ctrlSetStructuredText parseText _elapsed; sleep 1; }; Im not getting any RPT errors, but no text is showing. Here is my base class: class RscStructuredText { access = 0; type = 13; idc = -1; style = 0; colorText[] = {0.8784,0.8471,0.651,1}; class Attributes { font = "Zeppelin32"; color = "#e0d8a6"; align = "center"; shadow = 1; }; x = 0; y = 0; h = 0.035; w = 0.1; text = ""; size = 0.03921; shadow = 2; }; and here is my dialog: class timer: RscStructuredText { idc = 1100; colorBackground[] = { 1, 1, 1, 1 }; x = 0.751116 * safezoneW + safezoneX; y = 0.775602 * safezoneH + safezoneY; w = 0.0896484 * safezoneW; h = 0.0425 * safezoneH; }; Share this post Link to post Share on other sites
jw custom 56 Posted April 23, 2011 Not very good with dialogs but try change: (opcominterface displayCtrl 1100) ctrlSetStructuredText parseText _elapsed; to (opcominterface displayCtrl 1100) ctrlSetText format["%1", _elapsed]; Share this post Link to post Share on other sites
riouken 15 Posted April 23, 2011 I just tested it and that does not work either. I know the dialog box works because I changed the starting text to this: class timer: RscStructuredText { idc = 1100; [color="Red"]text = "Test";[/color] colorBackground[] = { 1, 1, 1, 1 }; x = 0.751116 * safezoneW + safezoneX; y = 0.775602 * safezoneH + safezoneY; w = 0.0896484 * safezoneW; h = 0.0425 * safezoneH; }; And Test showed up just fine, I just cant seem to change the text after the dialog is up. Share this post Link to post Share on other sites
moricky 211 Posted April 23, 2011 Use BIS_fnc_dynamicText function instead ;) Share this post Link to post Share on other sites
jw custom 56 Posted April 23, 2011 Here i made you a very simple example, maybe you can use it: http://www.multiupload.com/KG7R954SYM Share this post Link to post Share on other sites
riouken 15 Posted April 24, 2011 Thanks for the Helpp Gaia and JW Custom. I will work with those and see what I can get working. Share this post Link to post Share on other sites