OChess v0.0.2
Programmer's Manual
Theme Class Reference

The in memory board theme (used by BoardCanvas) More...

#include <Theme.hpp>

Public Member Functions

 Theme (std::string piece, std::string square)
 Create piece using two png file path.
 
void LoadPiecesSkin (wxImage skin)
 Load piece skin image (break image tile into individual pieces)
 
void LoadSquaresSkin (wxImage iskin)
 Load square skin image (break the 2 square tiles into individual squares)
 
void ResizePieces (std::uint32_t width)
 Set pieces width.
 
void ResizeSquares (std::uint32_t width)
 Set squares width.
 
void ResizeSquaresAndPieces (std::uint32_t width)
 Set square width and adjust piece size accordingly.
 
void SetSquareRadius (std::uint8_t radius)
 Having rounded corners on squares.
 
std::uint8_t GetSquareRadius ()
 
bool Zoom (int amount)
 
double GetPiecesSizes ()
 
double GetSquaresSizes ()
 
wxBitmap * Get (char c)
 Get bitmap of an element. More...
 

Private Member Functions

wxMask * RoundedMask (std::uint32_t width, std::uint8_t corner)
 

Private Attributes

std::unordered_map< char, wxImage > skin
 
std::unordered_map< char, wxBitmap * > skin_scaled
 
std::uint8_t square_radius
 

Detailed Description

The in memory board theme (used by BoardCanvas)

Member Function Documentation

◆ Get()

wxBitmap * Theme::Get ( char  c)

Get bitmap of an element.

Parameters
cFor black pieces rnbkqp for white pieces RNBKQP and # for mate symbol and s for black square and S for white square
Returns
wxBitmap*

◆ GetPiecesSizes()

double Theme::GetPiecesSizes ( )

This will never fail since k entry always exists (cf constructor and ResizePieces)

◆ GetSquaresSizes()

double Theme::GetSquaresSizes ( )

This will never fail since s entry always exists (cf constructor and ResizeSquares)


The documentation for this class was generated from the following files: