MCPcopy Create free account
hub / github.com/axmolengine/axmol / initWithString

Method initWithString

core/renderer/Texture2D.cpp:470–494  ·  view source on GitHub ↗

implementation Texture2D (Text)

Source from the content-addressed store, hash-verified

468
469// implementation Texture2D (Text)
470bool Texture2D::initWithString(std::string_view text,
471 std::string_view fontName,
472 float fontSize,
473 const Vec2& dimensions /* = Vec2(0, 0)*/,
474 TextHAlignment hAlignment /* = TextHAlignment::CENTER */,
475 TextVAlignment vAlignment /* = TextVAlignment::TOP */,
476 bool enableWrap /* = false */,
477 int overflow /* = 0 */)
478{
479 FontDefinition tempDef;
480
481 tempDef._shadow._shadowEnabled = false;
482 tempDef._stroke._strokeEnabled = false;
483
484 tempDef._fontName = fontName;
485 tempDef._fontSize = fontSize;
486 tempDef._dimensions = dimensions;
487 tempDef._alignment = hAlignment;
488 tempDef._vertAlignment = vAlignment;
489 tempDef._fontFillColor = Color3B::WHITE;
490 tempDef._enableWrap = enableWrap;
491 tempDef._overflow = overflow;
492
493 return initWithString(text, tempDef);
494}
495
496bool Texture2D::initWithString(std::string_view text, const FontDefinition& textDefinition)
497{

Callers 1

reloadAllTexturesMethod · 0.45

Calls 9

getInstanceFunction · 0.85
convertDataToFormatFunction · 0.85
initWithDataFunction · 0.85
isNullMethod · 0.80
getMaxTextureSizeMethod · 0.80
getBytesMethod · 0.80
Vec2Function · 0.50
freeFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected