Added properties for border and background control, vertically align uncentered labels by default.
This commit is contained in:
@@ -28,11 +28,15 @@ void MenuComponent::_Update(Crawler*game){
|
||||
}
|
||||
|
||||
void MenuComponent::Draw(Crawler*game,vf2d parentPos,bool focused){
|
||||
game->FillRect(rect.pos+parentPos,rect.size,PixelLerp(Menu::themes[Menu::themeSelection].GetButtonCol(),Menu::themes[Menu::themeSelection].GetHighlightCol(),hoverEffect/"ThemeGlobal.HighlightTime"_F)*(focused?1:"ThemeGlobal.MenuUnfocusedColorMult"_F));
|
||||
if(background){
|
||||
game->FillRect(rect.pos+parentPos,rect.size,PixelLerp(Menu::themes[Menu::themeSelection].GetButtonCol(),Menu::themes[Menu::themeSelection].GetHighlightCol(),hoverEffect/"ThemeGlobal.HighlightTime"_F)*(focused?1:"ThemeGlobal.MenuUnfocusedColorMult"_F));
|
||||
}
|
||||
if(border){
|
||||
game->DrawRect(rect.pos+parentPos,rect.size,focused?GREY:GREY*"ThemeGlobal.MenuUnfocusedColorMult"_F);
|
||||
}
|
||||
game->DrawStringProp(rect.pos+parentPos+rect.size/2-game->GetTextSizeProp(label)/2,label,focused?WHITE:WHITE*"ThemeGlobal.MenuUnfocusedColorMult"_F);
|
||||
if(showDefaultLabel){
|
||||
game->DrawStringProp(rect.pos+parentPos+rect.size/2-game->GetTextSizeProp(label)/2,label,focused?WHITE:WHITE*"ThemeGlobal.MenuUnfocusedColorMult"_F);
|
||||
}
|
||||
}
|
||||
|
||||
void MenuComponent::_Draw(Crawler*game,vf2d parentPos,bool focused){
|
||||
|
||||
Reference in New Issue
Block a user