MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / drawStringCentredClipped

Function drawStringCentredClipped

src/OpenLoco/src/Graphics/TextRenderer.cpp:659–676  ·  view source on GitHub ↗

0x00494C36 al: colour bx: string id bp: width cx: x dx: y esi: args edi: rt

Source from the content-addressed store, hash-verified

657 // esi: args
658 // edi: rt
659 static Ui::Point drawStringCentredClipped(
660 TextDrawingState& drawState,
661 DrawingContext& ctx,
662 const RenderTarget& rt,
663 Ui::Point origin,
664 uint16_t width,
665 AdvancedColour colour,
666 StringId stringId,
667 FormatArgumentsView args)
668 {
669 char buffer[512];
670 StringManager::formatString(buffer, std::size(buffer), stringId, args);
671
672 width = clipString(drawState.font, width, buffer);
673
674 auto point = Ui::Point(origin.x - (width / 2), origin.y);
675 return drawString(drawState, ctx, rt, point, colour, buffer);
676 }
677
678 /**
679 * 0x00494ECF

Callers 1

Calls 3

formatStringFunction · 0.85
clipStringFunction · 0.85
drawStringFunction · 0.85

Tested by

no test coverage detected