Da mich ständig Leute um Rat fragen wie ich das mit den Unsichtbaren buttons mache,
folgt der Code für die Common.hpp
Code
class Life_RscButtonInvisible
{
style = 2;
type = 16;
x = 0;
y = 0;
w = 0.095589;
h = 0.039216;
shadow = 2;
font = "PuristaMedium";
colorText[] = {1,1,1,0.0};
color[] = {1, 1, 1, 0.0};
colorDisabled[] = {1, 1, 1, 0};
color2[] = {0,0,0,0};
colorBackground[] = {1, 1, 1, 0};
colorBackgroundActive[] = {1, 1, 1, 0};
colorBackgroundDisabled[] = {1, 1, 1, 0};
colorFocused[] = {1, 1, 1, 0};
colorShadow[] = {1, 1, 1, 0};
animTextureNormal = "#(argb,8,8,3)color(1,1,1,0)";
animTextureDisabled = "#(argb,8,8,3)color(1,1,1,0)";
animTextureOver = "#(argb,8,8,3)color(1,1,1,0)";
animTextureFocused = "#(argb,8,8,3)color(1,1,1,0)";
animTexturePressed = "#(argb,8,8,3)color(1,1,1,0)";
animTextureDefault = "#(argb,8,8,3)color(1,1,1,0)";
colorBackgroundFocused[] = {1,1,1,0};
colorBackground2[] = {0.75,0.75,0.75,0};
offsetX = 0.003;
offsetY = 0.003;
offsetPressedX = 0.002;
offsetPressedY = 0.002;
SizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
size = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)";
borderSize = 0.0;
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};
class HitZone
{
left = 0.0;
top = 0.0;
right = 0.0;
bottom = 0.0;
};
class TextPos
{
left = "0.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
right = 0.005;
bottom = 0.0;
};
class Attributes
{
font = "PuristaLight";
color = "#E5E5E5";
align = "left";
shadow = "0";
};
class ShortcutPos
{
left = "(6.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)) - 0.0225 - 0.005";
top = 0.005;
w = 0.0225;
h = 0.03;
};
textureNoShortcut = "";
};
Alles anzeigen
Im Endeffekt auch nur ein Stinknormaler Button dem ich aber von Haus aus schon keine Farben zuweise, sowie keine Texturen oder Animationen...
Um nun einen Button noch "action"-fähig zu bekommen, einfach in den Button als 1. oder 2. Stelle
eintragen.
Beispiel ->
Code
class Unsichtbarer Button : Life_RscButtonInvisible
{
idc = 1001;
access = 0;
x = 0.31063217361292 * safezoneW + safezoneX;
y = 0.313725333333333 * safezoneH + safezoneY;
w = 0.095589 * safezoneW;
h = 0.0377417142857143 * safezoneH;
text ="";
action = "hint 'lol';";
};
Alles anzeigen
Beim Draufklicken gibt er eben einen Hint aus.