Vortex.OnGUI C# (CSharp) Method

OnGUI() public method

public OnGUI ( ) : void
return void
    public void OnGUI()
    {
        int currentUniverse = PlayerManager.Instance.universeNumber;

        if (labelIsSet && currentUniverse == inUniverse)
        {
            Vector3 screenPoint = Camera.main.ViewportToScreenPoint(vortPos);
            screenPoint.y = (Screen.height/2 - (screenPoint.y - Screen.height/2)); // Flip y about center line (lord knows why)
            int bgw = 140; // Vortex note bg width
            int bgh = 30; // Vortex note bg height
            int x = 10;
            int y = 5;
            GUIStyle style = new GUIStyle();
            style.font = deco;
            style.normal.textColor = Color.white;
            style.alignment = TextAnchor.MiddleCenter;
            style.fontStyle = FontStyle.Bold;
            style.fontSize = 18;
            label = label.ToUpper();
            GUI.DrawTexture(new Rect(screenPoint.x-(bgw/2-5),screenPoint.y-(bgh/2)-40,bgw,bgh),bg,ScaleMode.StretchToFill, true, 0);
            GUI.Label(new Rect(screenPoint.x,screenPoint.y-40,x,y), label, style);
        }
    }