mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
gg: renaming drawing functions (#12913)
This commit is contained in:
parent
ad1ef6a9e2
commit
546c388b02
15 changed files with 145 additions and 55 deletions
|
@ -157,16 +157,16 @@ fn on_frame(mut app App) {
|
|||
}
|
||||
// drawing snake
|
||||
for pos in app.snake {
|
||||
app.gg.draw_rect(tile_size * pos.x, tile_size * pos.y + top_height, tile_size,
|
||||
app.gg.draw_rect_filled(tile_size * pos.x, tile_size * pos.y + top_height, tile_size,
|
||||
tile_size, gx.blue)
|
||||
}
|
||||
|
||||
// drawing food
|
||||
app.gg.draw_rect(tile_size * app.food.x, tile_size * app.food.y + top_height, tile_size,
|
||||
tile_size, gx.red)
|
||||
app.gg.draw_rect_filled(tile_size * app.food.x, tile_size * app.food.y + top_height,
|
||||
tile_size, tile_size, gx.red)
|
||||
|
||||
// drawing top
|
||||
app.gg.draw_rect(0, 0, canvas_size, top_height, gx.black)
|
||||
app.gg.draw_rect_filled(0, 0, canvas_size, top_height, gx.black)
|
||||
app.gg.draw_text(150, top_height / 2, 'Score: $app.score', gx.TextCfg{
|
||||
color: gx.white
|
||||
align: .center
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue