added different scaling, breaking change

This commit is contained in:
Stefan Stefanov 2024-02-10 23:04:35 +02:00
parent 8bc4572ae3
commit 799e5ad9eb
4 changed files with 92 additions and 57 deletions

View file

@ -9,7 +9,6 @@ GameScreen :: enum {
ENDING,
}
update_screen :: proc(state: ^GameState) {
using state
@ -53,25 +52,29 @@ draw_screen :: proc(state: ^GameState) {
{
rl.DrawRectangle(0, 0, state.screen_width, state.screen_height, rl.WHITE)
rl.DrawCircle(0, 0, 20, rl.RED)
rl.DrawTexturePro(
texture_atlas,
{LOGO_TO[0].x, LOGO_TO[0].y, LOGO_TO[1].x, LOGO_TO[1].y},
{
f32(screen_width / GLOBAL_SPRITE_SCALE) / 2,
f32(screen_height / GLOBAL_SPRITE_SCALE) / 2,
f32(screen_width / GLOBAL_SPRITE_SCALE),
f32(screen_height / GLOBAL_SPRITE_SCALE),
LOGO_TO[1].x * 4,
LOGO_TO[1].y * 4,
},
{LOGO_TO[1].x * 2, LOGO_TO[1].y * 2},
{
f32(screen_width / GLOBAL_SPRITE_SCALE),
f32(screen_height / GLOBAL_SPRITE_SCALE),
},
0,
rl.GREEN,
)
text : cstring = "PRESS ENTER TO START GAME"
size := rl.MeasureText(text, 20)
rl.DrawText(
text: cstring = "PRESS ENTER TO START GAME"
size := rl.MeasureText(text, 20)
rl.DrawText(
text,
(screen_width/4) - (size/2),
(screen_height / 2)- 20,
(screen_width / 4) - (size / 2),
(screen_height / 2) - 20,
20,
rl.DARKGREEN,
)