Exemplo n.º 1
0
    private void OnGUI()
    {
        bodyWorldOffset = new Vector2(position.width / 6, 0);

        body.SetRect(new Rect(bodyWorldOffset.x, bodyWorldOffset.y, position.width - bodyWorldOffset.x * 2,
                              position.height - bodyWorldOffset.y * 2));

        // drawing the background body
        GUI.DrawTexture(body.GetRect(), body.GetTexture());

        DrawBody();
        window.Repaint();
    }
Exemplo n.º 2
0
    private void DrawLayouts()
    {
        // layouts need to get refreshed in order to maintain aspect ratio
        header.SetRect(0, 0, position.width, 45);
        leftSide.SetRect(0, header.GetRect().height, 220, position.height - header.GetRect().height);
        rightSide.SetRect(position.width - 220, header.GetRect().height, 220, position.height - header.GetRect().height);
        body.SetRect(leftSide.GetRect().width, header.GetRect().y + header.GetRect().height, position.width - leftSide.GetRect().width - rightSide.GetRect().width,
                     position.height - header.GetRect().height);

        foreach (var item in sections)
        {
            GUI.DrawTexture(item.GetRect(), item.GetTexture());
        }
    }
Exemplo n.º 3
0
    private void InitializeSections()
    {
        Texture2D sides = PIATextureDatabase.Instance.GetTexture("sides");

        sections  = new List <WindowSection>();
        header    = new WindowSection(new Rect(0, 0, position.width, 40), blackBarBGColor);
        leftSide  = new WindowSection(new Rect(0, header.GetRect().height, 220, position.height - header.GetRect().height), sides);
        rightSide = new WindowSection(new Rect(position.width - 220, header.GetRect().height, 220, position.height - header.GetRect().height), sides);
        body      = new WindowSection(new Rect(leftSide.GetRect().width, header.GetRect().height, position.width - leftSide.GetRect().width - rightSide.GetRect().width,
                                               position.height - header.GetRect().height), new Color(0.6275f, 0.6275f, 0.6275f, 1.0000f));

        sections.Add(header);
        sections.Add(leftSide);
        sections.Add(rightSide);
        sections.Add(body);
    }
Exemplo n.º 4
0
    private void OnGUI()
    {
        DrawLayouts();
        bodyInputArea.GUIUpdate(body.GetRect());
        globalInputArea.GUIUpdate(new Rect(0, 0, position.width, position.height));

        DrawHeader();
        DrawLeftSection();
        DrawRightSection();
        DrawBody();

        // this must be placed in OnGUI in order to get global scope position
        PIATooltipUtility.DrawTooltips(skin.GetStyle("tooltip"));

        mouseCellCoordinate = grid.WorldToCellPosition(PIAInputArea.MousePosition);
        if (mouseCellCoordinate.x < 0 || mouseCellCoordinate.y < 0 || mouseCellCoordinate.x >= PIASession.Instance.ImageData.Width || mouseCellCoordinate.y >= PIASession.Instance.ImageData.Height)
        {
            mouseCellCoordinate = new Vector2(-1, -1);
        }
        window.Repaint();
    }