Ejemplo n.º 1
0
 public void Draw(Texture2D destTexture)
 {
     DrawUtil.DrawSpriteAlpha(_spritesheet, destTexture,
                              GetSourceX(), GetSourceY(),
                              _width, _height,
                              Mathf.RoundToInt(XPos),
                              Mathf.RoundToInt(YPos));
 }
Ejemplo n.º 2
0
        void DrawReady()
        {
            DrawSmallMaze();

            // draw number of lives remaining
            DrawUtil.DrawSpriteAlpha(numbersTexture, _displayTexture, 7 * _curPacManLives, 0, 7, 7, 13, 30);
            DrawUtil.DrawSpriteAlpha(livesTexture, _displayTexture, 0, 0, 31, 7, 21, 30);
            _displayTexture.Apply();
        }
Ejemplo n.º 3
0
        void DrawMainMenu()
        {
            DrawUtil.FillTexture(_displayTexture, new Color(0, 0, 0));
            DrawUtil.DrawSpriteAlpha(menuTexture, _displayTexture, 0, 0, 64, 64, 0, 0);

            int soundOff = 0;

            if (SoundMgr.Singleton.IsOn)
            {
                soundOff = 2;
            }
            else
            {
                soundOff = 1;
            }
            DrawUtil.DrawSpriteAlpha(widgetsTexture, _displayTexture, 0, 7 * soundOff, 30, 7, 34, 14);

            int dispOff = 0;

            switch (DiffMgr.Singleton.Difficulty)
            {
            case Difficulty.Easy:
                dispOff = 3;
                break;

            case Difficulty.Normal:
                dispOff = 2;
                break;

            case Difficulty.Hard:
                dispOff = 1;
                break;

            case Difficulty.Extreme:
                dispOff = 0;
                break;
            }
            DrawUtil.DrawSpriteAlpha(diffTexture, _displayTexture, 0, 7 * dispOff, 25, 7, 28, 21);

            DrawMenuCursor();
            _displayTexture.Apply();
        }
Ejemplo n.º 4
0
        public void Draw(Texture2D destTexture)
        {
            var tx = 0;
            var ty = 0;

            foreach (DotRecord dr in _dots)
            {
                if (dr.isEnergizer)
                {
                    tx = 40;
                    ty = 16;
                }
                else
                {
                    tx = 56;
                    ty = 16;
                }
                DrawUtil.DrawSpriteAlpha(_spritesheet, destTexture, tx, ty, 8, 8, dr.x, dr.y);
            }
        }
Ejemplo n.º 5
0
        private void DrawMenuCursor()
        {
            var  cursorY = 0;
            bool fancy   = false;

            switch (_menuCursorRow)
            {
            case 0: // play
                cursorY = 34;
                fancy   = true;
                break;

            case 1: // diff
                cursorY = 21;
                break;

            case 2: // sound
                cursorY = 14;
                break;

            case 3: // about
                cursorY = 4;
                break;
            }

            if (!fancy)
            {
                DrawUtil.DrawSpriteAlpha(widgetsTexture, _displayTexture, 0, 0, 7, 7, 0, cursorY);
            }
            else
            {
                var _menuCursorLoopLength = 0.85f;
                var wrap  = _menuCursorElapsed / _menuCursorLoopLength;
                var m01   = wrap - Mathf.FloorToInt(wrap);
                var width = 12;
                var steps = Mathf.FloorToInt(width * m01);

                DrawUtil.DrawSpriteAlpha(widgetsTexture, _displayTexture, 0, 0, 7, 7, 20 - width + steps, cursorY);
                DrawUtil.DrawSpriteAlpha(widgetsTexture, _displayTexture, 7, 0, 7, 7, 39 + width - steps, cursorY);
            }
        }
Ejemplo n.º 6
0
 private void DrawGameOver()
 {
     DrawSmallMaze();
     DrawUtil.DrawSpriteAlpha(gameOverTexture, _displayTexture, 0, 0, 25, 15, 20, 25);
     _displayTexture.Apply();
 }
Ejemplo n.º 7
0
 void DrawSpriteAlpha(int spriteX, int spriteY, int spriteWidth, int spriteHeight,
                      int destX, int destY)
 {
     DrawUtil.DrawSpriteAlpha(spriteSheet, _displayTexture,
                              spriteX, spriteY, spriteWidth, spriteHeight, destX, destY);
 }