Fixed missing position settings

This commit is contained in:
2015-08-02 01:36:52 +10:00
parent f079bc76fb
commit 84fb77b3a3
3 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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:
+2
View File
@@ -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}
}