Jump to content
Sign in to follow this  
Pimmelorus

Structured Text does not work on my control

Recommended Posts

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

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

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

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

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

@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 by Pimmelorus

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×