private void drawExtendedHUD(AD2SpriteBatch sb, DrawParams d, Coord item) { //back panel int hideOffset = (d.ReflectX ? (PanelWidth + -(int)(Extend * PanelWidth)) : (-PanelWidth + (int)(Extend * PanelWidth))); sb.DrawTexture(BackPanel, d.HUDX + hideOffset, d.HUDY); Coord portrait = findPortraitPosition(d, hideOffset); int itemHideOffset = (d.ReflectX ? (ItemFrameWidth + -(int)(Extend * ItemFrameWidth)) : (-ItemFrameWidth + (int)(Extend * ItemFrameWidth))); Coord itemBar = findItemBarPosition(d, item, itemHideOffset); //portrait if (d.ReflectX) { sb.DrawTextureHFlip(RaceUtils.GetPotrait(Player.Race), d.HUDX + portrait.X, d.HUDY + portrait.Y); sb.DrawTextureHFlip(ItemFrameBig, d.HUDX + itemBar.X, d.HUDY + itemBar.Y); } else { sb.DrawTexture(RaceUtils.GetPotrait(Player.Race), d.HUDX + portrait.X, d.HUDY + portrait.Y); sb.DrawTexture(ItemFrameBig, d.HUDX + itemBar.X, d.HUDY + itemBar.Y); } }
//Corner args public void DrawBars(AD2SpriteBatch sb) { DrawParams d = generateDrawParams(); //name Utils.DefaultFont.Draw(sb, Player.Name, d.NameX, d.NameY, Color.White, 1, true); Coord bar = findBarPosition(d); Coord item = findItemPosition(d, bar); //Extended GUI. drawExtendedHUD(sb, d, item); sb.DrawTexture(StatBar, d.HUDX + bar.X, d.HUDY + bar.Y); sb.DrawTexture(ItemFrame, d.HUDX + item.X, d.HUDY + item.Y); Utils.DrawRect(sb, d.HUDX + 1 + bar.X, d.HUDY + 1 + bar.Y, 20, 9, Color.Red); Utils.DrawRect(sb, d.HUDX + 1 + bar.X, d.HUDY + 11 + bar.Y, 20, 9, Color.Blue); Utils.DrawRect(sb, d.HUDX + 1 + bar.X, d.HUDY + 21 + bar.Y, 20, 9, Color.Green); Utils.DefaultFont.Draw(sb, Player.HP.ToString(), d.HUDX + 4 + bar.X, d.HUDY + 2 + bar.Y, Color.White, 1, true); Utils.DefaultFont.Draw(sb, Player.MP.ToString(), d.HUDX + 4 + bar.X, d.HUDY + 12 + bar.Y, Color.White, 1, true); Utils.DefaultFont.Draw(sb, Player.FA.ToString(), d.HUDX + 4 + bar.X, d.HUDY + 22 + bar.Y, Color.White, 1, true); }
public void Draw(AD2SpriteBatch sb) { sb.DrawTexture(BallTexture, (int)PositionX, (int)PositionY); if (DontBeMadTimer < 0) Utils.DefaultFont.Draw(sb, "ENJOY THE MUSIC", 40, 212, Color.White, 2, true); }
public void Draw(AD2SpriteBatch sb) { //Draw the title screen. sb.DrawTexture(TitleSreen, 0, 0, Breakout.BaseWidth, Breakout.BaseHeight); Utils.DefaultFont.Draw(sb, "PRESS ENTER TO BEGIN", 40, 140, Color.White, 2, true); }
public void DrawObjects(AD2SpriteBatch sb, int camX, int camY, int floorY) { foreach (AD2Object a in objectRows[floorY]) { sb.DrawTexture(a.t, a.X + -camX, floorY + -(a.t.Height - 1) + -camY); } }
public void Draw(AD2SpriteBatch sb) { Renderer.GraphicsDevice.Clear(new Color(20, 0, 28)); Utils.DefaultFont.Draw(sb, "CHOOSE YOUR CHARACTER", 50, 50, Color.White, 3); Pirate.Draw(sb, 10 + 50, 10 + 100, 24 * 2, 32 * 2); Dragon.Draw(sb, 10 + 100, 10 + 100, 24 * 2, 32 * 2); Meximage.Draw(sb, 10 + 150, 10 + 100, 24 * 2, 32 * 2); Ninja.Draw(sb, 10 + 200, 10 + 100, 24 * 2, 32 * 2); sb.DrawTexture(Arrow, 63 + (50 * CharacterSelect), 91, Color.DarkOrange); }
public void Draw(AD2SpriteBatch sb) { //Draw the GUI. sb.DrawTexture(GUIBackground, Breakout.StageWidth + 25, 94, 10, 16); Utils.DefaultFont.Draw(sb, "LEVEL", Breakout.StageWidth + 4, 4, Color.Red, 1); Utils.DefaultFont.Draw(sb, "1", Breakout.StageWidth + 24, 0, Color.White, 3); Utils.DefaultFont.Draw(sb, "SCORE:", Breakout.StageWidth + 4, 30, Color.Red, 1); Utils.DefaultFont.Draw(sb, (Ball.Points * 100).ToString(), Breakout.StageWidth + 25, 38, Color.White, 1); Utils.DefaultFont.Draw(sb, "HIGH", Breakout.StageWidth + 4, 54, Color.Red, 1); Utils.DefaultFont.Draw(sb, "SCORE:", Breakout.StageWidth + 12, 62, Color.Red, 1); Utils.DefaultFont.Draw(sb, (Ball.Points * 100).ToString(), Breakout.StageWidth + 25, 70, Color.White, 1); Utils.DefaultFont.Draw(sb, "LIVES", Breakout.StageWidth + 4, 86, Color.Red, 1); Utils.DefaultFont.Draw(sb, "X" + Ball.BallsLeft.ToString(), Breakout.StageWidth + 36, 100, Color.White, 1); }
protected override void AD2Draw(AD2SpriteBatch primarySpriteBatch) { Level.drawBase(primarySpriteBatch, CamX, 0); Player.draw(primarySpriteBatch, CamX); foreach (Baddie b in Baddies) { b.draw(primarySpriteBatch, CamX); } foreach (Bullet b in Bullets) { primarySpriteBatch.DrawTexture(Bullet.texture, b.x + -2 + -CamX, b.y + -2); } }
public void RenderLightMap(AD2SpriteBatch sb, Color ambient, int camX, int camY, int w, int h) { Renderer.GraphicsDevice.SetRenderTarget(LightMapR); ClearToAmbient(ambient); LightBatch.Begin(SpriteSortMode.Deferred, Alphacomp, null, null, null); foreach (Light l in Lights) { DrawLight(l,camX,camY); } LightBatch.End(); Renderer.GraphicsDevice.SetRenderTarget(null); ToTransparent(); sb.DrawTexture(TransMap,0,0); }
public void RenderLightMap(AD2SpriteBatch sb, Color ambient, int camX, int camY, int w, int h) { Renderer.GraphicsDevice.SetRenderTarget(LightMapR); ClearToAmbient(ambient); LightBatch.Begin(SpriteSortMode.Deferred, Alphacomp, null, null, null); foreach (Light l in Lights) { DrawLight(l, camX, camY); } LightBatch.End(); Renderer.GraphicsDevice.SetRenderTarget(null); ToTransparent(); sb.DrawTexture(TransMap, 0, 0); }
protected override void AD2Draw(AD2SpriteBatch primarySpriteBatch) { primarySpriteBatch.DrawTexture(baseMap, -camX, -camY); for (int y = 0; y != objectsList.Length; y++) { foreach (AD2Object a in objectsList[y]) { if (Viewmode.Equals(Viewmodes.Object)) { primarySpriteBatch.DrawTexture(a.t, a.X + -camX, y + -(a.t.Height - 1) + -camY); } if (Viewmode.Equals(Viewmodes.FiftyPercent)) { primarySpriteBatch.DrawTexture(a.collide, a.X + -camX, y + -(a.t.Height - 1) + -camY, new Color(1f, 1f, 1f, 1f)); primarySpriteBatch.DrawTexture(a.t, a.X + -camX, y + -(a.t.Height - 1) + -camY, new Color(1f, 1f, 1f, 0.7f)); } if (Viewmode.Equals(Viewmodes.Collide)) { primarySpriteBatch.DrawTexture(a.collide, a.X + -camX, y + -(a.t.Height - 1) + -camY); } } if (putMode && camY + mouseY + (TextureList[putPointer].Height - 1) == y) { if (Viewmode.Equals(Viewmodes.Object)) { primarySpriteBatch.DrawTexture(TextureList[putPointer], mouseX, mouseY); } else { primarySpriteBatch.DrawTexture(CollideTextureList[putPointer], mouseX, mouseY); primarySpriteBatch.DrawTexture(TextureList[putPointer], mouseX, mouseY, new Color(1f, 1f, 1f, 0.7f)); } } } if (!putMode) { primarySpriteBatch.DrawTexture(mouse, mouseX, mouseY); } //GUI on top Utils.DrawRect(primarySpriteBatch, 0, 0, BaseWidth, 10, new Color(0.5f, 0.5f, 0.5f, 0.5f)); Utils.DefaultFont.Draw(primarySpriteBatch, "F1/NEW F2/SAVE F3/LOAD F4/HELP V/VIEW C/COLLIDE R/RULER", 1, 1, Color.White, 1, true, Color.Black); if (objectsCanCollide) { primarySpriteBatch.DrawTexture(allowCollide, BaseWidth - 10, 0); } else { primarySpriteBatch.DrawTexture(disableCollide, BaseWidth - 10, 0); } }
public static void DrawRect(AD2SpriteBatch sb, int x, int y, int w, int h, Color c) { sb.DrawTexture(WhiteRect, x, y, w, h, c); }
//Corner args public void DrawBars(AD2SpriteBatch sb) { DrawParams d = generateDrawParams(); //name Utils.DefaultFont.Draw(sb, Player.Name, d.NameX, d.NameY, Color.White, 1, true); Coord bar = findBarPosition(d); Coord item = findItemPosition(d, bar); //Extended GUI. drawExtendedHUD(sb, d,item); sb.DrawTexture(StatBar, d.HUDX + bar.X, d.HUDY + bar.Y); sb.DrawTexture(ItemFrame, d.HUDX + item.X, d.HUDY + item.Y); Utils.DrawRect(sb, d.HUDX + 1 + bar.X, d.HUDY + 1 + bar.Y, 20, 9, Color.Red); Utils.DrawRect(sb, d.HUDX + 1 + bar.X, d.HUDY + 11 + bar.Y, 20, 9, Color.Blue); Utils.DrawRect(sb, d.HUDX + 1 + bar.X, d.HUDY + 21 + bar.Y, 20, 9, Color.Green); Utils.DefaultFont.Draw(sb, Player.HP.ToString(), d.HUDX + 4 + bar.X, d.HUDY + 2 + bar.Y, Color.White, 1, true); Utils.DefaultFont.Draw(sb, Player.MP.ToString(), d.HUDX + 4 + bar.X, d.HUDY + 12 + bar.Y, Color.White, 1, true); Utils.DefaultFont.Draw(sb, Player.FA.ToString(), d.HUDX + 4 + bar.X, d.HUDY + 22 + bar.Y, Color.White, 1, true); }
public void Draw(AD2SpriteBatch sb) { sb.DrawTexture(PaddleTexture, (int)PositionX, PositionY); }