//----------------------------------------------------------------------------- // Slots //----------------------------------------------------------------------------- public virtual void DrawSlotCursor(Graphics2D g, Slot slot) { Sprite tR = new Sprite(GameData.SHEET_MENU_SMALL_LIGHT, new Point2I(9, 0)); Sprite bR = new Sprite(GameData.SHEET_MENU_SMALL_LIGHT, new Point2I(9, 1)); Sprite tL = new Sprite(GameData.SHEET_MENU_SMALL_LIGHT, new Point2I(10, 0)); Sprite bL = new Sprite(GameData.SHEET_MENU_SMALL_LIGHT, new Point2I(10, 1)); g.DrawSprite(tR, slot.Position + new Point2I(-8, 0)); g.DrawSprite(bR, slot.Position + new Point2I(-8, 8)); g.DrawSprite(tL, slot.Position + new Point2I(slot.Width, 0)); g.DrawSprite(bL, slot.Position + new Point2I(slot.Width, 8)); }
//----------------------------------------------------------------------------- // Map Drawing //----------------------------------------------------------------------------- private void DrawRoom(Graphics2D g, DungeonMapRoom room, Point2I position) { if (room == null) { return; } // Determine the sprite to draw for the room. Sprite sprite = null; if (room.IsDiscovered) { sprite = room.Sprite; } else if (dungeon.HasMap) { sprite = GameData.SPR_UI_MAP_UNDISCOVERED_ROOM; } // Determine extra sprite to draw for the room (treasure, boss, or player). Sprite extraSprite = null; if (playerRoomLocation == room.Location && playerFloorNumber == room.Floor.FloorNumber && (cursorTimer >= 32 || isChangingFloors || room.Floor != viewFloor)) { extraSprite = GameData.SPR_UI_MAP_PLAYER; } else if (dungeon.HasCompass) { if (room.IsBossRoom) { extraSprite = GameData.SPR_UI_MAP_BOSS_ROOM; } else if (room.HasTreasure) { extraSprite = GameData.SPR_UI_MAP_TREASURE_ROOM; } } // Draw the two sprites. if (sprite != null) { g.DrawSprite(sprite, GameData.VARIANT_LIGHT, position); } if (extraSprite != null) { g.DrawSprite(extraSprite, GameData.VARIANT_LIGHT, position); } }
// Draws the player's life. private void DrawHearts(Graphics2D g, int lightDark) { for (int i = 0; i < gameControl.Player.MaxHealth / 4; i++) { int fullness = GMath.Clamp(dynamicHealth - i * 4, 0, 4); if (!gameControl.IsAdvancedGame) { g.DrawSprite(GameData.SPR_HUD_HEARTS[fullness], lightDark, new Point2I(104 + (i % 7) * 8, (i / 7) * 8)); } else { g.DrawSprite(GameData.SPR_HUD_HEARTS[fullness], lightDark, new Point2I(96 + (i % 8) * 8, (i / 8) * 8)); } } }
//----------------------------------------------------------------------------- // Drawing //----------------------------------------------------------------------------- public void DrawSlot(Graphics2D g, Point2I position, int lightOrDark) { if (sprite != null) { g.DrawSprite(sprite, position); } }
protected virtual void DrawLevel(Graphics2D g, Point2I position, int lightOrDark) { Color color = (lightOrDark == GameData.VARIANT_LIGHT ? new Color(16, 16, 16) : Color.Black); g.DrawSprite(GameData.SPR_HUD_LEVEL, lightOrDark, position + new Point2I(8, 8)); g.DrawString(GameData.FONT_SMALL, (level + 1).ToString(), position + new Point2I(16, 8), color); }
public override void Draw(Graphics2D g) { Point2I pos = new Point2I(8, 24); if (GameControl.Player.Y < ((GameSettings.VIEW_HEIGHT) / 2 + 8)) { pos.Y = 96; } // TODO: Apply Player position based on view g.FillRectangle(new Rectangle2I(pos, new Point2I(144, 8 + 16 * linesPerWindow)), Color.Black); // Draw the finished writting lines. for (int i = 0; i < windowLine; i++) { if (state == TextReaderState.PushingLine && timer >= 2) { g.DrawLetterString(GameData.FONT_LARGE, wrappedString.Lines[currentLine - windowLine + i], pos + new Point2I(8, 6 + 16 * i + 8), TextColor); } else { g.DrawLetterString(GameData.FONT_LARGE, wrappedString.Lines[currentLine - windowLine + i], pos + new Point2I(8, 6 + 16 * i), TextColor); } } // Draw the currently writting line. g.DrawLetterString(GameData.FONT_LARGE, wrappedString.Lines[currentLine].Substring(0, currentChar), pos + new Point2I(8, 6 + 16 * windowLine), TextColor); // Draw the next line arrow. if ((state == TextReaderState.PressToContinue || state == TextReaderState.PressToEndParagraph) && arrowTimer >= 16) { g.DrawSprite(GameData.SPR_HUD_TEXT_NEXT_ARROW, pos + new Point2I(136, 16 * linesPerWindow)); } }
//----------------------------------------------------------------------------- // Drawing //----------------------------------------------------------------------------- public void DrawHeartPieces(Graphics2D g) { for (int i = 0; i < 4; i++) { if (i < GameControl.Inventory.PiecesOfHeart) { g.DrawSprite(GameData.SPR_HUD_HEART_PIECES_FULL[i], new Point2I(112, 8)); } else { g.DrawSprite(GameData.SPR_HUD_HEART_PIECES_EMPTY[i], new Point2I(112, 8)); } } g.DrawString(GameData.FONT_SMALL, GameControl.Inventory.PiecesOfHeart.ToString() + "/4", new Point2I(120, 40), new Color(16, 16, 16)); }
// Draws the equipped usable items. private void DrawItems(Graphics2D g, int lightDark) { if (Inventory.IsTwoHandedEquipped) { // B bracket side g.DrawSprite(GameData.SPR_HUD_BRACKET_LEFT_B, lightDark, new Point2I(8, 0)); // A bracket side g.DrawSprite(GameData.SPR_HUD_BRACKET_RIGHT_A, lightDark, new Point2I(56, 0)); Inventory.EquippedWeapons[0].DrawSlot(g, new Point2I(16, 0), lightDark); } else if (!gameControl.IsAdvancedGame) { // B bracket g.DrawSprite(GameData.SPR_HUD_BRACKET_LEFT_B, lightDark, new Point2I(0, 0)); g.DrawSprite(GameData.SPR_HUD_BRACKET_RIGHT, lightDark, new Point2I(32, 0)); // A bracket g.DrawSprite(GameData.SPR_HUD_BRACKET_LEFT_A, lightDark, new Point2I(40, 0)); g.DrawSprite(GameData.SPR_HUD_BRACKET_RIGHT, lightDark, new Point2I(72, 0)); if (Inventory.EquippedWeapons[1] != null) { Inventory.EquippedWeapons[1].DrawSlot(g, new Point2I(8, 0), lightDark); } if (Inventory.EquippedWeapons[0] != null) { Inventory.EquippedWeapons[0].DrawSlot(g, new Point2I(48, 0), lightDark); } } else { // B bracket side g.DrawSprite(GameData.SPR_HUD_BRACKET_LEFT_B, lightDark, new Point2I(0, 0)); // Both bracket side g.DrawSprite(GameData.SPR_HUD_BRACKET_LEFT_RIGHT, lightDark, new Point2I(32, 0)); // A bracket side g.DrawSprite(GameData.SPR_HUD_BRACKET_RIGHT_A, lightDark, new Point2I(64, 0)); if (Inventory.EquippedWeapons[1] != null) { Inventory.EquippedWeapons[1].DrawSlot(g, new Point2I(8, 0), lightDark); } if (Inventory.EquippedWeapons[0] != null) { Inventory.EquippedWeapons[0].DrawSlot(g, new Point2I(40, 0), lightDark); } } }
// Draws the item inside the inventory. protected override void DrawSprite(Graphics2D g, Point2I position, int lightOrDark) { Sprite spr = sprite[level]; if (inventory.IsWeaponEquipped(this) && spriteEquipped != null) { spr = spriteEquipped[level]; } g.DrawSprite(spr, lightOrDark, position); }
// Draws the ruppes and dungeon keys. private void DrawRupees(Graphics2D g, int lightDark) { Color black = (lightDark == GameData.VARIANT_LIGHT ? new Color(16, 16, 16) : Color.Black); int advancedOffset = (gameControl.IsAdvancedGame ? 8 : 0); Dungeon dungeon = gameControl.RoomControl.Dungeon; if (dungeon != null) { // Display the small key count. g.DrawSprite(GameData.SPR_HUD_KEY, lightDark, new Point2I(80 - advancedOffset, 0)); g.DrawSprite(GameData.SPR_HUD_X, lightDark, new Point2I(88 - advancedOffset, 0)); g.DrawString(GameData.FONT_SMALL, dungeon.NumSmallKeys.ToString(), new Point2I(96 - advancedOffset, 0), black); } else { // Display rupee icon. g.DrawSprite(GameData.SPR_HUD_RUPEE, lightDark, new Point2I(80 - advancedOffset, 0)); } g.DrawString(GameData.FONT_SMALL, dynamicRupees.ToString("000"), new Point2I(80 - advancedOffset, 8), black); }
public override void DrawSlotCursor(Graphics2D g, Slot slot) { if (!inSubMenu) { base.DrawSlotCursor(g, slot); } else if (IsAmmoMenuFullyOpen) { Sprite arrowSprite = new Sprite(GameData.SHEET_MENU_SMALL_LIGHT, new Point2I(5, 5)); g.DrawSprite(arrowSprite, slot.Position + new Point2I(4, 20)); } }
//----------------------------------------------------------------------------- // Drawing //----------------------------------------------------------------------------- // Draws the HUD. public void Draw(Graphics2D g, bool light) { int lightDark = (light ? GameData.VARIANT_LIGHT : GameData.VARIANT_DARK); Rectangle2I r = new Rectangle2I(0, 0, GameSettings.SCREEN_WIDTH, 16); g.DrawSprite(GameData.SPR_HUD_BACKGROUND, lightDark, r); DrawItems(g, lightDark); DrawRupees(g, lightDark); DrawHearts(g, lightDark); }
private void DrawFloor(Graphics2D g, DungeonMapFloor floor, Point2I position) { // Draw the floor background rectangle. g.DrawSprite(GameData.SPR_UI_MAP_FLOOR_BACKGROUND, GameData.VARIANT_LIGHT, new Rectangle2I(position, new Point2I(64, 64))); // Draw the rooms. for (int x = 0; x < floor.Width; x++) { for (int y = 0; y < floor.Height; y++) { Point2I drawPos = position + (new Point2I(x, y) * 8); DrawRoom(g, floor.Rooms[x, y], drawPos); } } }
// Draw all the queued drawing instructions to a graphics object. public void DrawAll(Graphics2D g) { // Draw all instructions from the lowest layer to the highest layer. for (int i = 0; i < layerHeads.Length; i++) { DrawingInstruction instruction = layerHeads[i]; while (instruction != null) { g.DrawSprite(instruction.sprite, instruction.imageVariant, instruction.position.X, instruction.position.Y); instruction = instruction.next; } } }
public override void Draw(Graphics2D g) { base.Draw(g); if (inSubMenu) { Point2I maxSize = new Point2I(ammoSlotGroup.NumSlots * 24 + 8, 32); Point2I menuPos = new Point2I((160 - (ammoSlotGroup.NumSlots * 24 + 8)) / 2 + (maxSize.X - ammoMenuSize.X) / 2, DrawAmmoMenuAtTop ? 16 : 56); Sprite ammoMenuSprite = new Sprite(GameData.SHEET_MENU_SMALL_LIGHT, new Point2I(1, 4)); g.DrawSprite(ammoMenuSprite, new Rectangle2I(menuPos, ammoMenuSize)); if (IsAmmoMenuFullyOpen) { ammoSlotGroup.Draw(g); } if (currentSlotGroup != null) { DrawSlotCursor(g, currentSlotGroup.CurrentSlot); } } }
public void DrawRoom(Graphics2D g, Vector2F position) { g.Translate(position); // Draw background (in the color of the HUD. Rectangle2I viewRect = new Rectangle2I(0, 0, GameSettings.VIEW_WIDTH, GameSettings.VIEW_HEIGHT); g.DrawSprite(GameData.SPR_HUD_BACKGROUND, GameData.VARIANT_DARK, viewRect); Vector2F viewTranslation = -GMath.Round(viewControl.ViewPosition); g.Translate(viewTranslation); // Draw tiles. roomGraphics.Clear(); tileManager.DrawTiles(roomGraphics); roomGraphics.DrawAll(g); // DEBUG: Draw debug information over tiles. GameDebug.DrawRoomTiles(g, this); // Draw entities in reverse order (because newer entities are drawn below older ones). roomGraphics.Clear(); for (int i = entities.Count - 1; i >= 0; i--) { entities[i].Draw(roomGraphics); } roomGraphics.SortDepthLayer(DepthLayer.PlayerAndNPCs); // Sort dynamic depth layers. roomGraphics.DrawAll(g); // Draw event tiles in reverse order. for (int i = eventTiles.Count - 1; i >= 0; i--) { eventTiles[i].Draw(g); } // DEBUG: Draw debug information. GameDebug.DrawRoom(g, this); g.Translate(-(position + viewTranslation)); }
public override void Draw(Graphics2D g) { if (dungeon == null) { return; } // Draw the background. g.DrawImage(backgroundImage, Point2I.Zero); // TODO: Draw the dungeon name panel. // Draw the floors. Point2I floorBasePos = new Point2I(); if (floors.Count < 6) { floorBasePos.Y = 72 + (8 * (floors.Count / 2)); } else { floorBasePos.Y = 88 + (4 * (floors.Count - 6)); } for (int i = 0; i < floors.Count; i++) { DungeonMapFloor floor = floors[i]; if (discoveredFloors.Contains(floor)) { // Draw the floor's label box on the left side of the screen. Point2I floorPos = floorBasePos - new Point2I(0, i * 8); string floorName = floor.FloorNumberText; g.DrawString(GameData.FONT_SMALL, floorName, floorPos, new Color(248, 248, 216)); // drop shadow g.DrawString(GameData.FONT_SMALL, floorName, floorPos + new Point2I(0, -1), new Color(56, 32, 16)); g.DrawSprite(GameData.SPR_UI_MAP_FLOOR_BOX_LEFT, GameData.VARIANT_LIGHT, floorPos + new Point2I(32, 0)); g.DrawSprite(GameData.SPR_UI_MAP_FLOOR_BOX_RIGHT, GameData.VARIANT_LIGHT, floorPos + new Point2I(40, 0)); // Draw the icons around the name box. if (viewFloor == floor) { g.DrawSprite(GameData.SPR_UI_MAP_FLOOR_INDICATOR, GameData.VARIANT_LIGHT, floorPos + new Point2I(24, 0)); } if (playerFloorNumber == floor.FloorNumber) { g.DrawSprite(GameData.SPR_UI_MAP_PLAYER, GameData.VARIANT_LIGHT, floorPos + new Point2I(36, 0)); } if (floor.IsBossFloor && dungeon.HasCompass) { g.DrawSprite(GameData.SPR_UI_MAP_BOSS_FLOOR, GameData.VARIANT_LIGHT, floorPos + new Point2I(48, 0)); } // Draw the floor's room display on the right side of the screen. int discoveredFloorIndex = discoveredFloors.IndexOf(floor); Point2I floorRoomDisplayPos = new Point2I(80, 40 - (80 * discoveredFloorIndex) + floorViewPosition); if (floorRoomDisplayPos.Y < GameSettings.SCREEN_HEIGHT && floorRoomDisplayPos.Y > -80) { DrawFloor(g, floor, floorRoomDisplayPos); } // Draw room display cursor. if (!isChangingFloors && viewFloor == floor && cursorTimer < 32) { Point2I drawPos = floorRoomDisplayPos + (playerRoomLocation * 8); g.DrawSprite(GameData.SPR_UI_MAP_CURSOR, GameData.VARIANT_LIGHT, drawPos); } } } // Draw floor view traversal arrows. if (!isChangingFloors) { if (viewFloorIndex > 0) { g.DrawSprite(GameData.SPR_UI_MAP_ARROW_DOWN, GameData.VARIANT_LIGHT, 108, 108); } if (viewFloorIndex < discoveredFloors.Count - 1) { g.DrawSprite(GameData.SPR_UI_MAP_ARROW_UP, GameData.VARIANT_LIGHT, 108, 28); } } // Draw the items panel. if (dungeon.HasMap) { g.DrawSprite(GameData.SPR_REWARD_MAP, GameData.VARIANT_LIGHT, 8, 110); } if (dungeon.HasCompass) { g.DrawSprite(GameData.SPR_REWARD_COMPASS, GameData.VARIANT_LIGHT, 32, 110); } if (dungeon.HasBossKey) { g.DrawSprite(GameData.SPR_REWARD_BOSS_KEY, GameData.VARIANT_LIGHT, 8, 128); } if (dungeon.NumSmallKeys > 0) { g.DrawSprite(GameData.SPR_REWARD_SMALL_KEY, GameData.VARIANT_LIGHT, 32, 128); g.DrawString(GameData.FONT_SMALL, "X" + dungeon.NumSmallKeys.ToString(), new Point2I(40, 136), new Color(144, 136, 16)); // drop shadow g.DrawString(GameData.FONT_SMALL, "X" + dungeon.NumSmallKeys.ToString(), new Point2I(40, 136 - 1), new Color(32, 24, 16)); } }
// Draw an entire level. public void DrawLevel(Graphics2D g) { g.Clear(new Color(175, 175, 180)); // Gray background. // Draw the level if it is open. if (editorControl.IsLevelOpen) { // Draw the rooms. for (int x = 0; x < Level.Width; x++) { for (int y = 0; y < Level.Height; y++) { g.Translate(new Vector2F(-HorizontalScroll.Value, -VerticalScroll.Value)); g.Translate((Vector2F)(new Point2I(x, y) * ((Level.RoomSize * GameSettings.TILE_SIZE) + editorControl.RoomSpacing))); DrawRoom(g, Level.GetRoomAt(x, y)); g.ResetTranslation(); } } // Draw the highlight box. if (editorControl.HighlightMouseTile && cursorTileLocation >= Point2I.Zero) { g.Translate(new Vector2F(-HorizontalScroll.Value, -VerticalScroll.Value)); Rectangle2I box = new Rectangle2I(GetLevelTileCoordDrawPosition(cursorTileLocation), new Point2I(16, 16)); g.DrawRectangle(box.Inflated(1, 1), 1, Color.White); g.ResetTranslation(); } // Draw selection grid. if (selectionGridLevel == Level && !selectionGridArea.IsEmpty) { g.Translate(new Vector2F(-HorizontalScroll.Value, -VerticalScroll.Value)); if (selectionGrid != null) { for (int i = 0; i < selectionGrid.LayerCount; i++) { for (int y = 0; y < selectionGrid.Height; y++) { for (int x = 0; x < selectionGrid.Width; x++) { Point2I position = GetLevelTileCoordDrawPosition(selectionGridArea.Point + new Point2I(x, y)); TileDataInstance tile = selectionGrid.GetTileIfAtLocation(x, y, i); // Draw tile. if (tile != null) { DrawTile(g, tile, position, Color.White); } } } } // Draw event tiles. if (editorControl.ShowEvents || editorControl.ShouldDrawEvents) { for (int i = 0; i < selectionGrid.EventTiles.Count; i++) { Point2I position = GetLevelTileCoordDrawPosition(selectionGridArea.Point) + selectionGrid.EventTiles[i].Position; DrawEventTile(g, selectionGrid.EventTiles[i], position, Color.White); } } } // Draw the selection box. if (!selectionBox.IsEmpty) { Point2I start = GetLevelPixelDrawPosition(selectionBox.TopLeft); Point2I end = GetLevelPixelDrawPosition(selectionBox.BottomRight); Rectangle2I box = new Rectangle2I(start, end - start); g.DrawRectangle(box, 1, Color.White); g.DrawRectangle(box.Inflated(1, 1), 1, Color.Black); g.DrawRectangle(box.Inflated(-1, -1), 1, Color.Black); } g.ResetTranslation(); } // Draw selected tiles. foreach (BaseTileDataInstance tile in selectedTiles) { g.Translate(new Vector2F(-HorizontalScroll.Value, -VerticalScroll.Value)); Rectangle2I bounds = tile.GetBounds(); bounds.Point += GetRoomDrawPosition(tile.Room); g.DrawRectangle(bounds, 1, Color.White); g.DrawRectangle(bounds.Inflated(1, 1), 1, Color.Black); g.DrawRectangle(bounds.Inflated(-1, -1), 1, Color.Black); g.ResetTranslation(); } // Draw player sprite for 'Test At Position' Point2I roomSize = (Level.RoomSize * GameSettings.TILE_SIZE) + editorControl.RoomSpacing; Point2I tilePoint = highlightedRoom * roomSize + highlightedTile * GameSettings.TILE_SIZE; if (editorControl.PlayerPlaceMode && highlightedTile >= Point2I.Zero) { g.DrawSprite(GameData.SPR_PLAYER_FORWARD, (Vector2F)tilePoint + new Vector2F(-HorizontalScroll.Value, -VerticalScroll.Value)); } } }
//----------------------------------------------------------------------------- // Drawing //----------------------------------------------------------------------------- // Draw a tile. private void DrawTile(Graphics2D g, TileDataInstance tile, Point2I position, Color drawColor) { Sprite sprite = null; Animation animation = null; float playbackTime = editorControl.Ticks; int substripIndex = tile.Properties.GetInteger("substrip_index", 0); //----------------------------------------------------------------------------- // Platform. if (tile.Type == typeof(TilePlatform)) { if (!tile.CurrentSprite.IsNull) { // Draw the tile once per point within its size. for (int y = 0; y < tile.Size.Y; y++) { for (int x = 0; x < tile.Size.X; x++) { Point2I drawPos = position + (new Point2I(x, y) * GameSettings.TILE_SIZE); g.DrawAnimation(tile.CurrentSprite, tile.Room.Zone.ImageVariantID, editorControl.Ticks, position, drawColor); } } } return; } //----------------------------------------------------------------------------- // Color Jump Pad. else if (tile.Type == typeof(TileColorJumpPad)) { PuzzleColor tileColor = (PuzzleColor)tile.Properties.GetInteger("color", 0); if (tileColor == PuzzleColor.Red) { sprite = GameData.SPR_TILE_COLOR_JUMP_PAD_RED; } else if (tileColor == PuzzleColor.Yellow) { sprite = GameData.SPR_TILE_COLOR_JUMP_PAD_YELLOW; } else if (tileColor == PuzzleColor.Blue) { sprite = GameData.SPR_TILE_COLOR_JUMP_PAD_BLUE; } } //----------------------------------------------------------------------------- // Color Cube else if (tile.Type == typeof(TileColorCube)) { int orientationIndex = tile.Properties.GetInteger("orientation", 0); sprite = GameData.SPR_COLOR_CUBE_ORIENTATIONS[orientationIndex]; } //----------------------------------------------------------------------------- // Crossing Gate. else if (tile.Type == typeof(TileCrossingGate)) { if (tile.Properties.GetBoolean("raised", false)) { animation = GameData.ANIM_TILE_CROSSING_GATE_LOWER; } else { animation = GameData.ANIM_TILE_CROSSING_GATE_RAISE; } substripIndex = (tile.Properties.GetBoolean("face_left", false) ? 1 : 0); playbackTime = 0.0f; } //----------------------------------------------------------------------------- // Lantern. else if (tile.Type == typeof(TileLantern)) { if (tile.Properties.GetBoolean("lit", true)) { animation = GameData.ANIM_TILE_LANTERN; } else { sprite = GameData.SPR_TILE_LANTERN_UNLIT; } } //----------------------------------------------------------------------------- // Chest. else if (tile.Type == typeof(TileChest)) { bool isLooted = tile.Properties.GetBoolean("looted", false); sprite = tile.SpriteList[isLooted ? 1 : 0].Sprite; } //----------------------------------------------------------------------------- // Color Lantern. /*else if (tile.Type == typeof(TileColorLantern)) { * PuzzleColor color = (PuzzleColor) tile.Properties.GetInteger("color", -1); * if (color == PuzzleColor.Red) * animation = GameData.ANIM_EFFECT_COLOR_FLAME_RED; * else if (color == PuzzleColor.Yellow) * animation = GameData.ANIM_EFFECT_COLOR_FLAME_YELLOW; * else if (color == PuzzleColor.Blue) * animation = GameData.ANIM_EFFECT_COLOR_FLAME_BLUE; * }*/ //----------------------------------------------------------------------------- if (animation == null && sprite == null && tile.CurrentSprite.IsAnimation) { animation = tile.CurrentSprite.Animation; } if (animation == null && sprite == null && tile.CurrentSprite.IsSprite) { sprite = tile.CurrentSprite.Sprite; } // Draw the custom sprite/animation if (animation != null) { g.DrawAnimation(animation.GetSubstrip(substripIndex), tile.Room.Zone.ImageVariantID, playbackTime, position, drawColor); } else if (sprite != null) { g.DrawSprite(sprite, tile.Room.Zone.ImageVariantID, position, drawColor); } /*else if (!tile.CurrentSprite.IsNull) { * g.DrawAnimation(tile.CurrentSprite, * tile.Room.Zone.ImageVariantID, editorControl.Ticks, position, drawColor); * }*/ // Draw rewards. if (editorControl.ShowRewards && tile.Properties.Exists("reward") && editorControl.RewardManager.HasReward(tile.Properties.GetString("reward"))) { Animation anim = editorControl.RewardManager.GetReward(tile.Properties.GetString("reward")).Animation; g.DrawAnimation(anim, editorControl.Ticks, position, drawColor); } }
// Draws the item inside the inventory. public override void DrawSlot(Graphics2D g, Point2I position, int lightOrDark) { DrawSprite(g, position, lightOrDark); DrawAmmo(g, position, lightOrDark); g.DrawSprite(ammo[currentAmmo].Sprite, lightOrDark, position + new Point2I(8, 0)); }
//----------------------------------------------------------------------------- // Drawing //----------------------------------------------------------------------------- protected virtual void DrawSprite(Graphics2D g, Point2I position, int lightOrDark) { g.DrawSprite(sprite[level], lightOrDark, position); }
//----------------------------------------------------------------------------- // Virtual //----------------------------------------------------------------------------- // Draws the item inside the inventory. public override void DrawSlot(Graphics2D g, Point2I position, int lightOrDark) { g.DrawSprite(sprite, position + new Point2I(4, 0)); g.DrawString(GameData.FONT_SMALL, Amount.ToString("00"), position + new Point2I(0, 12), new Color(248, 248, 248)); }
//----------------------------------------------------------------------------- // Virtual //----------------------------------------------------------------------------- // Draws the item inside the inventory. public virtual void DrawSlot(Graphics2D g, Point2I position, int lightOrDark) { g.DrawSprite(sprite, lightOrDark, position); }