QtCraft API C++ classes QML types Handbook

QcSignTextMesher Namespace

The text on signs (decision E-766) as quads of the entity mesh: one quad per character, cut from the pixel font's pages in the texture atlas (QcPixelFont), on the front of the board in the ink of the text's colour (QcSignText::inkOf; dark by default, a dye's tone after decision E-830). More...

Header: #include <clientcore/entitymeshes/QcSignTextMesher.h>

Classes

struct Face

Types

Quad

Variables

const int lineStep
const int maxLineWidth
const double pixelsPerMetre

Functions

std::optional<QcSignTextMesher::Face> faceOf(const QcContentRegistry &content, QcBlockId block, QcBlockPos pos)
std::vector<QcSignTextMesher::Quad> textQuads(const QcSignTextMesher::Face &face, const QcSignText::Text &text, QcEntityLight light, const QcEntityMesher::UvLookup &uv)

Detailed Description

Lines are centred; a line wider than the board is narrowed to fit. QcSignTextCache keeps the quads of each sign until its text, block or light changes.

Classes

class Face

The front of a sign's board: the middle of the text, the direction to the right of a reader, and the direction the front faces (up is +y). More...

Type Documentation

[alias] QcSignTextMesher::Quad

One quad of the entity mesh.

Variable Documentation

const int QcSignTextMesher::lineStep

Pixels from one line to the next (7 for the glyphs, 3 between).

const int QcSignTextMesher::maxLineWidth

Width of the text on a board at most, in font pixels.

const double QcSignTextMesher::pixelsPerMetre

Font pixels per metre on a sign: 15 wide glyphs fill most of a board of 1 m.

Function Documentation

std::optional<QcSignTextMesher::Face> QcSignTextMesher::faceOf(const QcContentRegistry &content, QcBlockId block, QcBlockPos pos)

Returns the front of the sign block block at pos (standing: its rotation in sixteenths of a turn; on a wall: the block it hangs on); std::nullopt for blocks of content that are no signs.

std::vector<QcSignTextMesher::Quad> QcSignTextMesher::textQuads(const QcSignTextMesher::Face &face, const QcSignText::Text &text, QcEntityLight light, const QcEntityMesher::UvLookup &uv)

Returns the quads of the lines of text on face, in its colour and in light, cut from the font pages by uv.