public void Draw(SpriteBatch sb, Game1 game) { if (layer != null) { for (int i = 0; i < layer.parts.Count; i++) { if (selectedPart == i) { MapPart fp = layer.parts[selectedPart]; sb.DrawOutline(pixel, Util.RotateRectangle(fp.origin, fp.position, fp.scale, fp.rotation), Color.White * 0.5f); } } if (selectedPart == -1) { for (int i = layer.parts.Count - 1; i >= 0; i--) { MapPart fp = layer.parts[i]; if (Util.RotateRectangle(fp.origin, fp.position, fp.scale, fp.rotation).Contains(game.MPos.X, game.MPos.Y)) { sb.Draw(pixel, Util.RotateRectangle(fp.origin, fp.position, fp.scale, fp.rotation), Color.Red * 0.1f); sb.DrawOutline(pixel, Util.RotateRectangle(fp.origin, fp.position, fp.scale, fp.rotation), Color.Red * 0.8f); break; } } } } }
public void Draw(SpriteBatch sb) { if (k.IsKeyDown(Keys.LeftShift)) { sb.Draw(pixel, rect, Color.Black * 0.2f); sb.DrawOutline(pixel, rect, Color.Black); sb.Draw(texture, rect, Color.White * 0.8f); if (rect.Contains(m.X, m.Y)) { if (m.LeftButton == ButtonState.Pressed || om.LeftButton == ButtonState.Pressed) { sb.DrawOutline(pixel, new Rectangle(rect.X + source.X, rect.Y + source.Y, source.Width, source.Height), Color.Red); } } } }
public void Draw(SpriteBatch sb) { sb.Draw(pixel, rect, bgColor); sb.DrawOutline(pixel, rect, Color.Black); if (anim != null) { anim.Draw(sb, new Vector2(rect.Center.X, rect.Center.Y), false); } }
public void Draw(SpriteBatch sb) { sb.Draw(pixel, rect, bgColor); sb.DrawOutline(pixel, rect, Color.Black); if (rect.Contains(m.X, m.Y)) { sb.Draw(pixel, rect, Color.White * 0.5f); } sb.DrawString(font, text, new Vector2(rect.X + padding, rect.Y + padding), Color.White); }
public void Draw(SpriteBatch sb) { sb.Draw(pixel, rect, bgColor); sb.DrawOutline(pixel, rect, Color.Black); if (frame != null) { sb.DrawOutline(pixel, new Rectangle(rect.Left, rect.Center.Y, rect.Width, 1), Color.Black * 0.5f); sb.DrawOutline(pixel, new Rectangle(rect.Center.X, rect.Top, 1, rect.Height), Color.Black * 0.5f); Vector2 pos = new Vector2(rect.Center.X, rect.Center.Y); frame.Draw(sb, pos, false); for (int i = 0; i < frame.parts.Count; i++) { if (selectedPart == i) { FramePart fp = frame.parts[selectedPart]; sb.DrawOutline(pixel, Util.RotateRectangle(fp.origin, pos + fp.position, fp.scale, fp.rotation), Color.White * 0.5f); } } } }
public void Draw(SpriteBatch sb, Game1 game) { for (int i = 0; i < ledges.Count; i++) { ledges[i].Draw(sb, pixel, selectedLedge == i); } for (int i = 0; i < grid.GetLength(0); i++) { for (int j = 0; j < grid.GetLength(1); j++) { if (grid[i, j] != 0) { sb.Draw(pixel, new Rectangle(i * Map.CELL_SIZE, j * Map.CELL_SIZE, Map.CELL_SIZE, Map.CELL_SIZE), Color.Red * 0.2f); } else { sb.DrawOutline(pixel, new Rectangle(i * Map.CELL_SIZE, j * Map.CELL_SIZE, Map.CELL_SIZE, Map.CELL_SIZE), Color.Red * 0.2f); } } } }
public void Draw(SpriteBatch sb) { sb.Draw(pixel, rect, bgColor); sb.DrawOutline(pixel, rect, Color.Black); sb.DrawString(font, nameable.Name + (showCursor ? "" : "|"), new Vector2(rect.X + padding, rect.Y + padding), Color.White); }