Back button in character stats window, moved elements slightly upwards for better positioning.
This commit is contained in:
@@ -76,4 +76,20 @@ protected:
|
||||
game->DrawStringProp(drawPos,wrappedText,WHITE,scale);
|
||||
}
|
||||
}
|
||||
virtual void inline DrawDecal(Crawler*game,vf2d parentPos,bool focused)override{
|
||||
if(decal){
|
||||
MenuComponent::DrawDecal(game,parentPos,focused);
|
||||
parentPos+=Menu::menus[parentMenu]->pos;
|
||||
std::string wrappedText=util::WrapText(game,label,int(rect.size.x),true,{float(scale),float(scale)});
|
||||
vf2d drawPos=parentPos+rect.middle()-vf2d{game->GetTextSizeProp(wrappedText)}*float(scale)/2; //Assume centered.
|
||||
if(!centered){
|
||||
drawPos=vf2d{rect.pos.x+2,rect.middle().y-game->GetTextSizeProp(wrappedText).y/2}+parentPos; //We should at least vertically align here.
|
||||
}
|
||||
if(shadow){
|
||||
game->DrawShadowStringPropDecal(drawPos,wrappedText,WHITE,BLACK,{float(scale),float(scale)});
|
||||
}else{
|
||||
game->DrawStringPropDecal(drawPos,wrappedText,WHITE,{float(scale),float(scale)});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user