MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / DrawTexture

Method DrawTexture

Sources/Jazz2/UI/Menu/InGameMenu.cpp:460–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458 }
459
460 void InGameMenu::DrawTexture(const Texture& texture, float x, float y, std::uint16_t z, Alignment align, Vector2f size, const Colorf& color, bool unaligned)
461 {
462 Canvas* currentCanvas = GetActiveCanvas();
463 Vector2f adjustedPos = Canvas::ApplyAlignment(align, Vector2f(x, y), size);
464 if (!unaligned) {
465 adjustedPos.X = std::round(adjustedPos.X);
466 adjustedPos.Y = std::round(adjustedPos.Y);
467 }
468
469 currentCanvas->DrawTexture(texture, adjustedPos, z, size, Vector4f(1.0f, 0.0f, 1.0f, 0.0f), color);
470 }
471
472 Vector2f InGameMenu::MeasureString(StringView text, float scale, float charSpacing, float lineSpacing)
473 {

Callers 1

DrawElementMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected