Jump to content
sarogahtyp

[Solved] Texture in dialog control

Recommended Posts

After all these years of hating Arma's dialogue system, I have now decided to get involved with it.

At the moment, I'm having a lot of trouble integrating a texture as a background into a control element.

Here is what I have so far:

 

defines.h

Spoiler

#ifndef HG_CustomControlClassesh
#define HG_CustomControlClassesh 1

// control styles
#define ST_LEFT					0x00
#define ST_RIGHT				0x01
#define ST_CENTER				0x02
#define ST_DOWN					0x04
#define ST_UP					0x08
#define ST_VCENTER				0x0C
#define ST_SINGLE				0x00
#define ST_MULTI				0x10
#define ST_TITLE_BAR			0x20
#define ST_PICTURE				0x30
#define ST_FRAME				0x40
#define ST_BACKGROUND			0x50
#define ST_GROUP_BOX			0x60
#define ST_GROUP_BOX2			0x70
#define ST_HUD_BACKGROUND		0x80
#define ST_TILE_PICTURE			0x90
#define ST_WITH_RECT			0xA0
#define ST_LINE					0xB0
#define ST_UPPERCASE			0xC0
#define ST_LOWERCASE			0xD0
#define ST_ADDITIONAL_INFO		0x0F00
#define ST_SHADOW				0x0100
#define ST_NO_RECT				0x0200
#define ST_KEEP_ASPECT_RATIO	0x0800
#define ST_TITLE				ST_TITLE_BAR + ST_CENTER
#define SL_VERT					0
#define SL_HORZ					0x400
#define SL_TEXTURES				0x10
#define ST_VERTICAL				0x01
#define ST_HORIZONTAL			0
#define LB_TEXTURES				0x10
#define LB_MULTI				0x20
#define TR_SHOWROOT				1
#define TR_AUTOCOLLAPSE			2

// control types
#define CT_STATIC				  0
#define CT_BUTTON				  1
#define CT_EDIT					  2
#define CT_SLIDER				  3
#define CT_COMBO				  4
#define CT_LISTBOX				  5
#define CT_TOOLBOX				  6
#define CT_CHECKBOXES			  7
#define CT_PROGRESS				  8
#define CT_HTML					  9
#define CT_STATIC_SKEW			 10
#define CT_ACTIVETEXT			 11
#define CT_TREE					 12
#define CT_STRUCTURED_TEXT		 13
#define CT_CONTEXT_MENU			 14
#define CT_CONTROLS_GROUP		 15
#define CT_SHORTCUTBUTTON		 16
#define CT_HITZONES				 17
#define CT_VEHICLETOGGLES		 18
#define CT_CONTROLS_TABLE		 19
#define CT_XKEYDESC				 40
#define CT_XBUTTON				 41
#define CT_XLISTBOX				 42
#define CT_XSLIDER				 43
#define CT_XCOMBO				 44
#define CT_ANIMATED_TEXTURE		 45
#define CT_MENU					 46
#define CT_MENU_STRIP			 47
#define CT_CHECKBOX				 77
#define CT_OBJECT				 80
#define CT_OBJECT_ZOOM			 81
#define CT_OBJECT_CONTAINER		 82
#define CT_OBJECT_CONT_ANIM		 83
#define CT_LINEBREAK			 98
#define CT_USER					 99
#define CT_MAP					100
#define CT_MAP_MAIN				101
#define CT_LISTNBOX				102
#define CT_ITEMSLOT				103
#define CT_LISTNBOX_CHECKABLE	104
#define CT_VEHICLE_DIRECTION	105

// import parent classes
import RscObject;
import RscText;
import RscFrame;
import RscLine;
import RscProgress;
import RscPicture;
import RscPictureKeepAspect;
import RscVideo;
import RscHTML;
import RscButton;
import RscShortcutButton;
import RscEdit;
import RscCombo;
import RscListBox;
import RscListNBox;
import RscXListBox;
import RscTree;
import RscSlider;
import RscXSliderH;
import RscActiveText;
import RscActivePicture;
import RscActivePictureKeepAspect;
import RscStructuredText;
import RscToolbox;
import RscControlsGroup;
import RscControlsGroupNoScrollbars;
import RscControlsGroupNoHScrollbars;
import RscControlsGroupNoVScrollbars;
import RscButtonTextOnly;
import RscButtonMenu;
import RscButtonMenuOK;
import RscButtonMenuCancel;
import RscButtonMenuSteam;
import RscMapControl;
import RscMapControlEmpty;
import RscCheckBox;

#endif

 

 

my dialog which gets included by description.ext

class saroWarfare_dialog_choose_spawn
{
	idd = -1;
	movingEnable = true;
	
	class ControlsBackground
	{
		
	};
	class Controls
	{
		class Control828470542
		{
			type = CT_BUTTON;
			idc = 42002;
			x = safeZoneX + safeZoneW * 0.54375;
			y = safeZoneY + safeZoneH * 0.37111112;
			w = safeZoneW * 0.0375;
			h = safeZoneH * 0.03666667;
			style = ST_CENTER;
			text = "Vote";
			action = "hint 'Clicked'";
			borderSize = 0;
			colorBackground[] = {0.086,0.208,0.486,0.7};
			colorBackgroundActive[] =  {0.067,0.208,0.51,0.7};
			colorBackgroundDisabled[] = {0.2,0.2,0.2,1};
			colorBorder[] =  {0.051,0.145,0.345,0.7};
			colorDisabled[] = {0.2,0.2,0.2,1};
			colorFocused[] = {0.067,0.208,0.51,0.7};
			colorShadow[] =  {0.024,0.063,0.153,0.7};
			colorText[] = {0.639,0.639,0.639,0.8};
			font = "TahomaB";
			offsetPressedX = 0.01;
			offsetPressedY = 0.01;
			offsetX = 0.01;
			offsetY = 0.01;
			sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1);
			soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1.0};
			soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1.0};
			soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1.0};
			soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1.0};
			
		};
		
		class Control462188694: RscPicture
		{
			type = CT_STRUCTURED_TEXT;
			idc = 420001;
			x = safeZoneX + safeZoneW * 0.466875;
			y = safeZoneY + safeZoneH * 0.24888889;
			w = safeZoneW * 0.19375;
			h = safeZoneH * 0.11111112;
			style = ST_PICTURE;
			text = "textures\dialog_background.paa";
			moving = true;
			size = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1);
			colorBackground[] = {0.165,0.271,0.529,1};
			class Attributes
			{
				
			};
		};
	};
};

 

This is how I create it:

 

_ok = createDialog "saroWarfare_dialog_choose_spawn";
if (!_ok) then {hint "Dialog couldn't be opened!"};

_ok = createDialog "saroWarfare_dialog_choose_spawn";
if (!_ok) then {hint "Dialog couldn't be opened!"};

 

Screenshot

https://imgur.com/L5ka4XW

 

What ever I tried upto now. I never got the texture working on control Control462188694...
Some help would be appreciated.

Share this post


Link to post
Share on other sites

You should put RscPicture inside the ControlsBackground. that should be able to load your texture

  • Like 1

Share this post


Link to post
Share on other sites

idk if you mean it like this, but it did not work:

Spoiler

class saroWarfare_dialog_choose_spawn
{
	idd = -1;
	movingEnable = true;
	
	class ControlsBackground
	{
		class Control462188694: RscPicture
		{
			type = CT_STRUCTURED_TEXT;
			idc = 420001;
			x = safeZoneX + safeZoneW * 0.466875;
			y = safeZoneY + safeZoneH * 0.24888889;
			w = safeZoneW * 0.19375;
			h = safeZoneH * 0.11111112;
			style = ST_PICTURE;
			text = "textures\dialog_background_small.paa";
			moving = true;
			size = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1);
			colorBackground[] = {0.165,0.271,0.529,1};
			class Attributes
			{
				
			};		
		};
	};
	
	class Controls
	{
		class Control828470542
		{
			type = CT_BUTTON;
			idc = 42002;
			x = safeZoneX + safeZoneW * 0.54375;
			y = safeZoneY + safeZoneH * 0.37111112;
			w = safeZoneW * 0.0375;
			h = safeZoneH * 0.03666667;
			style = ST_CENTER;
			text = "Vote";
			action = "hint 'Clicked'";
			borderSize = 0;
			colorBackground[] = {0.086,0.208,0.486,0.7};
			colorBackgroundActive[] =  {0.067,0.208,0.51,0.7};
			colorBackgroundDisabled[] = {0.2,0.2,0.2,1};
			colorBorder[] =  {0.051,0.145,0.345,0.7};
			colorDisabled[] = {0.2,0.2,0.2,1};
			colorFocused[] = {0.067,0.208,0.51,0.7};
			colorShadow[] =  {0.024,0.063,0.153,0.7};
			colorText[] = {0.639,0.639,0.639,0.8};
			font = "TahomaB";
			offsetPressedX = 0.01;
			offsetPressedY = 0.01;
			offsetX = 0.01;
			offsetY = 0.01;
			sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1);
			soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1.0};
			soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1.0};
			soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1.0};
			soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1.0};
		};
	};
};

 

 

Share this post


Link to post
Share on other sites

remove this from the picture:

 

type = CT_STRUCTURED_TEXT;

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites
38 minutes ago, gc8 said:

remove this from the picture:

 

type = CT_STRUCTURED_TEXT;

 

 

thx a lot. It's working now 🙂

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

×