My goal is to create a GUI that mimics the look of a smartphone. So far, I have been able to create a phone texture that I am happy with, and two button textures that will serve as app icons. I am requesting assistance on how to show the user a new display once a button has been selected. I have included the code I have so far below. All help is greatly appreciated.
#define true 1
#define false 0
class myPhone {
idd = -1; // set to -1, because we don't require a unique ID
movingEnable = true; // the dialog can be moved with the mouse (see "moving" below)
enableSimulation = false; // freeze the game
controlsBackground[] = { }; // no background controls needed
objects[] = { }; // no objects needed
controls[] = { phone, buttonTwo, buttonOne }; // our "Hello world" text as seen below:
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT START (by robby, v1.063, #Xanaxu)
////////////////////////////////////////////////////////
class iphone: RscPicture
{
idc = 1200;
text = "phone.paa";
x = 0.29375 * safezoneW + safezoneX;
y = 0.225 * safezoneH + safezoneY;
w = 0.4125 * safezoneW;
h = 0.55 * safezoneH;
};
class dollar: RscPicture
{
idc = 1201;
text = "buttonOne.paa";
x = 0.407187 * safezoneW + safezoneX;
y = 0.269 * safezoneH + safezoneY;
w = 0.061875 * safezoneW;
h = 0.088 * safezoneH;
};
class license: RscPicture
{
idc = 1202;
text = "buttonTwo.paa";
x = 0.463906 * safezoneW + safezoneX;
y = 0.269 * safezoneH + safezoneY;
w = 0.061875 * safezoneW;
h = 0.088 * safezoneH;
};
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT END
////////////////////////////////////////////////////////
};
Added 6 hours 11 minutes later:
Thank you to those who have read my thread. I was able to find a solution hopefully this will be of use to others who are trying to accomplish something similar to me. By adding Using User Interface Event Handler Button Event "buttonOnClick" to my controls.
onButtonClick = "[] call sqffile";