コード例 #1
0
ファイル: ArrowPrompt.cs プロジェクト: IJkeB/Ekster1
        public void DrawArrows()
        {
            if (alpha > 0f)
            {
                if (directionToAnimate != AC_Direction.None)
                {
                    SetGUIAlpha(alpha);

                    if (directionToAnimate == AC_Direction.Up)
                    {
                        upArrow.rect = KickStarter.mainCamera.LimitMenuToAspect(AdvGame.GUIRect(0.5f, 0.1f, arrowSize * 2, arrowSize));
                    }

                    else if (directionToAnimate == AC_Direction.Down)
                    {
                        downArrow.rect = KickStarter.mainCamera.LimitMenuToAspect(AdvGame.GUIRect(0.5f, 0.9f, arrowSize * 2, arrowSize));
                    }

                    else if (directionToAnimate == AC_Direction.Left)
                    {
                        leftArrow.rect = KickStarter.mainCamera.LimitMenuToAspect(AdvGame.GUIRect(0.05f, 0.5f, arrowSize, arrowSize * 2));
                    }

                    else if (directionToAnimate == AC_Direction.Right)
                    {
                        rightArrow.rect = KickStarter.mainCamera.LimitMenuToAspect(AdvGame.GUIRect(0.95f, 0.5f, arrowSize, arrowSize * 2));
                    }
                }

                else
                {
                    SetGUIAlpha(alpha);

                    if (upArrow.isPresent)
                    {
                        upArrow.rect = KickStarter.mainCamera.LimitMenuToAspect(AdvGame.GUIRect(0.5f, 0.1f, 0.1f, 0.05f));
                    }

                    if (downArrow.isPresent)
                    {
                        downArrow.rect = KickStarter.mainCamera.LimitMenuToAspect(AdvGame.GUIRect(0.5f, 0.9f, 0.1f, 0.05f));
                    }

                    if (leftArrow.isPresent)
                    {
                        leftArrow.rect = KickStarter.mainCamera.LimitMenuToAspect(AdvGame.GUIRect(0.05f, 0.5f, 0.05f, 0.1f));
                    }

                    if (rightArrow.isPresent)
                    {
                        rightArrow.rect = KickStarter.mainCamera.LimitMenuToAspect(AdvGame.GUIRect(0.95f, 0.5f, 0.05f, 0.1f));
                    }
                }

                upArrow.Draw();
                downArrow.Draw();
                leftArrow.Draw();
                rightArrow.Draw();
            }
        }
コード例 #2
0
ファイル: ArrowPrompt.cs プロジェクト: linuslc/Phobophobia
        /**
         * Draws the arrow(s) on screen, if appropriate.
         * This function is called every frame by StateHandler.
         */
        public void DrawArrows()
        {
            if (alpha > 0f)
            {
                if (directionToAnimate != AC_Direction.None)
                {
                    SetGUIAlpha(alpha);

                    switch (directionToAnimate)
                    {
                    case AC_Direction.Up:
                        upArrow.rect = GetUpRect(arrowSize);
                        break;

                    case AC_Direction.Down:
                        downArrow.rect = GetDownRect(arrowSize);
                        break;

                    case AC_Direction.Left:
                        leftArrow.rect = GetLeftRect(arrowSize);
                        break;

                    case AC_Direction.Right:
                        rightArrow.rect = GetRightRect(arrowSize);
                        break;
                    }
                }

                else
                {
                    SetGUIAlpha(alpha);

                    if (upArrow.isPresent)
                    {
                        upArrow.rect = GetUpRect();
                    }

                    if (downArrow.isPresent)
                    {
                        downArrow.rect = GetDownRect();
                    }

                    if (leftArrow.isPresent)
                    {
                        leftArrow.rect = GetLeftRect();
                    }

                    if (rightArrow.isPresent)
                    {
                        rightArrow.rect = GetRightRect();
                    }
                }

                upArrow.Draw();
                downArrow.Draw();
                leftArrow.Draw();
                rightArrow.Draw();
            }
        }