Game Development Reference
In-Depth Information
void Start () {
5. Then, we will add the ItemWindow() function after the StatusWindow()
function as highlighted in the following code:
// Unity JavaScript user:
private function StatusWindow() : void {
}
private function ItemWindow() : void {
GUI.Box (ITEM_BOX_RECT, "");
GUI.Box (ITEM_TIP_BOX_RECT, "");
items.SetupScrollBar();
var info : String = (items.guiContent.tooltip ==
"") ? "Show items information here" :
items.guiContent.tooltip;
var style : GUIStyle = GUI.skin.GetStyle("Label");
var tooltip : String = ( GUI.tooltip != "") ?
GUI.tooltip : info;
var height : float =
style.CalcHeight(GUIContent(tooltip), 330.0f) + 20;
_scrollPosition = GUI.BeginScrollView (new Rect
(257, 343, 320, 75), _scrollPosition, new Rect (0, 0,
280, height));
GUI.Label(new Rect (0, 0, 280, height), tooltip);
GUI.EndScrollView ();
}
// C# user:
void StatusWindow() {
}
void ItemWindow() {
GUI.Box (ITEM_BOX_RECT, "");
GUI.Box (ITEM_TIP_BOX_RECT, "");
Search WWH ::




Custom Search