public override void Draw(SpriteBatch batch) { for (int i = 0; i < drawAbleItems.Count; i++) { drawAbleItems[i].Draw(batch); } float yMargin = 0; if (player.Won) { Game1.Instance.fontRenderer.DrawText(batch, new Vector2(10, 10 + yMargin), "You win! It took you " + player.Tries + " Tries", Color.Black); backButton.Draw(batch); } if (testing) { Game1.Instance.fontRenderer.DrawText(batch, new Vector2(5, Game1.Instance.ScreenRect.Height - 40), "Testing... Press backspace to go back to editor", Color.Black); } if (paused) { RectangleRender.DrawFilled(batch, Game1.Instance.ScreenRect, Color.FromNonPremultiplied(0, 0, 0, 175)); pauseBack.Draw(batch); } pause.Draw(batch); base.Draw(batch); }
public void Draw(SpriteBatch batch) { if (Game1.Instance.CreatorMode) { RectangleRender.Draw(batch, Bounds); } }
public override void Draw(SpriteBatch batch) { foreach (MovementTile t in movement) { t.Draw(batch); } if (ActiveLayer) { Rectangle wSize = Game1.Instance.fontRenderer.StringSize(GetMovementChar()); if (dragging) { Game1.Instance.fontRenderer.DrawText(batch, new Vector2((tileSize.X + tileSize.Width / 2) - wSize.Width / 2, (tileSize.Y + tileSize.Height / 2) - wSize.Height), GetMovementChar()); RectangleRender.Draw(batch, tileSize); } else { Game1.Instance.fontRenderer.DrawText(batch, new Vector2(tileSize.X - wSize.Width / 2, tileSize.Y - wSize.Height), GetMovementChar()); } } base.Draw(batch); }
/// <summary> /// Draw the image of the object /// </summary> /// <param name="batch">The active spritebatch</param> public virtual void Draw(SpriteBatch batch) { if (image != null) { if (useCustomBounds) { // Draw the whole image with custom bounds batch.Draw(image, new Rectangle((int)position.X, (int)position.Y, image.Width, image.Height), Color.White); } else { // no custom bounds mean hitbox contains the position and the image size batch.Draw(image, hitbox, Color.White); } } else if (Animation != null) { Animation.Draw(batch, position); } if (Game1.Instance.CreatorMode) { RectangleRender.Draw(batch, hitbox); } }
public void Draw(SpriteBatch batch) { if (inLevelCreator) { RectangleRender.Draw(batch, Bounds); Game1.Instance.fontRenderer.DrawText(batch, new Vector2((Bounds.X + Bounds.Width / 2) - wSize.Width / 2, (Bounds.Y + Bounds.Height / 2) - wSize.Height), GetMovementChar()); } }
public void Draw(SpriteBatch batch) { animations[currentMovement].Draw(batch, position); if (Game1.Instance.CreatorMode) { RectangleRender.Draw(batch, Boundingbox); } }
public void Draw(SpriteBatch batch) { batch.Draw(overlay, Game1.Instance.ScreenRect, Color.White); if (dragging) { RectangleRender.Draw(batch, boundingboxDraw); } if (player != null) { player.Draw(batch); } }
public void Draw(SpriteBatch batch) { if (level.Unlocked) { batch.Draw(previewImg, new Rectangle((int)position.X, (int)position.Y + 30, 256, 256), previewImg.Bounds, Color.White); Game1.Instance.fontRenderer.DrawText(batch, position + new Vector2(Game1.Instance.fontRenderer.StringSize(level.Name).Width, 0), level.Name); if (level.Beaten) { Game1.Instance.fontRenderer.DrawText(batch, position + new Vector2(5, 240), "Best " + level.Tries); } } else { batch.Draw(previewImg, new Rectangle((int)position.X, (int)position.Y + 30, 256, 256), previewImg.Bounds, Color.White); RectangleRender.DrawFilled(batch, new Rectangle((int)position.X, (int)position.Y + 30, 256, 256), Color.Black); Game1.Instance.fontRenderer.DrawText(batch, position + new Vector2(Game1.Instance.fontRenderer.StringSize(level.Name).Width, 0), level.Name); } }
public void DrawCenter(Texture2D t, SpriteBatch batch) { batch.Draw(t, leftTopImg, Color.White); RectangleRender.Draw(batch, boundingboxDraw, Color.White); }