예제 #1
0
    public MenuActions draw()
    {
        MenuActions menuAction = MenuActions.none;

        GUI.DrawTexture(backgroundRect, background, ScaleMode.ScaleAndCrop, false, 0);

        GUILayout.BeginArea(guiRect);
        GUILayout.BeginVertical();
        {
            GUILayout.Label("Set left and right mouse buttons", GuiFunctions.getNormalStyle(Color.black));

            GUILayout.BeginHorizontal();
            foreach (GameOptions.toolModes toolMode in Enum.GetValues(typeof(GameOptions.toolModes)))
            {
                if (GUILayout.Button(ResourceLookup.getToolModeTexture(toolMode), toolGuiOptions))
                {
                    setMouseButton(toolMode);
                }
                GUILayout.Space(toolIconSpacing);
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(toolIconSpacing);
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            drawMouseIcon(0);
            GUILayout.FlexibleSpace();
            drawMouseIcon(1);
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
        }
        GUILayout.EndVertical();
        GUILayout.EndArea();

        return(menuAction);
    }
예제 #2
0
    public GameHud(BlockSelectMenu blockSelectMenu)
    {
        normalStyle          = GuiFunctions.getNormalStyle(Color.white);
        this.blockSelectMenu = blockSelectMenu;

        float slotWidth = Screen.width / 20;

        selectedBlockScale    = slotWidth / 16;
        selectedBlockPosition = new Vector2(Screen.width - (float)(slotWidth * 1.5),
                                            Screen.height - (float)(slotWidth * 2.5));
    }
예제 #3
0
    public BlockSelectMenu(ShipInfo shipInfo)
    {
        this.shipInfo = shipInfo;
        background    = Resources.Load(ResourcePaths.toolSelectBackground) as Texture;
        normalStyle   = GuiFunctions.getNormalStyle(Color.black);

        slotWidth  = Screen.width / 12;
        slotHeight = slotWidth * 2;

        float ySpace = Screen.height / 2 - (float)(slotHeight * 1.2);

        backgroundRect = new Rect(0, ySpace, Screen.width, Screen.height - ySpace * 2);

        slotGuiOptions = new GUILayoutOption[4] {
            GUILayout.Width(slotWidth),
            GUILayout.Height(slotHeight), GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)
        };
        selectedBlockStacks = new BlockStack[slotPositions];
    }