Search the Community
Showing results for tags 'ctrlcreate'.
Found 2 results
-
Hi... First issue (see video): My guess is that it is ctrlCreate's initial default position? Which is odd as I specify my own? I even tried creating the element/control off-screen and then moving. It makes no difference. for "_i" from 0 to (_men - 1) do { _manIcon = _display ctrlCreate ["RscPicture", _idc]; _manIcon ctrlSetPosition [_xPos * safezoneW + safezoneX, 0.24 * safezoneH + safezoneY, 0.0125 * safezoneW, 0.02 * safezoneH]; _manIcon ctrlSetText "pics\icons\men.paa"; _manIcon ctrlSetScale 1.25; _manIcon ctrlCommit 0; _xPos = _xPos + 0.0147; _idc = _idc + 100; }; Second issue: I understand you can't use the keyword DELETE in dialogs/prePreProcessor-file but it doesn't make sense as to why it doesn't work in the button text (STRING)? It simply doesn't show the word. text = "DELETE MACRO"; // even tried... text = "MACRO DELETE"; text = "ADELETE"; // this works How am I suppose to escape it inside the string? Haven't tried it with ctrlSetText but still would like to know how/why if anyone knows. EDIT: It appears to be an issue when using DELETE MACRO string. It works with them both without one another. lol? Weird.
-
I have created control in mission: with uiNamespace do { [] spawn { waitUntil {!isNull findDisplay 46}; disableSerialization; _ctrl = findDisplay 46 ctrlCreate ["RscStructuredText", -1]; _ctrl ctrlSetPosition [x, y, w, h]; _ctrl ctrlCommit 0; while { true } do { _ctrl ctrlSetStructuredText parseText format ["myText: %1", valueFromSomeWhere]; }; }; }; Problem: Every time, when I reset game this control is created again and again and it is over-placing previous control. Question: Is there a way to check if control exist and if not, create new one? Note: should I set id (-1 in this case) of this control ?