Jump to content
Sign in to follow this  
dragon zen

Question on Control Groups and Child Control, need help

Recommended Posts

Hello my friends:

I want to use ControlGroups to show long structured text, just like http://community.bistudio.com/wiki/DialogControls-ControlsGroup

However, when I write this:

class GunV : RscControlsGroup {

idc=-1;

x=0.65;y=0.2;w=0.25;h=0.2;

class Controls{

class GunV2 : RscStructuredText {

idc = 219;

x=0.65;y=0.2;w=0.25;h=0.2;

colorBackground[] = {0.2,0.4,0.2,0.4};

};

};

};

And in script I write "((findDisplay 200) displayCtrl 219) ctrlSetStructuredText parseText _library;". However, there are only ScrollBars, without any content.

If I don't use ControlGroups, the content is OK, so I hope any one tell me what's wrong with my code? Do I need some change in script??

Thanks

DragonZen

Share this post


Link to post
Share on other sites

The armory interface uses the RscControlsGroup structure as well. You might find some code examples there.

Share this post


Link to post
Share on other sites

Ah...that's also a way to solve the problems, but I guess it will be complex to check the code of Amory

Thank you also the same.

Share this post


Link to post
Share on other sites

Controls within control group are using relative position, where [x=0,y=0] is top left corner of the group, not of the screen. So the structured text is present, but outside of group's area, which makes it invisible.

Try following code where I modified the coordinates:

class GunV: RscControlsGroup
{
idc = -1;
x = 0.65;
y = 0.2;
w = 0.25;
h = 0.2;
class Controls
{
	class GunV2: RscStructuredText
	{
		idc = 219;
		x = [color=green]0[/color];//0.65;
		y = [color=green]0[/color];//0.2;
		w = 0.25;
		h = 0.2;
		colorBackground[] = {0.2,0.4,0.2,0.4};
	};
};
};

Also, you might want to try user interface editor.

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  

×