diff --git a/assets/assets.aseprite b/assets/assets.aseprite index d481efd..adb1a42 100644 Binary files a/assets/assets.aseprite and b/assets/assets.aseprite differ diff --git a/assets/axe.png b/assets/axe.png index b1a3c15..bbb2b6d 100644 Binary files a/assets/axe.png and b/assets/axe.png differ diff --git a/assets/hoe.png b/assets/hoe.png index 81ae009..73d7f27 100644 Binary files a/assets/hoe.png and b/assets/hoe.png differ diff --git a/assets/scythe.png b/assets/scythe.png index 06e114b..d1f0875 100644 Binary files a/assets/scythe.png and b/assets/scythe.png differ diff --git a/assets/seeds_ui_npatch.png b/assets/seeds_ui_npatch.png new file mode 100644 index 0000000..268faf9 Binary files /dev/null and b/assets/seeds_ui_npatch.png differ diff --git a/assets/tool_ui_npatch.png b/assets/tool_ui_npatch.png new file mode 100644 index 0000000..da2a565 Binary files /dev/null and b/assets/tool_ui_npatch.png differ diff --git a/assets/watering_can.png b/assets/watering_can.png index af890e7..afb5e58 100644 Binary files a/assets/watering_can.png and b/assets/watering_can.png differ diff --git a/game.rdi b/game.rdi new file mode 100644 index 0000000..0e80c56 Binary files /dev/null and b/game.rdi differ diff --git a/src/globals.odin b/src/globals.odin index ccc8c7c..b232a63 100644 --- a/src/globals.odin +++ b/src/globals.odin @@ -79,7 +79,16 @@ update_hotbar :: proc() { } draw_hotbar :: proc() { - rl.DrawRectangleRec({TOOL_POS.x, TOOL_POS.y, 32, 32}, rl.WHITE) + //rl.DrawRectangleRec({TOOL_POS.x, TOOL_POS.y, 32, 32}, rl.WHITE) + texture := hotbar.kind == .tools ? tool_ui_npatch_texture : seeds_ui_npatch_texture + rl.DrawTextureNPatch( + texture, + tool_ui_npatch, + {TOOL_POS.x, TOOL_POS.y, 32, 32}, + {}, + 0, + rl.WHITE, + ) slots := hotbar.kind == .tools ? hotbar.tool_slots : hotbar.seed_slots if len(slots) == 0 {return} hotbar_item_texture := ITEM_TEXTURES[slots[hotbar.current_slot]] diff --git a/src/resources.odin b/src/resources.odin index 5a50e05..95d2179 100644 --- a/src/resources.odin +++ b/src/resources.odin @@ -10,6 +10,8 @@ tomato_spritesheet_sprite: []u8 : #load("../assets/tomato.png") tomato_item_sprite: []u8 : #load("../assets/tomato_item.png") sell_button_sprite: []u8 : #load("../assets/sell_button.png") background_sprite: []u8 : #load("../assets/background.png") +tool_ui_npatch_sprite: []u8 : #load("../assets/tool_ui_npatch.png") +seeds_ui_npatch_sprite: []u8 : #load("../assets/seeds_ui_npatch.png") tile_dirt_dry_sprite: []u8 : #load("../assets/tile_dirt_dry.png") tile_dirt_wet_sprite: []u8 : #load("../assets/tile_dirt_wet.png") hoe_sprite: []u8 : #load("../assets/hoe.png") @@ -21,6 +23,9 @@ pickup_sound: rl.Sound sell_button_texture: rl.Texture2D background_texture: rl.Texture2D +tool_ui_npatch_texture: rl.Texture2D +seeds_ui_npatch_texture: rl.Texture2D +tool_ui_npatch: rl.NPatchInfo tile_dirt_dry_texture: rl.Texture2D tile_dirt_wet_texture: rl.Texture2D tomato_texture: rl.Texture2D @@ -76,9 +81,18 @@ load_resources :: proc() { offset = {TILE_SIZE / 2, TILE_SIZE}, } - background_texture = load_texture_from_memory(background_sprite) - sell_button_texture = load_texture_from_memory(sell_button_sprite) + background_texture = load_texture_from_memory(background_sprite) + tool_ui_npatch_texture = load_texture_from_memory(tool_ui_npatch_sprite) + seeds_ui_npatch_texture = load_texture_from_memory(seeds_ui_npatch_sprite) + tool_ui_npatch = rl.NPatchInfo { + source = {0, 0, TILE_SIZE, TILE_SIZE}, + left = 2, + top = 2, + right = 2, + bottom = 2, + layout = .NINE_PATCH, + } tile_dirt_dry_texture = load_texture_from_memory(tile_dirt_dry_sprite) tile_dirt_wet_texture = load_texture_from_memory(tile_dirt_wet_sprite) @@ -133,6 +147,7 @@ free_resources :: proc() { rl.UnloadTexture(sell_button_texture) rl.UnloadTexture(background_texture) + rl.UnloadTexture(tool_ui_npatch_texture) rl.UnloadTexture(tomato_texture) rl.UnloadTexture(tile_dirt_dry_texture)