QtCraft API C++ classes QML types Handbook

QcPaintingMotif Struct

One picture a painting can show (decision E-791): its size in blocks and its texture. More...

Header: #include <common/content/blockbehaviour/QcHangingDefinition.h>

Public Functions

void nameTiles()
const QString &tileTexture(int column, int row) const

Public Variables

int height
QString name
QString texture
QList<QString> tiles
int width

Static Public Members

const int maxSide
QString tileName(const QString &texture, int column, int row)
enum class QcHangingType { ItemFrame, Painting }
const int qcHangingTypeCount

Detailed Description

A texture larger than one block is one procedural texture with tiles (QcContentParser::textureTiles), drawn block by block from the tiles "<texture>_<column>_<row>" (column 0 at the left, row 0 at the top as seen from the front).

Member Function Documentation

void QcPaintingMotif::nameTiles()

Names the block textures once from the texture and the size; whoever makes a motif calls it (parser, item serializer), so drawing builds no names.

[static] QString QcPaintingMotif::tileName(const QString &texture, int column, int row)

Returns the name of the block texture in column and row of the procedural texture.

const QString &QcPaintingMotif::tileTexture(int column, int row) const

Returns the texture of the block in column and row; the texture itself for a motif of one block.

Member Variable Documentation

int QcPaintingMotif::height

Height in blocks ("height", 1 to maxSide).

const int QcPaintingMotif::maxSide

Paintings are at most this many blocks wide and high.

QString QcPaintingMotif::name

Name of the motif, unique within its item ("name").

QString QcPaintingMotif::texture

Texture of the motif ("texture"); with tiles for a motif larger than one block.

QList<QString> QcPaintingMotif::tiles

The names of the block textures, row by row (nameTiles()); empty for a motif of one block.

int QcPaintingMotif::width

Width in blocks ("width", 1 to maxSide).

Related Non-Members

enum class QcHangingType

What an item hung on a block face becomes (decision E-790): an item frame, which holds one item it shows turned in eighths, or a painting, which shows one of its item's motifs.

ConstantValueDescription
QcPaintingMotif::QcHangingType::ItemFrame0An item frame (\c {"type": "item_frame"}).
QcPaintingMotif::QcHangingType::Painting1A painting (\c {"type": "painting"}).

const int qcHangingTypeCount

Number of values of QcHangingType.