Pimmelorus 0 Posted March 29, 2013 Hi all, I have problems with setting structured text in my control and I would like your opinion on the cause. My control config is: class MyRscStructuredText { idc = -1; type = CT_STRUCTURED_TEXT; style = ST_LEFT; moving = true; colorBackground[] = {0,0,0,.5}; colorText[]={1,2,1,1}; font = "PuristaMedium"; w=0.2; h=0.1; sizeEx = 0.04; text = "-not set-"; }; class RscTitles { titles[]={}; class Tx_groupInfoOverlay { idd = -1; onLoad = "uiNamespace setVariable ['Tx_d_groupInfoOverlay', _this select 0]"; movingEnable = 1; fadeIn = 0; fadeOut = 0; duration = 10e10; class controls { class Tx_groupInfoOverlay_Text: MyRscStructuredText { idc = 100; x = 1; y = 1; w = 0.5; h = 0.5; }; }; }; }; This function does nothing at all: _ctrl = (uiNamespace getVariable "Tx_d_groupInfoOverlay") displayCtrl 100; _stxt = parseText "First line<br/>Second line"; _ctrl ctrlSetStructuredText _stxt; What does work, however, is the command: _ctrl ctrlSetText "BLABLA"; showing that I have access to the right control. Also this command shows correctly: hintSilent _stxt; showing that the structured text is ok. I do not know what to change. Any help is appreciated greatly. All the best, Pim Share this post Link to post Share on other sites
lifted86 10 Posted March 29, 2013 try using style = ST_MULTI; as the stye in the base class. I think you need this for multi lines. Share this post Link to post Share on other sites
Pimmelorus 0 Posted March 29, 2013 No, the CT_STRUCTURED_TEXT has a function different from ST_MULTI. I use it on purpouse here. Thnx for replying. Share this post Link to post Share on other sites
muf 49 Posted March 29, 2013 Hi, try to use this one: class MyRscStructuredText { idc = -1; type = CT_STRUCTURED_TEXT; style = ST_LEFT; x = 0.1; y = 0.1; h = 0.1; w = 0.5; text = "TEST"; size = 0.04; colorText[] = {1,1,1,1}; shadow = 0; colorBackground[] = {1,0,0,0.5}; class Attributes { font = "PuristaMedium"; color = "#ffffff"; align = "left"; shadow = false; }; }; Share this post Link to post Share on other sites
jacmac 2 Posted March 29, 2013 Check out the structured text control in my Generic Vehicle Service script: http://forums.bistudio.com/showthread.php?151507-Generic-Vehicle-Service The files to look at are simple_text_control.sqf, stc_include.hpp, control_include.hpp, and colors_include.hpp. I've been working towards releasing a set of scripts to make it easier to incorporate structured text displays, they are a quite confusing animal to wrap your head around at first glance. These are non-interactive, simply meant to display information without interrupting the player. I got them to work and I'm still not totally sure how they work yet. Share this post Link to post Share on other sites
Pimmelorus 0 Posted April 1, 2013 (edited) @muf Thanks for the suggestion. I get a error message about a missing font however. No entry 'C:...<path>.../Tx_groupInfoOverlay_Text.font'. That is with this config for the overlay: class MyRscStructuredText { idc = -1; type = CT_STRUCTURED_TEXT; style = ST_LEFT; x = 0.1; y = 0.1; h = 0.1; w = 0.5; text = "TEST"; size = 0.04; colorText[] = {1,1,1,1}; shadow = 0; colorBackground[] = {1,0,0,0.5}; class Attributes { font = "PuristaMedium"; color = "#ffffff"; align = "left"; shadow = false; }; }; class RscTitles { titles[]={}; class Tx_groupInfoOverlay { idd = -1; onLoad = "uiNamespace setVariable ['Tx_d_groupInfoOverlay', _this select 0]"; movingEnable = 1; fadeIn = 0; fadeOut = 0; duration = 10e10; class controls { class Tx_groupInfoOverlay_Text: MyRscStructuredText { idc = 100; x = 1; y = 1; w = 0.5; h = 0.5; }; }; }; }; It seems that the Attributes class is not picked up correctly. Edited April 1, 2013 by Pimmelorus Share this post Link to post Share on other sites