diff --git a/src/common/button.cpp b/src/common/button.cpp index 42a5f80..21b8b47 100644 --- a/src/common/button.cpp +++ b/src/common/button.cpp @@ -25,7 +25,7 @@ void Button::DrawTo(SDL_Renderer* renderer) { image.SetClipY(image.GetClipH() * state); - image.DrawTo(renderer, 0, 0); + image.DrawTo(renderer, posX, posY); } void Button::SetBackgroundTexture(SDL_Renderer* renderer, SDL_Texture* texture) { diff --git a/src/common/button.hpp b/src/common/button.hpp index ab34c96..71b8e02 100644 --- a/src/common/button.hpp +++ b/src/common/button.hpp @@ -51,7 +51,7 @@ public: State MouseButtonUp(SDL_MouseButtonEvent const&); //states - void SetState(State); //idle, busy or disabled + void SetState(State); //TODO: idle, busy or disabled State GetState(); protected: diff --git a/src/example_scene.cpp b/src/example_scene.cpp index 2a9e270..ac1ecc4 100644 --- a/src/example_scene.cpp +++ b/src/example_scene.cpp @@ -58,6 +58,8 @@ ExampleScene::ExampleScene(lua_State* L) { } button.SetBackgroundTexture(GetRenderer(), buttonBG.GetTexture()); button.SetText(GetRenderer(), font, "BUTTON TEXT", {0, 0, 0, 255}); + button.SetX(400); + button.SetY(200); // {140, 62, 54, 255} }