@ -54,25 +54,25 @@ protected:
virtual void inline DrawDecal ( Crawler * game , vf2d parentPos , bool focused ) override {
if ( label . length ( ) > 0 ) {
MenuLabel : : DrawDecal ( game , parentPos , focused ) ;
std : : string wrappedText = util : : WrapText ( game , label , rect . size . x , true , { scale , scale } ) ;
vf2d drawPos = parentPos + rect . middle ( ) - vf2d { game - > GetTextSizeProp ( wrappedText ) } * float ( scale ) / 2 ; //Assume centered.
std : : string wrappedText = util : : WrapText ( game , label , rect . size . x - 1 , true , { scale , scale } ) ;
vf2d drawPos = Menu : : menus . at ( parentMenu ) - > pos + 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 , { scale , scale } ) ;
} else {
game - > DrawStringPropDecal ( drawPos , wrappedText , WHITE , { scale , scale } ) ;
drawPos = Menu : : menus . at ( parentMenu ) - > pos + vf2d { rect . pos . x + 2 , rect . middle ( ) . y - game - > GetTextSizeProp ( wrappedText ) . y / 2 } + parentPos ; //We should at least vertically align here.
}
if ( background ) {
game - > FillRectDecal ( rect . pos + parentPos , rect . size , PixelLerp ( Menu : : themes [ Menu : : themeSelection ] . GetButtonCol ( ) , Menu : : themes [ Menu : : themeSelection ] . GetHighlightCol ( ) , hoverEffect / " ThemeGlobal.HighlightTime " _F ) ) ;
game - > FillRectDecal ( Menu : : menus . at ( parentMenu ) - > pos + rect . pos + parentPos , rect . size , PixelLerp ( Menu : : themes [ Menu : : themeSelection ] . GetButtonCol ( ) , Menu : : themes [ Menu : : themeSelection ] . GetHighlightCol ( ) , hoverEffect / " ThemeGlobal.HighlightTime " _F ) ) ;
}
if ( border ) {
game - > DrawRectDecal ( rect . pos + parentPos , rect . size ) ;
game - > DrawRectDecal ( Menu : : menus . at ( parentMenu ) - > pos + rect . pos + parentPos , rect . size ) ;
}
if ( showDefaultLabel ) {
game - > DrawStringPropDecal ( rect . pos + parentPos + rect . size / 2 - game - > GetTextSizeProp ( label ) / 2 , label ) ;
game - > DrawStringPropDecal ( Menu : : menus . at ( parentMenu ) - > pos + rect . pos + parentPos + rect . size / 2 - game - > GetTextSizeProp ( label ) / 2 , label ) ;
}
if ( shadow ) {
game - > DrawShadowStringPropDecal ( drawPos , wrappedText , WHITE , BLACK , { scale , scale } ) ;
} else {
game - > DrawStringPropDecal ( drawPos , wrappedText , WHITE , { scale , scale } ) ;
}
}
}
} ;