stmm-games-doc  0.32.0
Public Member Functions | Public Attributes | List of all members
stmg::Frame Class Reference

Frame of images. More...

Public Member Functions

void draw (const Cairo::RefPtr< Cairo::Context > &refCc, int32_t nPixX, int32_t nPixY, int32_t nPixW, int32_t nPixH) const noexcept
 Draw frame in a given area using the minimum frame sizes. More...
 
void draw (const Cairo::RefPtr< Cairo::Context > &refCc, int32_t nPixX, int32_t nPixY, int32_t nPixW, int32_t nPixH, int32_t nPixFrameTop, int32_t nPixFrameBottom, int32_t nPixFrameLeft, int32_t nPixFrameRight) const noexcept
 Draw frame in a given area with minimal margin sizes. More...
 

Public Attributes

int32_t m_nPixMinTop = 0
 Top margin in pixels. More...
 
int32_t m_nPixMinBottom = 0
 Bottom margin in pixels. More...
 
int32_t m_nPixMinLeft = 0
 Left margin in pixels. More...
 
int32_t m_nPixMinRight = 0
 Right margin in pixels. More...
 
shared_ptr< Imagem_refBaseImg
 The "bakground" image, all other images are on top of it. More...
 
shared_ptr< Imagem_refTopLeftImg
 Can be null. More...
 
shared_ptr< Imagem_refTopImg
 Can be null. More...
 
shared_ptr< Imagem_refTopRightImg
 < Can be null. More...
 
shared_ptr< Imagem_refLeftImg
 Can be null. More...
 
shared_ptr< Imagem_refCenterImg
 Can be null. More...
 
shared_ptr< Imagem_refRightImg
 Can be null. More...
 
shared_ptr< Imagem_refBottomLeftImg
 Can be null. More...
 
shared_ptr< Imagem_refBottomImg
 Can be null. More...
 
shared_ptr< Imagem_refBottomRightImg
 Can be null. More...
 

Detailed Description

Frame of images.

Example: given a rectangle of size 14 x 7 pixels nPixFrameTop = 1 nPixFrameBottom = 2 nPixFrameLeft = 2 nPixFrameRight = 3

AABBBBBBBBBCCC DDeeeeeeeeeFFF DDeeeeeeeeeFFF DDeeeeeeeeeFFF DDeeeeeeeeeFFF GGHHHHHHHHHIII GGHHHHHHHHHIII

A: pixels painted by m_refTopLeftImg B: pixels painted by m_refTopImg C: pixels painted by m_refTopRightImg D: pixels painted by m_refLeftImg e: pixels painted by m_refCenterImg F: pixels painted by m_refRightImg G: pixels painted by m_refBottomLeftImg H: pixels painted by m_refBottomImg I: pixels painted by m_refBottomRightImg

Member Function Documentation

◆ draw() [1/2]

void stmg::Frame::draw ( const Cairo::RefPtr< Cairo::Context > &  refCc,
int32_t  nPixX,
int32_t  nPixY,
int32_t  nPixW,
int32_t  nPixH 
) const
noexcept

Draw frame in a given area using the minimum frame sizes.

Parameters
refCcThe context. Cannot be null.
nPixXThe area x in pixels.
nPixYThe area y in pixels.
nPixWThe area width in pixels. Must be positive.
nPixHThe area height in pixels. Must be positive.

◆ draw() [2/2]

void stmg::Frame::draw ( const Cairo::RefPtr< Cairo::Context > &  refCc,
int32_t  nPixX,
int32_t  nPixY,
int32_t  nPixW,
int32_t  nPixH,
int32_t  nPixFrameTop,
int32_t  nPixFrameBottom,
int32_t  nPixFrameLeft,
int32_t  nPixFrameRight 
) const
noexcept

Draw frame in a given area with minimal margin sizes.

Parameters
refCcThe context. Cannot be null.
nPixXThe area x in pixels.
nPixYThe area y in pixels.
nPixWThe area width in pixels. Must be positive.
nPixHThe area height in pixels. Must be positive.
nPixFrameTopTop margin size in pixels. Cannnot be negative. If < m_nPixMinTop, m_nPixMinTop is used.
nPixFrameBottomBottom margin size in pixels. Cannnot be negative. If < m_nPixMinBottom, m_nPixMinBottom is used.
nPixFrameLeftLeft margin size in pixels. Cannnot be negative. If < m_nPixMinLeft, m_nPixMinLeft is used.
nPixFrameRightRight margin size in pixels. Cannnot be negative. If < m_nPixMinRight, m_nPixMinRight is used.

Member Data Documentation

◆ m_nPixMinBottom

int32_t stmg::Frame::m_nPixMinBottom = 0

Bottom margin in pixels.

Default: 0.

◆ m_nPixMinLeft

int32_t stmg::Frame::m_nPixMinLeft = 0

Left margin in pixels.

Default: 0.

◆ m_nPixMinRight

int32_t stmg::Frame::m_nPixMinRight = 0

Right margin in pixels.

Default: 0.

◆ m_nPixMinTop

int32_t stmg::Frame::m_nPixMinTop = 0

Top margin in pixels.

Default: 0.

◆ m_refBaseImg

shared_ptr<Image> stmg::Frame::m_refBaseImg

The "bakground" image, all other images are on top of it.

Covers the whole rectangle. Can be null.

◆ m_refBottomImg

shared_ptr<Image> stmg::Frame::m_refBottomImg

Can be null.

◆ m_refBottomLeftImg

shared_ptr<Image> stmg::Frame::m_refBottomLeftImg

Can be null.

◆ m_refBottomRightImg

shared_ptr<Image> stmg::Frame::m_refBottomRightImg

Can be null.

◆ m_refCenterImg

shared_ptr<Image> stmg::Frame::m_refCenterImg

Can be null.

◆ m_refLeftImg

shared_ptr<Image> stmg::Frame::m_refLeftImg

Can be null.

◆ m_refRightImg

shared_ptr<Image> stmg::Frame::m_refRightImg

Can be null.

◆ m_refTopImg

shared_ptr<Image> stmg::Frame::m_refTopImg

Can be null.

◆ m_refTopLeftImg

shared_ptr<Image> stmg::Frame::m_refTopLeftImg

Can be null.

◆ m_refTopRightImg

shared_ptr<Image> stmg::Frame::m_refTopRightImg

< Can be null.