public void draw(SpriteBatchWrapper sprites)
        {
            if (!this.listening)
                return;

            this.drawGlassPane(sprites);

            Vector2 center = sprites.getCenterOfScreen();
            int boxWidth = 500;
            int boxHeight = 150;
            int boxX = (int)(center.X - (boxWidth / 2));
            int boxY = (int)(center.Y - (boxHeight / 2));

            this.drawBox(sprites, boxWidth, boxHeight, boxX, boxY);

            if (null != this.message) {
                int msgHeight = sprites.getHeightOfText(this.message, 1.0f, MESSAGE_FONT_NAME);
                int msgWidth = sprites.getWidthOfText(this.message, 1.0f, MESSAGE_FONT_NAME);
                int msgY = boxY + (boxHeight / 4) - (msgHeight / 2);
                int msgX = (int) center.X - (msgWidth / 2);

                sprites.drawTextAt(this.message, msgX, msgY, 1.0f, Color.LightGray, MESSAGE_FONT_NAME);
            }

            this.drawTextBox(sprites, center, boxWidth);
        }
        public void draw(SpriteBatchWrapper sprites, GraphicsDevice device)
        {
            if (this.exit)
                return;

            //this.textures.drawAsBackground(this.backgroundTexture, sprites);
            this.background.draw(sprites);

            if (null != this.currentSequence &&
                    this.currentSequence.isEnemyShown(this.song.timeRunningInMeasures)) {

                this.enemy.draw(sprites);
            } else {
                this.player.draw(sprites);
            }

            sprites.drawDebugText(this.progress.errorInLastSequence, "Missed:", this.missed, "Wrong:", this.wrong);
            /*sprites.drawDebugText(
                "Measures: ", this.song.timeRunningInMeasures,
                "Current Seq: ", this.currentSequence, "Last Move:", this.lastMove,
                "\n\rScore: ", this.progress.score);*/

            sprites.drawTextAt(
                "Score: " + this.progress.score,
                -225, 15, 1.05f, Color.Black, "hud/ingametext", SpriteBatchWrapper.Direction.CENTER);
            sprites.drawTextAt(
                "Score: " + this.progress.score,
                -225, 15, 1.0f, Color.Orange, "hud/ingametext", SpriteBatchWrapper.Direction.CENTER);

            this.ui.draw(sprites);
        }
        public void draw(SpriteBatchWrapper sprites)
        {
            if (!this.isMoving)
                return;

            //TODO add a fade in, for negative travel values

            Vector2 startingPosition = this.direction * CENTER_OFFSET;
            Vector2 position = this.direction * this.travel;
            position *= DirectionalIndicator.FREEDOM;
            position += startingPosition;

            int undergroth = 10 + (int)(this.travel * 50);
            int width = (int)(this.texture.Width + (this.growth * this.texture.Width));
            int height = (int)(this.texture.Height + (this.growth * this.texture.Height));

            sprites.drawFromCenter(
                this.texture.texture,
                width + undergroth,
                height + undergroth,
                (int) position.X * -1,
                (int) position.Y * -1,
                Color.Black * (1f - this.travel));

            sprites.drawFromCenter(
                this.texture.texture,
                width,
                height,
                (int) position.X * -1,
                (int) position.Y * -1,
                this.color);
        }
        public void draw(SpriteBatchWrapper sprites)
        {
            if (null == this.activeTexture)
                return;

            this.activeTexture.drawCentered(sprites, 450, 450, 75);
        }
 public void draw(SpriteBatchWrapper sprites, GraphicsDevice device)
 {
     if (this.wantsToExit()) {
         return;
     }
     this.activeScene.draw(sprites, device);
 }
        public void draw(SpriteBatchWrapper sprites, GraphicsDevice device)
        {
            sprites.drawBackground(this.background);
            sprites.drawTextAt("Highscore: " + this.stageName, 50, 30, 1.0f, Color.White, "hud/ingametext");
            //sprites.drawTextCentered(this.stageName + " - Highscore", -9, Color.Black);

            this.drawScores(sprites);
            this.nameInput.draw(sprites);
        }
Exemple #7
0
        public void draw(SpriteBatchWrapper sprites)
        {
            sprites.fillWithColor(Color.White, this.flash);

            this.transitions.draw(sprites);

            foreach (KeyValuePair<InputState.Move, DirectionalIndicator> hudElement in this.hud) {
                hudElement.Value.draw(sprites);
            }
        }
Exemple #8
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            this.GraphicsDevice.Clear(Color.CornflowerBlue);

            this.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
            SpriteBatchWrapper wrapper = new SpriteBatchWrapper(
                this.spriteBatch, this.GraphicsDevice, this.contentUti);
            this.scene.draw(wrapper, this.GraphicsDevice);
            this.spriteBatch.End();

            base.Draw(gameTime);
        }
 public void draw(SpriteBatchWrapper sprites)
 {
     sprites.drawBackground(this.bakground);
     if (null != this.beatSigns) {
         foreach (BeatLayer beatsign in this.beatSigns) {
             sprites.drawBackground(beatsign.texture, beatsign.alpha);
         }
     }
     if (null != this.countSigns) {
         for (int i = 0; i < this.countsShown; i++) {
             sprites.drawBackground(this.countSigns[i]);
         }
     }
 }
 public void draw(SpriteBatchWrapper sprites)
 {
     if (null == current) {
         return;
     } else {
         sprites.drawFromCenter(
             this.texture,
             this.getScaledSize(),
             this.getScaledSize(),
             (int)this.centerOffset.X,
             (int)this.centerOffset.Y,
             this.color * this.current.alpha);
     }
 }
        public void draw(SpriteBatchWrapper sprites, GraphicsDevice device)
        {
            if (null != backgroundColor)
                sprites.fillWithColor(backgroundColor, 1.0f);
            if (!targetSizeIsValid()) {
                this.targetSize = sprites.calcMaxProportionalSize(this.picture);
            }

            sprites.drawFromCenter(
                this.picture,
                this.targetSize.Width,
                this.targetSize.Height,
                0, 0,
                Color.White * this.fadeAmount);
        }
        public void draw(SpriteBatchWrapper sprites, GraphicsDevice device)
        {
            sprites.fillWithColor(Color.Black, 1.0f);

            if (null == this.player || MediaState.Stopped == this.player.State)
                return;

            Texture2D videoTexture = player.GetTexture();
            if (null != videoTexture) {
                if (0 == this.size.Width)
                    this.size = sprites.calcMaxProportionalSize(videoTexture);

                sprites.drawFromCenter(videoTexture, this.size.Width, this.size.Height);
            }
        }
Exemple #13
0
        /*public virtual void drawInLine(SpriteBatchWrapper sprites, int line) {
            sprites.drawTextCentered(this.title, line, this.selected ? Color.Orange : Color.GhostWhite);
        }*/
        public virtual void drawFromCenter(SpriteBatchWrapper sprites, int x, int y)
        {
            int width = sprites.getWidthOfText(this.title, 1.0f, FONTNAME);
            int textureWidth = this.texture.bounds.Width;
            if (textureWidth < width + 20) {
                textureWidth = width + 20;
            }

            sprites.drawTextureAt(
                this.texture.texture, textureWidth, this.texture.bounds.Height,
                x - textureWidth/2, y);

            int textY = y + (int)(this.texture.bounds.Height * .3);

            sprites.drawTextAt(
                this.title, x - width / 2, textY, 1.0f,
                this.selected ? Color.Orange : Color.GhostWhite, FONTNAME);
        }
 public void draw(SpriteBatchWrapper sprites)
 {
     this.performOnAll(x => x.draw(sprites));
 }
 public void drawCentered(SpriteBatchWrapper sprites, int width, int height, int offsetY)
 {
     sprites.drawFromCenter(this.texture, this.activeFrame, width, height, 0, offsetY);
 }
 internal void drawAsBackground(String name, SpriteBatchWrapper sprites)
 {
     if (null != name && this.textures.ContainsKey(name)){
         sprites.drawBackground(this.textures[name]);
     }
 }
Exemple #17
0
        public void draw(SpriteBatchWrapper sprites, GraphicsDevice device)
        {
            sprites.drawBackground(background);

            Vector2 center = sprites.getCenterOfScreen();
            int totalHeight = 0;
            foreach (MenuItem item in this.items) {
                totalHeight += item.getHeight();
            }

            int y = (int)sprites.getCenterOfScreen().Y - (totalHeight/2);
            foreach (MenuItem item in this.items) {
                item.drawFromCenter(sprites, (int)center.X, y);
                y += item.getHeight();
            }
        }
Exemple #18
0
 private void drawBox(SpriteBatchWrapper sprites, int boxWidth, int boxHeight, int boxX, int boxY)
 {
     sprites.drawColorAt(new Color(.2f, .2f, .2f), 1.0f,
         boxWidth, boxHeight,
         boxX, boxY);
 }
Exemple #19
0
 private void drawGlassPane(SpriteBatchWrapper sprites)
 {
     sprites.fillWithColor(Color.Black, .5f);
 }
Exemple #20
0
        private void drawTextBox(SpriteBatchWrapper sprites, Vector2 center, int boxWidth)
        {
            int textboxWidth = (boxWidth * 8) / 10;
            int textHeight = sprites.getHeightOfText("Foo", 1.0f, INPUT_FONT_NAME);
            int textBoxHeight = textHeight + (textHeight / 5);
            int textboxX = (int) center.X - ((boxWidth * 4) / 10);
            int textX = textboxX + 15;
            int textboxY = (int) center.Y;
            int textY = textboxY + (textHeight / 10);
            int visibleChars = 32;

            sprites.drawColorAt(Color.Black, 1.0f, textboxWidth, textBoxHeight, textboxX, textboxY);

            String textToDraw = this.text;

            bool cutoff = this.text.Length > visibleChars;
            if (cutoff) {
                textToDraw = this.text.Substring(
                    this.text.Length - visibleChars);
                sprites.drawColorAt(Color.Orange, 1.0f, 5, textBoxHeight, textboxX, textboxY);
            }

            if (this.showCursor) {
                textToDraw += "_";
            }
            sprites.drawTextAt(textToDraw, textX, textY, 1.0f, Color.Orange, INPUT_FONT_NAME);
        }
        private void drawScores(SpriteBatchWrapper sprites)
        {
            int i = 0;
            foreach (Scoring score in this.scores.getSortedRange(0, 8)) {
                int baseline = 120 + (60 * i++);

                sprites.drawTextureAt(
                    this.lineBackground.texture,
                    this.lineBackground.Width,
                    this.lineBackground.Height,
                    220, baseline);

                Color textColor = score.isNew ? Color.AliceBlue : Color.Black;
                int textbase = baseline + 18;

                sprites.drawTextAt("" + i, 270, textbase, 1.0f, textColor,
                    "hud/highscoreline", SpriteBatchWrapper.Direction.RIGHT);

                sprites.drawTextAt(score.name, 300, textbase, 1.0f, textColor,
                    "hud/highscoreline", SpriteBatchWrapper.Direction.LEFT);

                sprites.drawTextAt("" + score.score, 970, textbase, 1.0f, textColor,
                    "hud/highscoreline", SpriteBatchWrapper.Direction.RIGHT);
            }
        }
 public void draw(SpriteBatchWrapper sprites, GraphicsDevice device)
 {
     if (null != this.activeScene) {
         this.activeScene.draw(sprites, device);
     }
 }