コード例 #1
0
ファイル: GUISizer.cs プロジェクト: joyhooei/BubbleShooter3D
    //button sizes can be set in this method
    private static Vector2 SetSize(SizeDef size)
    {
        Vector2 finalSize;

        switch (size)
        {
        case SizeDef.small:
            finalSize = new Vector2(SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
            break;

        case SizeDef.medium:
            finalSize = new Vector2(MEDIUM_BUTTON_WIDTH, MEDIUM_BUTTON_HEIGHT);
            break;

        case SizeDef.big:
            finalSize = new Vector2(LARGE_BUTTON_WIDTH, LARGE_BUTTON_HEIGHT);
            break;

        default:
            Debug.LogError("Unknown button size, defaults to medium.");
            finalSize = new Vector2(MEDIUM_BUTTON_WIDTH, MEDIUM_BUTTON_HEIGHT);
            break;
        }

        return(finalSize);
    }
コード例 #2
0
ファイル: GUISizer.cs プロジェクト: joyhooei/BubbleShooter3D
        //specify position manually, choose size from the list
        public GUIParams(float posX, float posY, SizeDef size, string guiText)
        {
            text = guiText;

            Vector2 buttonSize = SetSize(size);

            width  = buttonSize.x;
            height = buttonSize.y;

            x = posX;
            y = posY;

            fontSize = width / 6;
        }
コード例 #3
0
ファイル: GUISizer.cs プロジェクト: joyhooei/BubbleShooter3D
        //choose size and position from the list
        public GUIParams(PositionDef position, SizeDef size, string guiText)
        {
            text = guiText;

            Vector2 buttonSize = SetSize(size);

            width  = buttonSize.x;
            height = buttonSize.y;

            Vector2 buttonPos = SetPosition(position, width, height);

            x = buttonPos.x;
            y = buttonPos.y;

            fontSize = width / 6;
        }
コード例 #4
0
ファイル: GUISizer.cs プロジェクト: joyhooei/BubbleShooter3D
        //choose size from the list, default position
        public GUIParams(SizeDef size, string guiText)
        {
            text = guiText;

            Vector2 buttonSize = SetSize(size);

            width  = buttonSize.x;
            height = buttonSize.y;

            //position defaults to middle
            Vector2 buttonPos = SetPosition(PositionDef.middle, width, height);

            x = buttonPos.x;
            y = buttonPos.y;


            fontSize = width / 6;
        }
コード例 #5
0
        //choose size and position from the list
        public GUIParams(PositionDef position, SizeDef size, string guiText)
        {
            text = guiText;

            Vector2 buttonSize = SetSize(size);
            width = buttonSize.x;
            height = buttonSize.y;

            Vector2 buttonPos = SetPosition(position, width, height);
            x = buttonPos.x;
            y = buttonPos.y;

            fontSize = width/6;
        }
コード例 #6
0
        //choose size from the list, default position
        public GUIParams(SizeDef size, string guiText)
        {
            text = guiText;

            Vector2 buttonSize = SetSize(size);
            width = buttonSize.x;
            height = buttonSize.y;

            //position defaults to middle
            Vector2 buttonPos = SetPosition(PositionDef.middle, width, height);
            x = buttonPos.x;
            y = buttonPos.y;

            fontSize = width/6;
        }
コード例 #7
0
        //specify position manually, choose size from the list
        public GUIParams(float posX, float posY, SizeDef size, string guiText)
        {
            text = guiText;

            Vector2 buttonSize = SetSize(size);
            width = buttonSize.x;
            height = buttonSize.y;

            x = posX;
            y = posY;

            fontSize = width/6;
        }
コード例 #8
0
    //button sizes can be set in this method
    private static Vector2 SetSize(SizeDef size)
    {
        Vector2 finalSize;

        switch (size)
        {
            case SizeDef.small:
                finalSize = new Vector2(SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
                break;

            case SizeDef.medium:
                finalSize = new Vector2(MEDIUM_BUTTON_WIDTH, MEDIUM_BUTTON_HEIGHT);
                break;

            case SizeDef.big:
                finalSize = new Vector2(LARGE_BUTTON_WIDTH, LARGE_BUTTON_HEIGHT);
                break;
            default:
                Debug.LogError("Unknown button size, defaults to medium.");
                finalSize = new Vector2(MEDIUM_BUTTON_WIDTH, MEDIUM_BUTTON_HEIGHT);
                break;
        }

        return finalSize;
    }