1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

gg: renaming drawing functions (#12913)

This commit is contained in:
Benjamin Stigsen
2021-12-23 12:31:25 +01:00
committed by GitHub
parent ad1ef6a9e2
commit 546c388b02
15 changed files with 145 additions and 55 deletions

View File

@@ -354,7 +354,7 @@ fn (g &Game) draw_next_tetro() {
}
fn (g &Game) draw_block_color(i int, j int, color gx.Color) {
g.gg.draw_rect(f32((j - 1) * g.block_size) + g.margin, f32((i - 1) * g.block_size),
g.gg.draw_rect_filled(f32((j - 1) * g.block_size) + g.margin, f32((i - 1) * g.block_size),
f32(g.block_size - 1), f32(g.block_size - 1), color)
}
@@ -380,11 +380,11 @@ fn (mut g Game) draw_ui() {
lines := g.lines.str()
g.gg.draw_text(ws.width - lines.len * textsize, 3, lines, text_cfg)
if g.state == .gameover {
g.gg.draw_rect(0, ws.height / 2 - textsize, ws.width, 5 * textsize, ui_color)
g.gg.draw_rect_filled(0, ws.height / 2 - textsize, ws.width, 5 * textsize, ui_color)
g.gg.draw_text(1, ws.height / 2 + 0 * textsize, 'Game Over', over_cfg)
g.gg.draw_text(1, ws.height / 2 + 2 * textsize, 'Space to restart', over_cfg)
} else if g.state == .paused {
g.gg.draw_rect(0, ws.height / 2 - textsize, ws.width, 5 * textsize, ui_color)
g.gg.draw_rect_filled(0, ws.height / 2 - textsize, ws.width, 5 * textsize, ui_color)
g.gg.draw_text(1, ws.height / 2 + 0 * textsize, 'Game Paused', text_cfg)
g.gg.draw_text(1, ws.height / 2 + 2 * textsize, 'SPACE to resume', text_cfg)
}