Jump to content
Sign in to follow this  
lxets

Buttons with Icons issue

Recommended Posts

Hey, Im creating a menu where I need clickable buttons with a custom icon on them. Im am having an issue with the texture being unable to be loaded, despite the filepath being correct, so i'm assuming i'm doing this the wrong way.

 

Im using an RscButton, in the control definition I have

type = 1; 
style = "2096";

then, in the dialog file with the button I use 

text = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\primaryweapon_ca.paa";

this works perfectly, and I can see the Icon on my button. The issue is, when I try to use a custom icon with something like

text = "textures\whatevertexture.paa";

I get the error, Cannot load texture (path). This is confusing me as If I change from an RscButton to RscPicture for example, it will work perfectly with the same filepath.

Share this post


Link to post
Share on other sites


//Full button definition, figured I should include this aswell

class RscButton {

idc = -1;

type = 1;

style = "2096";

default = 0;

shadow = 1;

w = 0.183825;

h = "( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20)";

color[] = {1,1,1,1.0};

colorFocused[] = {1,1,1,1.0};

color2[] = {0.95,0.95,0.95,1};

colorDisabled[] = {1,1,1,0.25};

colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1};

colorBackgroundFocused[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1};

colorBackground2[] = {1,1,1,1};

animTextureDefault = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa";

animTextureNormal = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa";

animTextureDisabled = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa";

animTextureOver = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\over_ca.paa";

animTextureFocused = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\focus_ca.paa";

animTexturePressed = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\down_ca.paa";

periodFocus = 1.2;

periodOver = 0.8;

class HitZone

{

left = 0.0;

top = 0.0;

right = 0.0;

bottom = 0.0;

};

class ShortcutPos

{

left = 0;

top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";

w = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)";

h = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";

};

class TextPos

{

left = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)";

top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";

right = 0.005;

bottom = 0.0;

};

period = 0.4;

font = "PuristaMedium";

size = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";

sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";

text = "";

soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1};

soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1};

soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};

soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};

action = "";

class Attributes

{

font = "PuristaMedium";

color = "#E5E5E5";

align = "left";

shadow = "true";

};

class AttributesImage

{

font = "PuristaMedium";

color = "#E5E5E5";

align = "left";

};

};

Share this post


Link to post
Share on other sites

I was having trouble with that as well. Couldn't fix it and turned to RscActiveText

 

From my common.hpp

class RscActiveText
{
	idc = -1;
	type = CT_ACTIVETEXT;
	style = ST_PICTURE;
	x = 0.75; 
	y = 0.5;
	w = 0.2; 
	h = 0.035;
	font = PuristaMedium;
	sizeEx = 0.024;
	color[] = { 1, 1, 1, 1 };
	colorActive[] = { 1, 0.2, 0.2, 1 };
	colorDisabled[] = {1,1,1,1};
	soundEnter[] = { "", 0, 1 };   // no sound
	soundPush[] = { "", 0, 1 };
	soundClick[] = { "", 0, 1 };
	soundEscape[] = { "", 0, 1 };
	action = "hint ""Good choice!""";
	tooltip = "";
	text = "";
	default = true;
};

And from the Dialog

class RscGroupBtn: RscActiveText
{
	idc = 7;

	x = 0.425 * safezoneW + safezoneX;
	y = 0.575 * safezoneH + safezoneY;
	w = 0.0675 * safezoneW;
	h = 0.09 * safezoneH;	
	sizeEx = 1;
	color[] = {1,1,1,1};
	colorActive[] = {1,1,1,1};
	colorDisabled[] = {1,1,1,1};
	soundEnter[] = { "", 0, 1 };   // no sound
	soundPush[] = { "", 0, 1 };
	soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
	soundEscape[] = { "", 0, 1 };
	action = "";
	text= "icons\groups.paa";
	tooltip = "Groups";
	default = true;
};

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  

×