Game Development Reference
In-Depth Information
private var r_weaponLabel : Rect = new Rect (252, 264, 180, 40);
private var r_armorLabel : Rect = new Rect (252, 324, 180, 40);
private var r_accessLabel : Rect = new Rect (252, 386, 180, 40);
private var r_skillTexture : Rect = new Rect (464, 288, 119, 117);
private var r_skillBox : Rect = new Rect (460, 284, 127, 125);
//GUIContent
private var gui_weaponCon : GUIContent;
private var gui_armorCon : GUIContent;
private var gui_accessCon : GUIContent;
private var gui_skillCon : GUIContent;
Now we've got all the variables for our status page.
2. Next, we need the Item class to contain the informaion for our items. Let's add this
to the preceding code:
//Items class to contain our information
class Item{
public var icon : Texture;
public var name : String;
public var amount : int;
private var itemName : String;
//This function is just to put the space between name of the
item and amount of the item
public function setUpItemName () : void {
var in_length : int = (this.name.Length + this.amount.
ToString().Length);
if (in_length < 25) {
while (this.name.Length < 17 ) {
this.name += " ";
}
}
if(this.amount < 10) {
itemName = (this.name + " " + this.amount.ToString());
} else {
itemName = (this.name + this.amount.ToString());
}
}
public function get itemNA () : String {
return itemName;
}
}
 
Search WWH ::




Custom Search