On this page
  1. texture, sheet, source
  2. left, top, right, bottom, slice_scale
  3. Picture
  4. empty
  5. size
  6. sliced

rmp::ui::Picture

struct #include <rmp/ui.h> include/rmp/ui.h:181
struct Picture

Anything rmp::ui can show. See above.

texture, sheet, source

rmp::Texture texture
rmp::SpriteSheet sheet
Rectangle source{}

The pixels, and the part of them that is this picture. Normally you do not set these yourself: one of the constructors below does.

texture: A loose texture

sheet: Or an Aseprite sheet, which owns its texture

source: {0,0,0,0} = the whole texture

left, top, right, bottom, slice_scale

float left = 0
float top = 0
float right = 0
float bottom = 0
float slice_scale = 0

Nine-slice margins, in source pixels, and the size of one source pixel in design units (0 = 1). All four 0: the picture simply stretches.

Picture

Picture(rmp::Texture whole)
Picture(rmp::Texture atlas, Rectangle part)
Picture(const rmp::Sprite &sprite)
Picture(const NineSlice &nine)

The whole texture.

empty

bool empty() const

True when there is nothing to draw: no texture, or one that did not load.

size

Vector2 size() const

The size of the picture in source pixels: its part, or the whole texture.

sliced

bool sliced() const

True when it has nine-slice margins.