mirror of
https://github.com/haya3218/SDfmL.git
synced 2024-08-14 23:57:09 +00:00
:)
This commit is contained in:
parent
317d1e8f2c
commit
92da631aeb
1 changed files with 14 additions and 0 deletions
14
src/Main.cpp
14
src/Main.cpp
|
@ -12,6 +12,7 @@ using namespace Render;
|
||||||
class MainState : public State {
|
class MainState : public State {
|
||||||
AnimatedObject objs;
|
AnimatedObject objs;
|
||||||
TextObject text;
|
TextObject text;
|
||||||
|
// objects need to be outside the function to work
|
||||||
Object title;
|
Object title;
|
||||||
Object title2;
|
Object title2;
|
||||||
Object title3;
|
Object title3;
|
||||||
|
@ -46,6 +47,10 @@ class MainState : public State {
|
||||||
title.center.x = WINDOW_WIDTH/2;
|
title.center.x = WINDOW_WIDTH/2;
|
||||||
title.center.y = WINDOW_HEIGHT/2;
|
title.center.y = WINDOW_HEIGHT/2;
|
||||||
|
|
||||||
|
title2.offset.x = 640;
|
||||||
|
title3.offset = {640, 480};
|
||||||
|
title4.offset.y = 480;
|
||||||
|
|
||||||
text.create(50, 480 - 100, "Welcome to the funny application\nMake yourself at home :)\n- haya", "data/monogram.ttf", {255, 255, 255, 255}, TTF_STYLE_NORMAL, 40);
|
text.create(50, 480 - 100, "Welcome to the funny application\nMake yourself at home :)\n- haya", "data/monogram.ttf", {255, 255, 255, 255}, TTF_STYLE_NORMAL, 40);
|
||||||
AddObject(&text);
|
AddObject(&text);
|
||||||
}
|
}
|
||||||
|
@ -62,10 +67,19 @@ class MainState : public State {
|
||||||
|
|
||||||
title.scale.y = sin(elaped);
|
title.scale.y = sin(elaped);
|
||||||
title.scale.x = cos(elaped);
|
title.scale.x = cos(elaped);
|
||||||
|
title2.scale.y = sin(elaped);
|
||||||
|
title2.scale.x = cos(elaped);
|
||||||
|
title3.scale.y = sin(elaped);
|
||||||
|
title3.scale.x = cos(elaped);
|
||||||
|
title4.scale.y = sin(elaped);
|
||||||
|
title4.scale.x = cos(elaped);
|
||||||
|
|
||||||
pointTo(&camera, objs);
|
pointTo(&camera, objs);
|
||||||
|
|
||||||
title.centerSelf();
|
title.centerSelf();
|
||||||
|
title2.centerSelf();
|
||||||
|
title3.centerSelf();
|
||||||
|
title4.centerSelf();
|
||||||
text.centerSelf();
|
text.centerSelf();
|
||||||
|
|
||||||
text.scale.y = cos(elaped*10)*2;
|
text.scale.y = cos(elaped*10)*2;
|
||||||
|
|
Loading…
Reference in a new issue