126 int32_t iTextWdt,iTextHgt;
137 if (!wdt) wdt = Clamp<int32_t>(cgo.
Wdt/2, 50, std::min<int32_t>(500, cgo.
Wdt-10));
139 wdt = std::min<int32_t>(wdt, iUnbrokenTextWidth+10);
144 wdt = Clamp<int32_t>(cgo.
Wdt-50, 50, 500);
146 wdt = Clamp<int32_t>(wdt, 10, cgo.
Wdt-10);
148 iTextWdt = wdt * cgo.
Zoom;
156 int32_t iDrawX = cgo.
X+x;
157 int32_t iDrawY = cgo.
Y+y;
170 iDrawX *= cgo.
Zoom; iDrawY *= cgo.
Zoom;
172 if (
dwFlags & C4GM_Bottom) { rect.y -= rect.Hgt; iDrawY -= rect.Hgt; }
173 else if (
dwFlags & C4GM_VCenter) { rect.y -= rect.Hgt/2; iDrawY -= rect.Hgt/2; }
174 if (
dwFlags & C4GM_Right) { rect.x -= rect.Wdt; iDrawX -= rect.Wdt; }
175 else if (
dwFlags & C4GM_HCenter) { rect.x -= rect.Wdt/2; iDrawX -= rect.Wdt/2; }
199 iDrawX += (cgo.
Wdt/2) * cgo.
Zoom;
200 iDrawY += (2 * cgo.
Hgt / 3 + 50) * cgo.
Zoom;
209 float iMsgX, iMsgY, newzoom;
215 if (Inside<float>((iMsgX - cgo.
X) * newzoom, 0, cgo.
Wdt * cgo.
Zoom - 1) || (
dwFlags & C4GM_XRel))
216 if (Inside<float>((iMsgY - cgo.
Y) * newzoom, 0, cgo.
Hgt * cgo.
Zoom - 1) || (
dwFlags & C4GM_YRel))
228 int breakWdt = Clamp<int32_t>(cgo.
Wdt * cgo.
Zoom, 50, 200);
244 else if (
dwFlags & C4GM_VCenter)
257 else if (
dwFlags & C4GM_HCenter)
262 iTX = (iMsgX - cgo.
X) * newzoom;
263 iTY = (iMsgY - cgo.
Y) * newzoom;
273 iTY -= zoom * float(iTHgt);
274 else if (
dwFlags & C4GM_VCenter)
275 iTY -= zoom * float(iTHgt/2);
277 iTY -= zoom * float(iTHgt);
280 iTX += 0.25f * float(iTWdt) * (1.0f - zoom);
284 if (~
dwFlags & C4GM_XRel) iTX = Clamp<float>(iTX, iTWdt/2, cgo.
Wdt * cgo.
Zoom - iTWdt / 2) + 0.5f;
285 if (~
dwFlags & C4GM_YRel) iTY = Clamp<float>(iTY, 0, cgo.
Hgt * cgo.
Zoom - iTHgt) + 0.5f;
void DrawPicture(C4Facet &cgo, bool fSelected=false, C4DrawTransform *transform=nullptr)
bool TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface *sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true)
void Draw(C4TargetFacet &cgo, C4Rect &rcDrawArea)
bool GetTextExtent(const char *szText, int32_t &rsx, int32_t &rsy, bool fCheckMarkup=true)
int32_t GetTextWidth(const char *szText, bool fCheckMarkup=true)
C4GraphicsResource GraphicsResource
const int32_t C4GM_TargetPlayer
const int32_t C4GM_NoBreak
virtual C4Object * GetObject()
const int32_t C4GM_Bottom
C4GUI::FrameDecoration * pFrameDeco
void Draw(C4Facet &cgo, bool fSelected=false, DWORD iColor=0, C4Object *pObj=nullptr, int32_t iPhaseX=0, int32_t iPhaseY=0, C4DrawTransform *trans=nullptr, const char *graphicsName=nullptr)
const int32_t C4GM_VCenter
const int32_t C4GM_GlobalPlayer
const int32_t C4GM_Target
const char * getData() const
std::tuple< std::string, int > BreakMessage(const char *szMsg, int iWdt, bool fCheckMarkup, float fZoom=1.0f)
bool IsVisible(int32_t iForPlr, bool fAsOverlay) const
void Ref(const char *pnData)
int32_t DrawMessageOffset
bool GetDrawPosition(const C4TargetFacet &cgo, float &resultx, float &resulty, float &resultzoom) const
virtual C4Def const * GetDef() const
const int32_t C4GM_WidthRel
const int32_t C4GM_Global
const int32_t C4GM_HCenter
bool DrawPropListSpecImage(C4Facet &fctTarget, C4PropList *pSpec)