Jump to content
Sign in to follow this  
Rothwell

Giving an RscButton a texture(.paa picture) in dialog

Recommended Posts

Hi, I'm trying to make an RscButton that, instead of text, is a picture of an arrow. I figured I could create a class that extends RscButton, but change the style to be a picture, and then I could set the text the same way I would a picture, and the button would appear as my picture:

class RscAButton: RscButton
{
style = 48; //ST_PICTURE
text = "my_arrow.paa";
};

instead, it's a regular button that literally says "my_arrow.paa" on it....

Share this post


Link to post
Share on other sites

class FJ_Button
{
type = 16;
idc = -1;
style = 0;
default = 0;
x = 0.1;
y = 0.1;
w = 0.183825;
h = 0.104575;
color[] = {0.543, 0.5742, 0.4102, 1.0};
color2[] = {0.95, 0.95, 0.95, 1};
colorBackground[] = {1, 1, 1, 1};
colorbackground2[] = {1, 1, 1, 1};
colorDisabled[] = {1, 1, 1, 0.25};
periodFocus = 1.2;
periodOver = 0.8;

class HitZone
{
	left = 0.004;
	top = 0.029;
	right = 0.004;
	bottom = 0.029;
};

class ShortcutPos
{
	left = 0.0145;
	top = 0.026;
	w = 0.0392157;
	h = 0.0522876;
};

class TextPos
{
	left = 0.05;
	top = 0.034;
	right = 0.005;
	bottom = 0.005;
};


textureNoShortcut = "";
animTextureNormal = "\ca\ui\data\ui_button_normal_ca.paa";
animTextureDisabled = "\ca\ui\data\ui_button_disabled_ca.paa";
animTextureOver = "\ca\ui\data\ui_button_over_ca.paa";
animTextureFocused = "\ca\ui\data\ui_button_focus_ca.paa";
animTexturePressed = "\ca\ui\data\ui_button_down_ca.paa";
animTextureDefault = "\ca\ui\data\ui_button_default_ca.paa";
period = 0.4;
font = "Zeppelin32";
size = 0.03921;
sizeEx = 0.03921;
text = "";
soundEnter[] = {"\ca\ui\data\sound\mouse2", 0.09, 1};
soundPush[] = {"\ca\ui\data\sound\new1", 0.09, 1};
soundClick[] = {"\ca\ui\data\sound\mouse3", 0.07, 1};
soundEscape[] = {"\ca\ui\data\sound\mouse1", 0.09, 1};
action = "";
toolTip = "";

class Attributes
{
	font = "Zeppelin32";
	color = "#E5E5E5";
	align = "left";
	shadow = "true";
};

class AttributesImage
{
	font = "Zeppelin32";
	color = "#E5E5E5";
	align = "left";
	shadow = "true";
};
};

That's what I have as one of my Definitions. You'd want to edit this section to fit your needs :

animTextureNormal = "\ca\ui\data\ui_button_normal_ca.paa";
animTextureDisabled = "\ca\ui\data\ui_button_disabled_ca.paa";
animTextureOver = "\ca\ui\data\ui_button_over_ca.paa";
animTextureFocused = "\ca\ui\data\ui_button_focus_ca.paa";
animTexturePressed = "\ca\ui\data\ui_button_down_ca.paa";
animTextureDefault = "\ca\ui\data\ui_button_default_ca.paa";

I hope this helped :)

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  

×