Created
January 5, 2020 21:43
-
-
Save lighth7015/320b0d3960f594748649bcbd3e0568fd to your computer and use it in GitHub Desktop.
SkinnedBtn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "ecere" | |
import "ecere.gui" | |
class SkinnedBtn: Button { | |
void OnRedraw(Surface surface) { | |
int tw = 0, th = 0; | |
int ot = 0, ol = 0, | |
ob = size.h, or = size.w; | |
// Button::OnRedraw(surface); | |
surface.TextFont(this.fontObject); | |
surface.SetBackground(Color { 0, 107, 173 }); | |
surface.Area(position.x, position.y, size.w, size.h); | |
if (this.text) { | |
surface.TextExtent(this.text, strlen(this.text),&tw, &th); | |
} | |
switch (buttonState) { | |
default: | |
case ecere::gui::controls::ButtonState::up: | |
ot --; | |
ol --; | |
ob --; | |
or --; | |
break; | |
case ecere::gui::controls::ButtonState::down: | |
break; | |
} | |
//surface.Rectangle(ot, ol, or, ob); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment