feat: apply same 3d effect from deck to foundations

ci-dev
LeRoyce Pearson 2024-04-21 01:15:00 -06:00
parent 57825e9534
commit 53be39dcd3
1 changed files with 4 additions and 1 deletions

View File

@ -191,7 +191,7 @@ fn render(window: *seizer.Window) !void {
const is_hovered = hovered_deck != null and hovered_deck.? == foundation; const is_hovered = hovered_deck != null and hovered_deck.? == foundation;
const color = if (is_hovered) [4]u8{ 0xA0, 0xFF, 0xA0, 0xFF } else [4]u8{ 0xFF, 0xFF, 0xFF, 0xFF }; const color = if (is_hovered) [4]u8{ 0xA0, 0xFF, 0xA0, 0xFF } else [4]u8{ 0xFF, 0xFF, 0xFF, 0xFF };
const pos = [2]f32{ var pos = [2]f32{
@floatFromInt(margin), @floatFromInt(margin),
@floatFromInt(margin + ((margin + tile_size[1]) * (i + 1))), @floatFromInt(margin + ((margin + tile_size[1]) * (i + 1))),
}; };
@ -203,6 +203,7 @@ fn render(window: *seizer.Window) !void {
.size = tile_sizef, .size = tile_sizef,
.color = color, .color = color,
}); });
pos[1] -= 0.25 * scalef;
} }
} }
@ -238,6 +239,8 @@ fn render(window: *seizer.Window) !void {
const color = if (is_hovered) [4]u8{ 0xA0, 0xFF, 0xA0, 0xFF } else [4]u8{ 0xFF, 0xFF, 0xFF, 0xFF }; const color = if (is_hovered) [4]u8{ 0xA0, 0xFF, 0xA0, 0xFF } else [4]u8{ 0xFF, 0xFF, 0xFF, 0xFF };
var pos = [2]f32{ @floatFromInt(margin), @floatFromInt(margin) }; var pos = [2]f32{ @floatFromInt(margin), @floatFromInt(margin) };
canvas.rect(pos, tile_sizef, .{ .color = color });
for (draw_pile.items) |card| { for (draw_pile.items) |card| {
const tile_id = if (!draw_pile_exhausted) card_tilemap.?.back else card_tilemap.?.getTileForCard(card); const tile_id = if (!draw_pile_exhausted) card_tilemap.?.back else card_tilemap.?.getTileForCard(card);
card_tilemap.?.tilesheet.renderTile(&canvas, tile_id, pos, .{ card_tilemap.?.tilesheet.renderTile(&canvas, tile_id, pos, .{