Add UIContext::DrawTextShadow for drawing text correctly under Qt

This commit is contained in:
zhyk committed 2015-05-07 11:10:08 +08:00
1 parent 2b69711b67
commit 7d9ff90bec
2 files changed
+7

No files matched your search

+6
View File
@@ -152,6 +152,12 @@ void UIContext::DrawText(const char *str, float x, float y, uint32_t color, int
}
}
void UIContext::DrawTextShadow(const char *str, float x, float y, uint32_t color, int align) {
uint32_t alpha = (color >> 1) & 0xFF000000;
DrawText(str, x + 2, y + 2, alpha, align);
DrawText(str, x, y, color, align);
}
void UIContext::DrawTextRect(const char *str, const Bounds &bounds, uint32_t color, int align) {
if (!textDrawer_ || (align & FLAG_DYNAMIC_ASCII)) {
float sizeFactor = (float)fontStyle_->sizePts / 24.0f;