Beispiel #1
0
        protected override void DrawSelf(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
        {
            var ci = GetInstance <Config>();
            var lp = LocalPlayer;
            var ct = lp.carpetTime;
            var wt = lp.wingTime;

            Height.Set(ci.ftbi ? 22 : 18, 0);
            if ((0 < lp.jump || lp.releaseJump) && 1 < Mod0.jc)
            {
                Terraria.Utils.DrawBorderString(sb, "" + Mod0.jc, new Vector2((ci.ftbi ? 85 : 63) + tp.X, tp.Y), Color.White);
            }
            sb.Draw(GetTexture("Widgets/sprites/wp"), new Rectangle((ci.ftbi ? 26 : 4) + (int)tp.X, (ci.ftbi ? 6 : 4) + (int)tp.Y, 50, 10), Color.Black);
            if (0 == lp.velocity.Y && lp.releaseJump || Mod0.ftbc)
            {
                sb.Draw(GetTexture("Widgets/sprites/wp"), new Rectangle((ci.ftbi ? 26 : 4) + (int)tp.X, (ci.ftbi ? 6 : 4) + (int)tp.Y, Mod0.ftbc2 ? 50 : 0 < lp.jump ? (int)Mod0.SD(50 * lp.jump, lp.jump + Mod0.tft) : lp.mount.Active ? (int)Mod0.SD(50 * lp.mount.FlyTime, lp.mount.FlyTime + Mod0.tft) : 0 < wt ? (int)Mod0.SD(50 * wt, Mod0.tft + wt) : 0 < lp.rocketTime ? (int)Mod0.SD(50 * lp.rocketTime, lp.rocketTimeMax) : (int)Mod0.SD(50 * ct, ct + Mod0.tft), 10), Gradient(ci.ftbrg, ci.ftbsc, ci.ftbec, Mod0.ftbc2 ? 1 : 0 < lp.jump ? Mod0.SD(lp.jump, lp.jump + Mod0.tft) : lp.mount.Active ? Mod0.SD(lp.mount.FlyTime, lp.mount.FlyTime + Mod0.tft) : 0 < wt ? Mod0.SD(wt, Mod0.tft + wt) : 0 < lp.rocketTime ? Mod0.SD(lp.rocketTime, lp.rocketTimeMax) : Mod0.SD(ct, ct + Mod0.tft)));
            }
            sb.Draw(GetTexture("Widgets/sprites/bfg"), new Vector2((ci.ftbi ? 22 : 0) + tp.X, (ci.ftbi ? 2 : 0) + tp.Y), Color.White);
            if (ci.ftbi)
            {
                sb.Draw((0 < Mod0.jc || 0 == lp.velocity.Y) && lp.releaseJump || 0 < lp.jump ? GetTexture("Widgets/sprites/ftbi2") : Mod0.ftbc ? 0 < wt || lp.mount.Active ? GetTexture("Widgets/sprites/ftbi4") : 0 < lp.rocketBoots && 0 < lp.rocketTime ? GetTexture("Widgets/sprites/ftbi3") : GetTexture("Widgets/sprites/ftbi") : GetTexture("Widgets/sprites/ftbi5"), new Vector2(tp.X, tp.Y), Color.White);
            }
            base.DrawSelf(sb);
            Width.Set((1 < Mod0.jc ? 5 + fontMouseText.MeasureString("" + Mod0.jc).X : 0) + (ci.ftbi ? 80 : 58), 0);
        }
Beispiel #2
0
 static public void DrawEquipment(ClickableComponent icon, Microsoft.Xna.Framework.Graphics.SpriteBatch b)
 {
     if (icon.item != null)
     {
         b.Draw(Game1.menuTexture, icon.bounds, Game1.getSourceRectForStandardTileSheet(Game1.menuTexture, 10, -1, -1), Color.White);
         icon.item.drawInMenu(b, new Vector2(icon.bounds.X, icon.bounds.Y), icon.scale, 1f, 0.866f, StackDrawType.Hide);
     }
     else
     {
         int tile = 41;
         if (icon.name == "Hat")
         {
             tile = 42;
         }
         if (icon.name == "Shirt")
         {
             tile = 69;
         }
         if (icon.name == "Pants")
         {
             tile = 68;
         }
         if (icon.name == "Boots")
         {
             tile = 40;
         }
         b.Draw(Game1.menuTexture, icon.bounds, Game1.getSourceRectForStandardTileSheet(Game1.menuTexture, tile, -1, -1), Color.White);
     }
 }
Beispiel #3
0
        protected override void DrawSelf(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
        {
            var ci  = GetInstance <Config>();
            var lp  = Main.LocalPlayer;
            var txt = 0 < (int)(lp.HeldItem.mana * lp.manaCost) ? "" + lp.statMana / (int)(lp.HeldItem.mana * lp.manaCost) : "∞";

            if (ci.madb)
            {
                sb.Draw(GetTexture("Widgets/sprites/wp"), new Rectangle((ci.madi ? 20 : 4) + (int)tp.X, (int)tp.Y + 4, 50, 10), Color.Black);
                sb.Draw(GetTexture("Widgets/sprites/wp"), new Rectangle((ci.madi ? 20 : 4) + (int)tp.X, (int)tp.Y + 4, 50 * lp.statMana / lp.statManaMax2, 10), Gradient(ci.madrg, ci.madsc, ci.madec, (float)lp.statMana / lp.statManaMax2));
                sb.Draw(GetTexture("Widgets/sprites/bfg"), new Vector2((ci.madi ? 16 : 0) + tp.X, tp.Y), Color.White);
                if (ci.madi)
                {
                    sb.Draw(GetTexture("Widgets/sprites/madi2"), new Vector2(10 + tp.X, tp.Y), Color.White);
                }
            }
            else
            {
                Utils.DrawBorderString(sb, txt, new Vector2(23 + tp.X, tp.Y), Color.White);
            }
            Height.Set(18, 0);
            if (!ci.madb || ci.madi)
            {
                sb.Draw(GetTexture("Widgets/sprites/madi"), new Vector2(tp.X, tp.Y), Color.White);
            }
            base.DrawSelf(sb);
            Width.Set(ci.madb ? ci.madi ? 74 : 58 : 23 + Main.fontMouseText.MeasureString(txt).X, 0);
        }
        }//end Update

        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            if (imgIndex != 20)
            {
                spriteBatch.Draw(img[imgIndex], new Rectangle((int)PosX, (int)PosY, 100, 100), Color.White);
            }
            else
            {
                spriteBatch.Draw(img[imgIndex], new Rectangle((int)PosX, (int)PosY + 20, 100, 80), Color.White);
            }
        }//end Draw
Beispiel #5
0
 public override void draw(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
 {
     if (rotation >= 0) //We can't have the birds flying upside down
     {
         sb.Draw(sprite, new Rectangle((int)position.X, (int)position.Y, 40, 40), null, Color.White, rotation, new Vector2(width / 2, height / 2), Microsoft.Xna.Framework.Graphics.SpriteEffects.None, 0);
     }
     else
     {
         sb.Draw(sprite, new Rectangle((int)position.X, (int)position.Y, 40, 40), null, Color.White, rotation, new Vector2(width / 2, height / 2), Microsoft.Xna.Framework.Graphics.SpriteEffects.FlipHorizontally, 0);
     }
 }
Beispiel #6
0
 public override void Draw(Microsoft.Xna.Framework.GameTime gameTime, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
 {
     if (PosX + Width < 0)
     {
         PosX = 0;
     }
     spriteBatch.Draw(img[imgIndex], new Vector2(PosX, PosY), Color.White);
     if (-PosX + 1200 >= Width && PosX + Width >= 0)
     {
         float distance = (float)gameTime.ElapsedGameTime.TotalMilliseconds * Velocity;
         spriteBatch.Draw(img[imgIndex], new Vector2(PosX + Width, PosY), Color.White);
     }
 }
Beispiel #7
0
        public override void PostDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color drawColor)
        {
            var player = Main.LocalPlayer;
            var timer  = player.GetModPlayer <StarlightPlayer>().PickupTimer;

            if (timer < 1 || timer > 559)
            {
                return;
            }

            var tex    = ModContent.GetTexture("StarlightRiver/Assets/Abilities/BrassSpike");
            var origin = new Vector2(0, tex.Height / 2);

            float progressFirst = Math.Min(1, timer / 12f);

            if (timer > 300)
            {
                progressFirst = 1 - (timer - 300) / 60f;
            }

            Vector2 positionFirst = player.Center + Vector2.SmoothStep(Vector2.UnitY * 100, Vector2.Zero, progressFirst) - Main.screenPosition;

            spriteBatch.Draw(tex, positionFirst, null, Color.White, (float)Math.PI * 0.5f, origin, 1, 0, 0);

            if (timer > 120)
            {
                for (int k = 0; k < 10; k++)
                {
                    int   relTime  = (timer - (120 + k * 10));
                    int   relTime2 = (timer - (120 + k * 2));
                    float progress = Math.Min(1, relTime / 12f);

                    if (relTime2 > 180)
                    {
                        progress = 1 - (relTime2 - 180) / 60f;
                    }

                    Vector2 position = player.Center + Vector2.SmoothStep(Vector2.UnitX.RotatedBy(k) * 140, Vector2.Zero, progress) - Main.screenPosition;

                    if (progress > 0)
                    {
                        spriteBatch.Draw(tex, position, null, Color.White, k, origin, 1, 0, 0);

                        if (relTime2 < 140)
                        {
                            Dust.NewDustPerfect(player.Center + Vector2.UnitX.RotatedBy(k) * Main.rand.Next(80, 140), ModContent.DustType <Dusts.Glow>(), Vector2.UnitX.RotatedBy(k + 3.14f) * Main.rand.NextFloat(4), 0, new Color(255, 200, 100), 0.25f);
                        }
                    }
                }
            }
        }
Beispiel #8
0
        public override void draw(Microsoft.Xna.Framework.Graphics.SpriteBatch b)
        {
            if (this.visible)
            {
                if (!this.canvasTextureUpdated)
                {
                    this.convertPickerToTexture2D(b.GraphicsDevice);
                }

                Game1.drawDialogueBox(
                    this.xPositionOnScreen - 128,
                    this.yPositionOnScreen - 96,
                    64 + 64,
                    92 + 128,
                    false, true, null, false, true, 60, 50, 40);

                this.dummyChest.draw(b,
                                     this.xPositionOnScreen - 128 - 6 + IClickableMenu.borderWidth,
                                     this.yPositionOnScreen - 4 + IClickableMenu.borderWidth,
                                     1f, true);

                Game1.drawDialogueBox(
                    this.xPositionOnScreen - 32,
                    this.yPositionOnScreen - 96,
                    this.width + 64,
                    this.height + 128,
                    false, true, null, false, true, 60, 50, 40);

                b.Draw(this.canvasTexture, new Microsoft.Xna.Framework.Vector2(this.xPositionOnScreen, this.yPositionOnScreen), Microsoft.Xna.Framework.Color.White);
            }
        }
Beispiel #9
0
        protected override void DrawSelf(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
        {
            var ci = GetInstance <Config>();
            var lp = Terraria.Main.LocalPlayer;

            Height.Set(ci.hbi ? 22 : 18, 0);
            sb.Draw(GetTexture("Widgets/sprites/wp"), new Rectangle((ci.hbi ? 24 : 4) + (int)tp.X, (ci.hbi ? 6 : 4) + (int)tp.Y, 50, 10), Color.Black);
            sb.Draw(GetTexture("Widgets/sprites/wp"), new Rectangle((ci.hbi ? 24 : 4) + (int)tp.X, (ci.hbi ? 6 : 4) + (int)tp.Y, 50 * lp.statLife / lp.statLifeMax2, 10), Gradient(ci.hbrg, ci.hbsc, ci.hbec, (float)lp.statLife / lp.statLifeMax2));
            sb.Draw(GetTexture("Widgets/sprites/bfg"), new Vector2((ci.hbi ? 20 : 0) + tp.X, (ci.hbi ? 2 : 0) + tp.Y), Color.White);
            if (ci.hbi)
            {
                sb.Draw(GetTexture("Widgets/sprites/hbi"), new Vector2(tp.X, tp.Y), Color.White);
            }
            base.DrawSelf(sb);
            Width.Set(ci.hbi ? 78 : 58, 0);
        }
Beispiel #10
0
        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);

            for (int y = 0; y < cells.Length; y++)
            {
                float   margin      = 25f;
                Vector2 destination = new Vector2(Position.Real.X, Position.Real.Y + y * 25);;
                for (int x = 0; x < cells[y].Length; x++)
                {
                    KeyboardButton button = cells[y][x];
                    destination.X = Position.Real.X + x * margin;
                    if (button.HasFocus)
                    {
                        Vector2 size = Font.MeasureString(button.Button);
                        spriteBatch.Draw(Khv.Engine.KhvGame.Temp,
                                         new Rectangle((int)destination.X - (int)((margin - size.X) / 2), (int)destination.Y,
                                                       (int)margin,
                                                       (int)size.Y),
                                         Color.Green);
                    }
                    spriteBatch.DrawString(Font, button.Button, destination, Color.Azure);
                }
            }
        }
Beispiel #11
0
        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);
            string text = textProcessor.Text;

            if (textProcessor.IsTextSelectionEnabled)
            {
                string selectedText = textProcessor.SelectedText;

                // on valittua tekstiä
                if (!selectedText.Equals(""))
                {
                    int startIndex = textProcessor.SelectionStartIndex;
                    int endIndex   = textProcessor.SelectionEndIndex;

                    Vector2 size   = Font.MeasureString(selectedText);
                    Vector2 offset = Vector2.Zero;
                    if (startIndex != 0)
                    {
                        offset = Font.MeasureString(text.Substring(0, startIndex));
                    }

                    Rectangle selectionPosition = new Rectangle((int)Position.Real.X + (int)offset.X, (int)Position.Real.Y, (int)size.X, (int)size.Y);
                    spriteBatch.Draw(Khv.Engine.KhvGame.Temp, selectionPosition, Color.Green);
                }
            }
            Vector2 position = new Vector2(Position.Real.X, Position.Real.Y);

            spriteBatch.DrawString(Font, text, position, Colors.Foreground, 0.0f, Vector2.Zero, 1f, Microsoft.Xna.Framework.Graphics.SpriteEffects.None, 0f);
            spriteBatch.DrawString(Font, caret, caretPositionInPixels, caretColor);
        }
Beispiel #12
0
 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch canvas, int x, int y, bool selected)
 {
     if (selected)
     {
         canvas.Draw(AssetLoader.diamond, new Rectangle(x - 50, y + 6, 40, 15), Color.White);
     }
     canvas.DrawString(AssetLoader.fnt_assetloadscreen, label, new Vector2(x, y), (selected)?Color.White:Color.Gray);
 }
Beispiel #13
0
 protected override void DrawSelf(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
 {
     Height.Set(22, 0);
     sb.Draw(GetTexture("Widgets/sprites/hdi"), new Vector2(tp.X, tp.Y), Color.White);
     Utils.DrawBorderString(sb, Mod0.cap + "%", new Vector2(23 + tp.X, tp.Y), GetInstance <Config>().hdc);
     base.DrawSelf(sb);
     Width.Set(23 + Main.fontMouseText.MeasureString(Mod0.cap + "%").X, 0);
 }
Beispiel #14
0
        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Art.Background,
                             new Rectangle(0, 0, BudaGame.ViewPort.Width, BudaGame.ViewPort.Height), Color.White);
            spriteBatch.DrawString(Art.Font, "Crazy Plane Game", new Vector2(BudaGame.ScreenSize.X / 2 - 200, BudaGame.ScreenSize.Y / 2), Color.Black);

            spriteBatch.DrawString(Art.Font, "Space to play", new Vector2(BudaGame.ScreenSize.X / 2 - 100, BudaGame.ScreenSize.Y / 2 + 50), Color.Black);
            base.Draw(spriteBatch);
        }
Beispiel #15
0
        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            //// return wenn Dropdown nicht gezeigt wird
            if (!IsVisible)
            {
                return;
            }

            // Draw Outlines
            spriteBatch.Draw(mTexture, Position - new Vector2(1, 1), mOutlineRectangle, mOutlineColor);

            // Draw Box
            spriteBatch.Draw(mTexture, Position, mDrawRectangle, mDrawColor);
            // Draw Selected Hover
            if (mHover)
            {
                spriteBatch.Draw(mTexture, mHoverRectangle, mHoverColor);
            }
        }
Beispiel #16
0
        protected override void DrawSelf(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
        {
            var lp = LocalPlayer;

            Height.Set(30, 0);
            sb.Draw(GetTexture("Widgets/sprites/mdi"), new Vector2(tp.X, tp.Y), Color.White);
            Terraria.Utils.DrawBorderString(sb, $"{lp.slotsMinions}/{lp.maxMinions}", new Vector2(35 + tp.X, tp.Y), GetInstance <Config>().mdc);
            base.DrawSelf(sb);
            Width.Set(35 + fontMouseText.MeasureString($"{lp.slotsMinions}/{lp.maxMinions}").X, 0);
        }
Beispiel #17
0
        protected override void DrawSelf(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
        {
            var ci = GetInstance <Config>();
            var lp = Terraria.Main.LocalPlayer;

            Height.Set(ci.itbi ? 22 : 18, 0);
            sb.Draw(GetTexture("Widgets/sprites/wp"), new Rectangle((ci.itbi ? 22 : 4) + (int)tp.X, (ci.itbi ? 6 : 4) + (int)tp.Y, 50, 10), Color.Black);
            if (!lp.dead)
            {
                sb.Draw(GetTexture("Widgets/sprites/wp"), new Rectangle((ci.itbi ? 22 : 4) + (int)tp.X, (ci.itbi ? 6 : 4) + (int)tp.Y, (int)Mod0.SD(50 * lp.immuneTime, 0 == MP.it ? lp.immuneTime + Mod0.tit : MP.it), 10), Gradient(ci.itbrg, ci.itbsc, ci.itbec, Mod0.SD(lp.immuneTime, 0 == MP.it ? lp.immuneTime + Mod0.tit : MP.it)));
            }
            sb.Draw(GetTexture("Widgets/sprites/bfg"), new Vector2((ci.itbi ? 18 : 0) + tp.X, (ci.itbi ? 2 : 0) + tp.Y), Color.White);
            if (ci.itbi)
            {
                sb.Draw(GetTexture("Widgets/sprites/itbi"), new Vector2(tp.X, tp.Y), Color.White);
            }
            base.DrawSelf(sb);
            Width.Set(ci.itbi ? 76 : 58, 0);
        }
Beispiel #18
0
        protected override void DrawSelf(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
        {
            var txt = $"{Main.projectile.Where(_ => _.timeLeft > 0 && _.WipableTurret).Count()}/{Main.LocalPlayer.maxTurrets}";

            Height.Set(22, 0);
            sb.Draw(GetTexture("Widgets/sprites/sdi"), new Vector2(tp.X, tp.Y), Color.White);
            Utils.DrawBorderString(sb, txt, new Vector2(31 + tp.X, tp.Y), GetInstance <Config>().sdc);
            base.DrawSelf(sb);
            Width.Set(31 + Main.fontMouseText.MeasureString(txt).X, 0);
        }
Beispiel #19
0
 public override void draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
 {
     if (colorBar.scale.Y > 0)
     {
         spriteBatch.Draw(backBar.texture, backBar.position + invencibleButton.position, Color.White);
         colorBar.position = new Vector2(invencibleButton.position.X + 10, invencibleButton.position.Y + 165);
         colorBar.draw(spriteBatch);
         invencibleButton.draw(spriteBatch);
     }
 }
Beispiel #20
0
        /// <summary>
        /// Draws the individual <see cref="Komodo.Core.ECS.Components.Drawable2DComponent"/>.
        /// </summary>
        /// <param name="component"><see cref="Komodo.Core.ECS.Components.Drawable2DComponent"/> to render.</param>
        /// <param name="spriteBatch"><see cref="Microsoft.Xna.Framework.Graphics.SpriteBatch"/> to render with.</param>
        private void DrawComponent(Drawable2DComponent component, SpriteBatch spriteBatch)
        {
            var position = component.WorldPosition;
            var rotation = component.Rotation;
            var scale    = component.Scale;

            if (ActiveCamera != null)
            {
                if (component.IsBillboard)
                {
                    position = Vector3.Transform(
                        position,
                        ActiveCamera.ViewMatrix * Matrix.CreateScale(1f, -1f, 1f)
                        );
                }
                else
                {
                    position = Vector3.Transform(
                        position,
                        Matrix.CreateScale(1f, -1f, 1f)
                        );
                }
            }

            switch (component)
            {
            case SpriteComponent spriteComponent:
                spriteBatch.Draw(
                    spriteComponent.Texture.MonoGameTexture,
                    position.XY.MonoGameVector,
                    null,
                    Color.White,
                    -rotation.Z,
                    spriteComponent.Center.MonoGameVector,
                    scale.XY.MonoGameVector,
                    SpriteEffects.None,
                    position.Z
                    );
                break;

            case TextComponent textComponent:
                spriteBatch.DrawString(
                    textComponent.Font,
                    textComponent.Text,
                    position.XY.MonoGameVector,
                    textComponent.Color,
                    -rotation.Z,
                    textComponent.IsCentered ? textComponent.Center.MonoGameVector : Vector2.Zero.MonoGameVector,
                    scale.XY.MonoGameVector,
                    SpriteEffects.None,
                    position.Z
                    );
                break;
            }
        }
Beispiel #21
0
        public override void DrawMenu(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            if (current == pauseMenu || current == mainMenu)
            {
                Camera    camera = graphics.camera;
                Rectangle rect   = new Rectangle(0, 0, camera.screenWidth, camera.screenHeight);
                spriteBatch.Draw(guiTextures[11], rect, Color.White);
            }

            base.DrawMenu(spriteBatch);
        }
Beispiel #22
0
        public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor)
        {
            Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f);

            for (int k = 0; k < projectile.oldPos.Length; k++)
            {
                Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY);
                Color   color   = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length);
                spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, Microsoft.Xna.Framework.Graphics.SpriteEffects.None, 0f);
            }
            return(true);
        }
Beispiel #23
0
 public override void drawMe(bool useOverlay = false, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch = null)
 {
     if (spriteBatch != null && currentSelectedLayer == layer)
     {
         spriteBatch.Draw(Graphics.CTextures.rawTextures["debug:redBox"], new Rectangle((int)(position.X), (int)(position.Y),
                                                                                        _width, _height), null, Color.White);
     }
     else
     {
         base.drawMe(useOverlay, spriteBatch);
     }
 }
Beispiel #24
0
 public override void drawMe(bool useOverlay = false, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch = null)
 {
     if (spriteBatch != null)
     {
         spriteBatch.Draw(Graphics.CTextures.rawTextures["debug:redBox"], new Rectangle((int)(position.X), (int)(position.Y),
                                                                                        16, 16), null, Color.Gold);
     }
     else
     {
         base.drawMe(useOverlay, spriteBatch);
     }
 }
Beispiel #25
0
        protected override void OnDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sb, ref Microsoft.Xna.Framework.Point offect)
        {
            var       tex = drawblock.parent.texture;
            Rectangle src = new Rectangle((int)(drawblock.uv.X * tex.Width),
                                          (int)(drawblock.uv.Y * tex.Height),
                                          (int)(drawblock.uv.Width * tex.Width),
                                          (int)(drawblock.uv.Height * tex.Height));
            Rectangle sdest = dest;

            sdest.X += offect.X;
            sdest.Y += offect.Y;
            sb.Draw(tex, sdest, src, color);
        }
Beispiel #26
0
 public override void  draw(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
 {
     entityManager.handleEvents(entities.ToArray());
     entityManager.animateEntities(entities.ToArray());
     sb.Begin();
     sb.Draw(bgTexture, calculateShift(), null, Color.White);
     if (navDebug)
     {
         navStuff.DebugDraw(sb);
     }
     entityManager.drawEntities(sb, entities.ToArray());
     entityManager.player.draw(sb);
     sb.End();
 }
Beispiel #27
0
        // When you are in magic stance and you cannot cast a fire pillar at your cursor's location, turn the cursor red
        public override void DrawCursor(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            MouseState ms = tileEngine.inputComponent.currentMouseState;

            Color BLAH = Color.White;

            if (tileEngine.world != null && (tileEngine.world as GameWorld).player != null)
            {
                if ((tileEngine.world as GameWorld).player != null && !tileEngine.world.hasLineOfSight((tileEngine.world as GameWorld).player.position, tileEngine.world.getMouseWorldVector(), false) && (((tileEngine.world as GameWorld).player.myBehavior as PlayerBehavior).stance == PlayerBehavior.Stance.magic))
                {
                    BLAH = Color.Red;
                }
                spriteBatch.Draw(engineTextures[0], new Vector2((float)ms.X, (float)ms.Y), BLAH);
            }
        }
Beispiel #28
0
        public override void Draw(GameTime gtime, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            currentLevel.Draw(gtime, spriteBatch);

            float barLevel  = currentLevel.Player.GetRecharge();
            float yBase     = 600;
            float barHeight = 100;


            if (barLevel != 1f)
            {
                spriteBatch.Begin();
                spriteBatch.Draw(ResourceManager.Resources["pixel"], new Rectangle(50, (int)(yBase - barHeight * barLevel), 20, (int)(barHeight * barLevel)), Color.White);
                spriteBatch.End();
            }
        }
Beispiel #29
0
        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch SpriteBatch)
        {
            SpriteBatch.Draw(Texture, RecDestination, Color.White);
            for (int i = 0; i < NbBordures; i++)
            {
                TabBordure[i].Draw(SpriteBatch);
            }

            for (int i = 0; i < GrandsArbre.Length; i++)
            {
                GrandsArbre[i].Draw(SpriteBatch);
            }

            for (int i = 0; i < PetitsArbre.Length; i++)
            {
                PetitsArbre[i].Draw(SpriteBatch);
            }
        }
Beispiel #30
0
        protected override void DrawSelf(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
        {
            var ci = GetInstance <Config>().bc;

            if (IsMouseHovering)
            {
                if (!(md && MP.pm) && GetInstance <Config>().ht)
                {
                    hoverItemName = ht;
                }
                if (MP.pm)
                {
                    LocalPlayer.mouseInterface = true;
                }
            }
            if (PW.widget == this)
            {
                sb.Draw(GetTexture("Widgets/sprites/wp"), new Rectangle((int)tp.X, (int)tp.Y, (int)Width.Pixels, (int)Height.Pixels), new Color(ci.R * MP.blink / 255, ci.G * MP.blink / 255, ci.B * MP.blink / 255, MP.blink));
            }
        }