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); } }
private void DrawWorldNoLighting(AD2SpriteBatch sb, int cameraX, int cameraY) { Map.drawBase(sb, cameraX, cameraY, CastleSpire.BaseWidth, CastleSpire.BaseHeight); Item.DrawGlowingItems(sb, allPlayers(), FloorItems, cameraX, cameraY); foreach (Item i in FloorItems) { i.Draw(sb, cameraX, cameraY); } for (int y = 0; y != CastleSpire.BaseHeight + 120; y++) { Map.drawObjectLine(sb, cameraX, cameraY, CastleSpire.BaseWidth, CastleSpire.BaseHeight, y); //THIS WILL WORK when drawObjectLine correctly does //Keep in mind draw object line should look for a low wall then rise up. //What this is doing is over-drawing all of the walls. foreach (PC p in allPlayers()) { if ((cameraY + y) == (p.Y + (p.Size - 1))) { p.Draw(sb, cameraX, cameraY); } } } Map.drawAlways(sb, cameraX, cameraY, CastleSpire.BaseWidth, CastleSpire.BaseHeight); }
public void DrawOutline(AD2SpriteBatch sb, int camX, int camY) { sb.Draw(Outline, new Rectangle((-camX + X + -OffsetX), (-camY + Y + 1 + -OffsetY), Texture.Width / 4, Texture.Height), new Rectangle(16, 0, Texture.Width / 4, Texture.Height), Color.White); sb.Draw(Outline, new Rectangle((-camX + X + 1 + -OffsetX), (-camY + Y + -OffsetY), Texture.Width / 4, Texture.Height), new Rectangle(16, 0, Texture.Width / 4, Texture.Height), Color.White); sb.Draw(Outline, new Rectangle((-camX + X + -OffsetX), (-camY + Y + -1 + -OffsetY), Texture.Width / 4, Texture.Height), new Rectangle(16, 0, Texture.Width / 4, Texture.Height), Color.White); sb.Draw(Outline, new Rectangle((-camX + X + -1 + -OffsetX), (-camY + Y + -OffsetY), Texture.Width / 4, Texture.Height), new Rectangle(16, 0, Texture.Width / 4, Texture.Height), Color.White); }
//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); }
//draw the frame, but can be stretched public void Draw(AD2SpriteBatch sb, int x, int y, int w, int h) { if (CurrentAnimation != null) { CurrentAnimation.Draw(sb, XFrame, YFrame, x, y, w, h); } }
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 override void Draw(PixelFont f,AD2SpriteBatch sb) { if (HP > 0) f.Draw(sb, Symbol.ToString(), BasementExplorer.MapXOffset + X, BasementExplorer.MapYOffset + Y, Color.Red); else f.Draw(sb, Symbol.ToString(), BasementExplorer.MapXOffset + X, BasementExplorer.MapYOffset + Y, Color.DarkRed); }
//draw the frame, no stretching. public void Draw(AD2SpriteBatch sb, int x, int y, Color tint) { if (CurrentAnimation != null) { CurrentAnimation.Draw(sb, XFrame, YFrame, x, y, tint); } }
protected override void AD2Draw(AD2SpriteBatch primarySpriteBatch) { LinkedList<int[]> coords = new LinkedList<int[]>(); int[] coord = new int[] { P.X + (P.Size / 2), P.Y + (P.Size / 2) }; coords.AddFirst(coord); //TODO: Don't like this behavior of map. TestMap.DrawBase(primarySpriteBatch,-MapXOffset,-MapYOffset); foreach (Creature e in DeadCreatures) { e.Draw(IBMFont, primarySpriteBatch); } foreach (Item i in ItemsOnGround) { i.Draw(IBMFont, primarySpriteBatch); } foreach (Creature e in AliveCreatures) { e.Draw(IBMFont, primarySpriteBatch); } //THIS is UGLY. TestMap.RenderRoofs(primarySpriteBatch, TestMap.getLOS(coords,-MapXOffset,-MapYOffset), -MapXOffset, -MapYOffset); //Draw borders around the map. Utils.DrawRect(primarySpriteBatch, 0, 0, 70, 300, Color.Black); Utils.DrawRect(primarySpriteBatch, 400 - 70, 0, 70, 300, Color.Black); Utils.DrawRect(primarySpriteBatch, 0, 0, 400, 20, Color.Black); Utils.DrawRect(primarySpriteBatch, 0, 280, 400, 20, Color.Black); H.Draw(IBMFont, primarySpriteBatch); }
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); } }
// Here we instantiate the Graphics Device, set the screen res, then allow the users to load stuff protected override void LoadContent() { Renderer.GraphicsDevice = Renderer.GraphicsDeviceManager.GraphicsDevice; PrimarySpriteBatch = new AD2SpriteBatch(Renderer.GraphicsDevice); Renderer.setResolution(BaseWidth, BaseHeight); Utils.Load(); AD2LoadContent(); }
public static void Draw(AD2SpriteBatch sb, Clock c) { Utils.DrawRect(sb, (CastleSpire.BaseWidth / 2) - (Width / 2), CastleSpire.BaseHeight - 7, Width, 7, Color.Black); Utils.DefaultFont.Draw(sb, c.MonthDay(), (CastleSpire.BaseWidth / 2) - (Width / 2) + 1, CastleSpire.BaseHeight - 7, Color.Orange, 1); Utils.DefaultFont.Draw(sb, c.HourMin(), (CastleSpire.BaseWidth / 2) - 1, CastleSpire.BaseHeight - 7, Color.Orange, 1); Utils.DefaultFont.Draw(sb, c.AMPM(), (CastleSpire.BaseWidth / 2) + 17, CastleSpire.BaseHeight - 7, Color.Orange, 1); }
public static void Draw(AD2SpriteBatch sb, Clock c) { Utils.DrawRect(sb, (CastleSpire.BaseWidth / 2) - (Width / 2), CastleSpire.BaseHeight - 7, Width, 7, Color.Black); Utils.DefaultFont.Draw(sb, c.MonthDay(), (CastleSpire.BaseWidth / 2) - (Width / 2) + 1, CastleSpire.BaseHeight - 7,Color.Orange,1); Utils.DefaultFont.Draw(sb, c.HourMin(), (CastleSpire.BaseWidth / 2) - 1, CastleSpire.BaseHeight - 7, Color.Orange, 1); Utils.DefaultFont.Draw(sb, c.AMPM(), (CastleSpire.BaseWidth / 2) + 17, CastleSpire.BaseHeight - 7, Color.Orange, 1); }
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 void Draw(AD2SpriteBatch sb) { Renderer.GraphicsDevice.Clear(Color.White); //figure out camera stuff int cameraX = 0; int cameraY = 0; foreach (PC p in allPlayers()) { cameraX += p.X - (CastleSpire.BaseWidth / 2); cameraY += p.Y - (CastleSpire.BaseHeight / 2); } cameraX /= allPlayers().Count; cameraY /= allPlayers().Count; //no soul lighitng // l.center_x = p.x + player.size/2; //l.center_y = player.y + player.size/2; DrawWorldNoLighting(sb, cameraX, cameraY); Lightmap.RenderLightMap(sb, AmbientLight.AmbientColor(Clock), cameraX, cameraY, CastleSpire.BaseWidth, CastleSpire.BaseHeight); /*** LIGHTING STUFF * /** * //Before dawn, draw a lightsource at the player spot. That way he/she can see a little bit. * if (clock.hours() < AmbientLight.hourDawn || clock.hours() >= AmbientLight.hourDusk) * { * soul = new Light(soulcol, player.x + (player.size / 2), player.y + (player.size / 2), 7, 40); * lights.AddFirst(soul); * } * if (clock.hours() == AmbientLight.hourDawn && (clock.minutes() < 20)) * { * soul = new Light(Utils.mix(20 * 60,(60 * clock.minutes()) + clock.seconds(),soulcol, AmbientLight.ambientColor(clock)), player.x + (player.size / 2), player.y + (player.size / 2), 7,40); * lights.AddFirst(soul); * } * if (clock.hours() == AmbientLight.hourSunset && (clock.minutes() > 40)) * { * soul = new Light(Utils.mix(20 * 60, (60 * (clock.minutes() - 40 ) ) + clock.seconds(), AmbientLight.ambientColor(clock), soulcol) , player.x + (player.size / 2), player.y + (player.size / 2), 7, 40); * lights.AddFirst(soul); * } * //Nancies(); */ for (int i = 0; i != 4; i++) { if (HUDs[i] != null) { HUDs[i].Draw(sb); } } ClockHUD.Draw(sb, Clock); }
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) { Renderer.GraphicsDevice.Clear(Color.White); //figure out camera stuff int cameraX = 0; int cameraY = 0; foreach(PC p in allPlayers()) { cameraX += p.X - (CastleSpire.BaseWidth / 2); cameraY += p.Y - (CastleSpire.BaseHeight / 2); } cameraX /= allPlayers().Count; cameraY /= allPlayers().Count; //no soul lighitng // l.center_x = p.x + player.size/2; //l.center_y = player.y + player.size/2; DrawWorldNoLighting(sb, cameraX,cameraY); Lightmap.RenderLightMap(sb, AmbientLight.AmbientColor(Clock), cameraX, cameraY, CastleSpire.BaseWidth, CastleSpire.BaseHeight); /*** LIGHTING STUFF /** //Before dawn, draw a lightsource at the player spot. That way he/she can see a little bit. if (clock.hours() < AmbientLight.hourDawn || clock.hours() >= AmbientLight.hourDusk) { soul = new Light(soulcol, player.x + (player.size / 2), player.y + (player.size / 2), 7, 40); lights.AddFirst(soul); } if (clock.hours() == AmbientLight.hourDawn && (clock.minutes() < 20)) { soul = new Light(Utils.mix(20 * 60,(60 * clock.minutes()) + clock.seconds(),soulcol, AmbientLight.ambientColor(clock)), player.x + (player.size / 2), player.y + (player.size / 2), 7,40); lights.AddFirst(soul); } if (clock.hours() == AmbientLight.hourSunset && (clock.minutes() > 40)) { soul = new Light(Utils.mix(20 * 60, (60 * (clock.minutes() - 40 ) ) + clock.seconds(), AmbientLight.ambientColor(clock), soulcol) , player.x + (player.size / 2), player.y + (player.size / 2), 7, 40); lights.AddFirst(soul); } //Nancies(); */ for (int i = 0; i != 4; i++) { if(HUDs[i] != null) HUDs[i].Draw(sb); } ClockHUD.Draw(sb, Clock); }
protected override void AD2Draw(AD2SpriteBatch primarySpriteBatch) { switch (GameState) { //Draw appropriate graphics. case State.Title: T.Draw(primarySpriteBatch); break; case State.InGame: Game.Draw(primarySpriteBatch); break; } }
public static void DrawGlowingItems(AD2SpriteBatch sb, LinkedList <PC> activeCharacters, LinkedList <Item> items, int camX, int camY) { foreach (PC c in activeCharacters) { foreach (Item item in items) { if (item.collide(c)) { item.DrawOutline(sb, camX, camY); break; } } } }
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); }
public static void DrawGlowingItems(AD2SpriteBatch sb, LinkedList<PC> activeCharacters, LinkedList<Item> items, int camX, int camY) { foreach (PC c in activeCharacters) { foreach (Item item in items) { if (item.collide(c)) { item.DrawOutline(sb, camX, camY); break; } } } }
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 static void Draw(AD2SpriteBatch sb) { switch (GState) { case State.Title: Title.Draw(sb); break; case State.CharSelect: CharSelect.Draw(sb); break; case State.InGame: InGame.Draw(sb); break; } //Utils.DefaultFont.Draw(sb, LastDelta.IsRunningSlowly ? "SLOW!" : "", 100, 1, Color.BlanchedAlmond, 1, true); }
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 Draw(AD2SpriteBatch sb) { //Draw the background. Background.Draw(sb); //Draw the GUI. GUI.Draw(sb); //Draw the player's paddle. Player.Draw(sb); //Draw the bricks. foreach(Brick br in Bricks) br.Draw(sb); //Draw all the balls. foreach (Ball b in Balls) b.Draw(sb); //gg if (Ball.Dead) Utils.DefaultFont.Draw(sb, "GAME OVER", 25, 30, Color.Red, 4, true); }
//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); }
protected override void AD2Draw(AD2SpriteBatch sb) { GS.Draw(sb); }
public void DrawAlways(AD2SpriteBatch sb, int x, int y) { if (AlwaysMap == null) return; sb.Draw(AlwaysMap, new Rectangle(0, 0, ScreenWidth, ScreenHeight), new Rectangle(x, y, ScreenWidth, ScreenHeight), Color.White); }
public void DrawBase(AD2SpriteBatch sb, int x, int y) { sb.Draw(BaseMap, new Rectangle(0, 0, ScreenWidth, ScreenHeight), new Rectangle(x, y, ScreenWidth, ScreenHeight), Color.White); }
//Consider a camera public void Draw(AD2SpriteBatch sb, int cameraX, int cameraY) { Anim.Draw(sb, X + -cameraX, Y + -cameraY); }
public void Draw(AD2SpriteBatch sb) { DrawBars(sb); }
public void draw(AD2SpriteBatch sb, int camX) { Animation.Draw(sb, X - camX, Y); }
public void draw(AD2SpriteBatch sb,int camX) { Animation.Draw(sb,X - camX, Y); }
public static void DrawRect(AD2SpriteBatch sb, int x, int y, int w, int h, Color c) { sb.DrawTexture(WhiteRect, x, y, w, h, c); }
//Consider a camera public void Draw(AD2SpriteBatch sb, int cameraX, int cameraY ) { Anim.Draw(sb, X + - cameraX, Y + - cameraY); }
protected abstract void AD2Draw(AD2SpriteBatch primarySpriteBatch);
public override void Draw(PixelFont f, AD2SpriteBatch sb) { f.Draw(sb, Symbol.ToString(), BasementExplorer.MapXOffset + X, BasementExplorer.MapYOffset + Y, (HP > 0) ? MainColor : DarkColor); }
public void Draw(AD2SpriteBatch sb) { sb.Draw(Splash, new Rectangle(0, 0, 360, 270), Color.White); //TODO: f.draw center. Utils.DefaultFont.Draw(sb, "PRESS ENTER", 100, 200, Color.White, 3, true); }
public void Draw(PixelFont f, AD2SpriteBatch sb) { Utils.DrawRect(sb, 0, 0, 200, 20, Player.DarkColor); Utils.DrawRect(sb, 0, 0, 70, 150, Player.DarkColor); //print message in message zone. f.Draw(sb, Messages.CurrentMessage.RevealedText(), 2, 11, Color.White); f.Draw(sb, Messages.LastMessage.RevealedText(), 2, 1, Color.White); //Print HP Bar. Utils.DrawRect(sb, 1, 23, 67, 13, Color.White); if (Player.HP > 0) { Utils.DrawRect(sb, 2, 24, (int)(65 * ((double)Player.HP / Player.MaxHP())), 11, Color.Red); } string HPmsg = Player.HP +""; //center it up. //ignore space of last letter. f.Draw(sb, HPmsg, 35 - ((f.GetWidth(HPmsg, true) - 2) / 2), 26,Color.White,1,true); PrimaryWeapon primaryDisplay = PrimaryWeaponDisplay == null ? Player.PrimaryWeapon : PrimaryWeaponDisplay; if (PrimaryWeaponDisplay != null) { Utils.DrawRect(sb, 0, 37, 70, 59, Player.MainColor); } if (primaryDisplay != null) { f.Draw(sb, primaryDisplay.Name, 2, 38, Color.White, 1); f.Draw(sb, "Pow: " + primaryDisplay.Power(Player), 2, 48, Color.White); f.Draw(sb, "Acc: " + primaryDisplay.Accuracy(Player), 2, 58, Color.White); //Special ability here if applicable. //TODO: CRIT, +HP, -HP, STUN, f.Draw(sb, primaryDisplay.SpecialMessage(), 2, 68, Color.White); f.Draw(sb, primaryDisplay.WarningMessage(Player), 2, 78, Color.Gray); } else { f.Draw(sb, "Punch", 2, 38, Color.White, 1); f.Draw(sb, "Pow: " + Player.PunchPower(), 2, 48, Color.White); f.Draw(sb, "Acc: " + (Player).PunchAccuracy(), 2, 58, Color.White); } f.Draw(sb, "9 Darts", 2, 98, Color.White); f.Draw(sb, "Pow: 99", 2, 108, Color.White); f.Draw(sb, "Range 99", 2, 118, Color.White); Utils.DrawRect(sb, 24, 129, 12, 12, Color.Yellow); for (int i = 3; i < 62; i = i + 11) { Utils.DrawRect(sb, i, 130, 10, 10, Color.Gray); } f.Draw(sb, ".", 1+4, 131, Color.White); f.Draw(sb, "=", 1+15, 131, Color.Red); f.Draw(sb, ",", 1+26, 131, Color.Green); f.Draw(sb, "Y", 1+37, 131, Color.Brown); }
public abstract void Draw(PixelFont f, AD2SpriteBatch sb);
public void Draw(AD2SpriteBatch sb) { sb.DrawTexture(PaddleTexture, (int)PositionX, PositionY); }
public override void Draw(PixelFont f, AD2SpriteBatch sb) { if (OnFloor) f.Draw(sb, Symbol.ToString(), BasementExplorer.MapXOffset + X, BasementExplorer.MapYOffset + Y, this.Color); }