Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Engine/source/T3D/fps/guiClockHud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ void GuiClockHud::onRender(Point2I offset, const RectI &updateRect)
dSprintf(buf,sizeof(buf), "%02d:%02d",mins,secs);

// Center the text
offset.x += (getWidth() - mProfile->mFont->getStrWidth((const UTF8 *)buf)) / 2;
offset.y += (getHeight() - mProfile->mFont->getHeight()) / 2;
offset.x += (getWidth() - mProfile->mFont->getStringWidthScaled(String::ToString(buf), mProfile->mFontSize)) / 2;
offset.y += (getHeight() - mProfile->mFont->getScaledHeight(mProfile->mFontSize)) / 2;
drawUtil->setBitmapModulation(mTextColor.toColorI());
drawUtil->drawText(mProfile->mFont, offset, buf);
drawUtil->drawText(mProfile->mFont, offset, buf, mProfile->mFontSize);
drawUtil->clearBitmapModulation();

// Border last
Expand Down
6 changes: 3 additions & 3 deletions Engine/source/T3D/fps/guiHealthTextHud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ void GuiHealthTextHud::onRender(Point2I offset, const RectI &updateRect)
S32 val = (S32)mValue;
char buf[256];
dSprintf(buf, sizeof(buf), "%d", val);
offset.x += (getBounds().extent.x - mProfile->mFont->getStrWidth((const UTF8 *)buf)) / 2;
offset.y += (getBounds().extent.y - mProfile->mFont->getHeight()) / 2;
offset.x += (getBounds().extent.x - mProfile->mFont->getStringWidthScaled(String::ToString(buf), mProfile->mFontSize)) / 2;
offset.y += (getBounds().extent.y - mProfile->mFont->getScaledHeight(mProfile->mFontSize)) / 2;

LinearColorF tColor = mTextColor;

Expand All @@ -194,7 +194,7 @@ void GuiHealthTextHud::onRender(Point2I offset, const RectI &updateRect)
}

drawUtil->setBitmapModulation(tColor.toColorI());
drawUtil->drawText(mProfile->mFont, offset, buf);
drawUtil->drawText(mProfile->mFont, offset, buf, mProfile->mFontSize);
drawUtil->clearBitmapModulation();

// If enabled draw the border last
Expand Down
6 changes: 3 additions & 3 deletions Engine/source/T3D/fps/guiShapeNameHud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ void GuiShapeNameHud::onRender( Point2I, const RectI &updateRect)
/// @param opacity Opacity of name (a fraction).
void GuiShapeNameHud::drawName(Point2I offset, const char *name, F32 opacity)
{
F32 width = mProfile->mFont->getStrWidth((const UTF8 *)name) + mLabelPadding.x * 2;
F32 height = mProfile->mFont->getHeight() + mLabelPadding.y * 2;
F32 width = mProfile->mFont->getStringWidthScaled(String::ToString(name), mProfile->mFontSize) + mLabelPadding.x * 2;
F32 height = mProfile->mFont->getScaledHeight(mProfile->mFontSize) + mLabelPadding.y * 2;
Point2I extent = Point2I(width, height);

// Center the name
Expand All @@ -308,7 +308,7 @@ void GuiShapeNameHud::drawName(Point2I offset, const char *name, F32 opacity)
// Deal with opacity and draw.
mTextColor.alpha = opacity;
drawUtil->setBitmapModulation(mTextColor.toColorI());
drawUtil->drawText(mProfile->mFont, offset + mLabelPadding, name);
drawUtil->drawText(mProfile->mFont, offset + mLabelPadding, name, mProfile->mFontSize);
drawUtil->clearBitmapModulation();

// Border last
Expand Down
4 changes: 2 additions & 2 deletions Engine/source/afx/ui/afxGuiTextHud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ void afxGuiTextHud::onRender( Point2I, const RectI &updateRect)
void afxGuiTextHud::drawName(Point2I offset, const char *name, F32 opacity, LinearColorF* color)
{
// Center the name
offset.x -= mProfile->mFont->getStrWidth((const UTF8 *)name) / 2;
offset.y -= mProfile->mFont->getHeight();
offset.x -= mProfile->mFont->getStringWidthScaled(String::ToString(name), mProfile->mFontSize) / 2;
offset.y -= mProfile->mFont->getScaledHeight(mProfile->mFontSize);

// Deal with opacity and draw.
LinearColorF draw_color = (color) ? *color : mTextColor;
Expand Down
12 changes: 6 additions & 6 deletions Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1111,22 +1111,22 @@ void GuiMeshRoadEditorCtrl::renderScene(const RectI & updateRect)
GFX->getDrawUtil()->setBitmapModulation(ColorI(128, 128, 128));
dStrcpy(buf, "Reset Profile: Double-click Start Node", 64);
GFX->getDrawUtil()->drawTextN(mProfile->mFont, posi, buf, dStrlen(buf));
posi.y -= mProfile->mFont->getCharHeight((U8)buf[0]) + 4;
posi.y -= mProfile->mFont->getCharHeightScaled((U8)buf[0], mProfile->mFontSize) + 4;
dStrcpy(buf, "Move Node: Click and Drag Node", 64);
GFX->getDrawUtil()->drawTextN(mProfile->mFont, posi, buf, dStrlen(buf));
posi.y -= mProfile->mFont->getCharHeight((U8)buf[0]) + 4;
posi.y -= mProfile->mFont->getCharHeightScaled((U8)buf[0], mProfile->mFontSize) + 4;
dStrcpy(buf, "Select Multiple Nodes: Ctrl-click Nodes", 64);
GFX->getDrawUtil()->drawTextN(mProfile->mFont, posi, buf, dStrlen(buf));
posi.y -= mProfile->mFont->getCharHeight((U8)buf[0]) + 4;
posi.y -= mProfile->mFont->getCharHeightScaled((U8)buf[0], mProfile->mFontSize) + 4;
dStrcpy(buf, "Toggle Material: Shift-click Spline Segment", 64);
GFX->getDrawUtil()->drawTextN(mProfile->mFont, posi, buf, dStrlen(buf));
posi.y -= mProfile->mFont->getCharHeight((U8)buf[0]) + 4;
posi.y -= mProfile->mFont->getCharHeightScaled((U8)buf[0], mProfile->mFontSize) + 4;
dStrcpy(buf, "Toggle Smoothing: Shift-click Node", 64);
GFX->getDrawUtil()->drawTextN(mProfile->mFont, posi, buf, dStrlen(buf));
posi.y -= mProfile->mFont->getCharHeight((U8)buf[0]) + 4;
posi.y -= mProfile->mFont->getCharHeightScaled((U8)buf[0], mProfile->mFontSize) + 4;
dStrcpy(buf, "Delete Node: Alt-click Node", 64);
GFX->getDrawUtil()->drawTextN(mProfile->mFont, posi, buf, dStrlen(buf));
posi.y -= mProfile->mFont->getCharHeight((U8)buf[0]) + 4;
posi.y -= mProfile->mFont->getCharHeightScaled((U8)buf[0], mProfile->mFontSize) + 4;
dStrcpy(buf, "Add Node: Ctrl-click Spline", 64);
GFX->getDrawUtil()->drawTextN(mProfile->mFont, posi, buf, dStrlen(buf));
}
Expand Down
Loading
Loading