Game Development Reference
In-Depth Information
Basically, the Item class will contain the informaion that we need to show for every
item.
3. Next, we go to the Start() funcion and add the highlighted code:
public function Start () : void {
b_openMenu = false; //Set our menu disabled at the first run
gui_weaponCon = GUIContent(s_unequip);
gui_armorCon = GUIContent(s_unequip);
gui_accessCon = GUIContent(s_unequip);
gui_skillCon = GUIContent("");
4. We just finished all the setup that we need for our status page in the menu window.
Next, we go to DoMyWindow (windowID : int) and uncomment the highlighted
line as follows:
switch (in_toolbar) {
case 0 : //Status
//Create a status page
StatusWindow();
break;
5. Next, we need to create a StatusWindow() funcion, as follows:
private function StatusWindow() : void {
GUI.Box (r_statBox, "");
GUI.Box (r_weaponBox, "");
GUI.DrawTexture(r_statTexture1, t_statusBox1);
GUI.DrawTexture(r_statTexture2, t_statusBox2);
GUI.DrawTexture(r_skillBox, t_skillBox);
CheckMax();
GUI.Label(r_hpLabel, currentHP.ToString() + "/" + fullHP.
ToString(), "Text Amount");
GUI.Label(r_mpLabel, currentMP.ToString() + "/" + fullMP.
ToString(), "Text Amount");
GUI.Label(r_lvLabel, currentLV.ToString(), "Text Amount");
GUI.Label(r_expLabel, currentEXP.ToString(), "Text Amount");
GUI.Label(r_nextLabel, currentNEXT.ToString(), "Text Amount");
GUI.Label(r_atkLabel, currentATK.ToString(), "Text Amount");
GUI.Label(r_defLabel, currentDEF.ToString(), "Text Amount");
GUI.Label(r_agiLabel, currentAGI.ToString(), "Text Amount");
GUI.Label(r_intLabel, currentINT.ToString(), "Text Amount");
GUI.Label(r_lucLabel, currentLUC.ToString(), "Text Amount");
 
Search WWH ::




Custom Search