MFString operator+(const char *pString, const MFString &string) { if(string.IsEmpty()) return MFString(pString); if(!pString || *pString == 0) return string; return MFString::Static(pString) + string; }
MFString MFString::operator+(const MFString &string) const { if(string.IsEmpty()) return *this; if(IsEmpty()) return string; size_t bytes = pData->bytes + string.pData->bytes; MFString t; t.Reserve(bytes + 1); MFString_CopyCat(t.pData->pMemory, pData->pMemory, string.pData->pMemory); t.pData->bytes = bytes; return t; }
void HKWidgetRendererLabel::Render(const HKWidget &widget, const MFMatrix &worldTransform) { HKWidgetRenderer::Render(widget, worldTransform); HKWidgetLabel &label = (HKWidgetLabel&)widget; MFString l = label.GetText(); if(!l.IsEmpty()) { MFFont *pFont = label.GetFont(); float height = label.GetTextHeight(); float shadowDepth = label.GetShadowDepth(); const MFVector &size = widget.GetSize(); const MFVector &colour = widget.GetColour(); const MFVector &textColour = label.GetTextColour(); MFFontJustify j = label.GetTextJustification(); const char *pString = l.CStr(); if(shadowDepth > 0.f) MFFont_DrawTextJustified(pFont, pString, MakeVector(shadowDepth, shadowDepth), size.x, size.y, j, height, MFVector::black, -1, worldTransform); MFFont_DrawTextJustified(pFont, pString, MFVector::zero, size.x, size.y, j, height, textColour * colour, -1, worldTransform); } }