public void draw(SBWrapper wrapper) { wrapper.draw(bg); ui.draw(wrapper); if (editing) { editor.draw(wrapper); } }
public void draw(SBWrapper wrapper, List <Entity> entities) { SBWrapper cameraSpace = new SBWrapper(wrapper, -location); map.draw(cameraSpace); for (int i = 0; i < entities.Count; i++) { entities[i].draw(wrapper, this); } }
public void draw(SBWrapper wrapper) { wrapper.drawRectangle(new Vector2(Game1.INTERNAL_WIDTH, Game1.INTERNAL_HEIGHT), map.color); if (editing) { editor.draw(wrapper); } else { camera.draw(wrapper, entities); ui.draw(wrapper); } }
public void draw(SBWrapper wrapper) { /* * int startX = Math.Max(0, (int) Math.Floor(-wrapper.location.X / Tile.TILE_SIZE)); * int startY = Math.Max(0, (int)Math.Floor(-wrapper.location.Y / Tile.TILE_SIZE)); * for (int x = startX; x < Math.Min(width, Game1.TILE_WIDTH); x++) * { * for (int y = startY; y < Math.Min(height, Game1.TILE_HEIGHT); y++) * { * map[x, y].draw(wrapper, new Vector2(x, y) * Tile.TILE_SIZE); * } * } */ // TODO determine why above algorithm stopped working... drawing all tiles should work for now for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { map[x, y].draw(wrapper, new Vector2(x, y) * Tile.TILE_SIZE); } } }
/// <summary> /// Draw this entity at a screen location, without camera perspective /// </summary> /// <param name="wrapper"></param> /// <param name="location"></param> public void draw(SBWrapper wrapper, Vector2 location) { wrapper.draw(texture, location, animation.getFrame()); }
/// <summary> /// Draw this entity in world-space using a <see cref="TilemapCamera"/> /// </summary> /// <param name="wrapper"></param> /// <param name="camera"></param> public void draw(SBWrapper wrapper, TilemapCamera camera) { draw(wrapper, camera.worldToScreen(location)); }
public void draw(SBWrapper wrapper, Vector2 location) { wrapper.draw(texture, location); }
/// <summary> /// Create a new SBWrapper that draws at an offset relative to another SBWrapper /// </summary> /// <param name="other">The other SBWrapper</param> /// <param name="location">Offset from the origin of <paramref name="other"/> to use as the new origin</param> public SBWrapper(SBWrapper other, Vector2 location) { spriteBatch = other.spriteBatch; this.location = other.location + location; }
/// <summary> /// Create a new SBWrapper that is a copy of another /// </summary> /// <param name="other">SBWrapper to copy</param> public SBWrapper(SBWrapper other) { spriteBatch = other.spriteBatch; this.location = other.location; }