Setting Window flags right; adding animation
This commit is contained in:
parent
c0e3af64d6
commit
4536c62dad
2 changed files with 30 additions and 28 deletions
18
src/main.c
18
src/main.c
|
@ -19,11 +19,15 @@
|
|||
int main(int argc, char** argv)
|
||||
{
|
||||
InitWindow(900, 600, "Colysis");
|
||||
SetWindowState(FLAG_WINDOW_RESIZABLE | FLAG_WINDOW_MAXIMIZED);
|
||||
|
||||
|
||||
SetConfigFlags(FLAG_WINDOW_RESIZABLE);
|
||||
Texture2D gery = LoadTexture(ASSETS_PATH "/karl-heinz_head.png");
|
||||
|
||||
SpriteAnimation geryanim = CreateSpriteAnimation(gery, (Vector2){64*14,64}, (Vector2){64,64}, 0.f, 4.f, 5, 0.15f);
|
||||
SpriteAnimation geryanim = CreateSpriteAnimation(gery,
|
||||
(Vector2){64*14,64}, (Vector2){64,64},
|
||||
0.f, 4.f, 5, 0.15f);
|
||||
|
||||
|
||||
Camera2D camera = { 0 };
|
||||
camera.target = (Vector2){0,0};
|
||||
|
@ -34,7 +38,7 @@ int main(int argc, char** argv)
|
|||
while (!WindowShouldClose()) {
|
||||
ClearBackground((Color){ 0x00, 0x6d, 0xfb });
|
||||
float dt = GetFrameTime();
|
||||
|
||||
camera.offset = (Vector2){GetScreenWidth()/2.f,GetScreenHeight()/2.f};
|
||||
|
||||
|
||||
UpdateSpriteAnimation(geryanim, dt);
|
||||
|
@ -45,13 +49,13 @@ int main(int argc, char** argv)
|
|||
BeginMode2D(camera);
|
||||
{
|
||||
DrawSpriteAnimation(geryanim, (Vector2){0,0});
|
||||
|
||||
}
|
||||
EndMode2D();
|
||||
|
||||
{
|
||||
DrawTextFull(GetFontDefault(), "Darling, I'm Home!", (Vector2){20,20}, TEXT_ORIENTATION_RIGHT, 0, 24, 5, 5, RAYWHITE);
|
||||
|
||||
DrawTextFull(GetFontDefault(), "Darling, I'm Home!",
|
||||
(Vector2){20,20}, TEXT_ORIENTATION_RIGHT,
|
||||
0, 24, 5, 5, RAYWHITE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,5 +65,7 @@ int main(int argc, char** argv)
|
|||
DestroySpriteAnimation(geryanim);
|
||||
UnloadTexture(gery);
|
||||
|
||||
CloseWindow();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue