DirectGraphics manager.
More...
#include <graphics.h>
|
| DGraphics (const GraphicsParam ¶m) |
|
| ~DGraphics () |
|
void | render () |
|
LRESULT | onSize (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) |
|
TextureResourcePtr | loadTexture (const wchar_t *path) |
| Load a texture. More...
|
|
void | drawTexture (const TextureResourcePtr &texture, int dx, int dy, bool lrInv=false, bool udInv=false, int sx=0, int sy=0, int sw=SrcSizeDefault, int sh=SrcSizeDefault, int cx=0, int cy=0, float angle=0.0f, float scaleX=1.0f, float scaleY=1.0f, float alpha=1.0f) |
| Draw texture. More...
|
|
FontResourcePtr | loadFont (const wchar_t *fontName, uint32_t startChar, uint32_t endChar, uint32_t w, uint32_t h) |
|
void | drawChar (const FontResourcePtr &font, wchar_t c, int dx, int dy, uint32_t color=0x000000, float scaleX=1.0f, float scaleY=1.0f, float alpha=1.0f, int *nextx=nullptr, int *nexty=nullptr) |
|
void | drawString (const FontResourcePtr &font, const wchar_t *str, int dx, int dy, uint32_t color=0x000000, int ajustX=0, float scaleX=1.0f, float scaleY=1.0f, float alpha=1.0f, int *nextx=nullptr, int *nexty=nullptr) |
| Draw string. More...
|
|
DirectGraphics manager.
Definition at line 80 of file graphics.h.
yappy::graphics::DGraphics::DGraphics |
( |
const GraphicsParam & |
param | ) |
|
|
explicit |
yappy::graphics::DGraphics::~DGraphics |
( |
| ) |
|
void yappy::graphics::DGraphics::drawChar |
( |
const FontResourcePtr & |
font, |
|
|
wchar_t |
c, |
|
|
int |
dx, |
|
|
int |
dy, |
|
|
uint32_t |
color = 0x000000 , |
|
|
float |
scaleX = 1.0f , |
|
|
float |
scaleY = 1.0f , |
|
|
float |
alpha = 1.0f , |
|
|
int * |
nextx = nullptr , |
|
|
int * |
nexty = nullptr |
|
) |
| |
void yappy::graphics::DGraphics::drawString |
( |
const FontResourcePtr & |
font, |
|
|
const wchar_t * |
str, |
|
|
int |
dx, |
|
|
int |
dy, |
|
|
uint32_t |
color = 0x000000 , |
|
|
int |
ajustX = 0 , |
|
|
float |
scaleX = 1.0f , |
|
|
float |
scaleY = 1.0f , |
|
|
float |
alpha = 1.0f , |
|
|
int * |
nextx = nullptr , |
|
|
int * |
nexty = nullptr |
|
) |
| |
Draw string.
- Parameters
-
[in] | font | font resource |
[in] | str | text to be drawn |
[in] | dx | destination X (center pos) |
[in] | dy | destination Y (center pos) |
[in] | color | text color (0xRRGGBB) |
[in] | ajustX | ajust char-to-char space |
[in] | scaleX | scaling factor X |
[in] | scaleY | scaling factor Y |
[in] | alpha | alpha value |
[in] | nextx | X of next column |
[in] | nexty | Y of next row |
Definition at line 644 of file graphics.cpp.
void yappy::graphics::DGraphics::drawTexture |
( |
const TextureResourcePtr & |
texture, |
|
|
int |
dx, |
|
|
int |
dy, |
|
|
bool |
lrInv = false , |
|
|
bool |
udInv = false , |
|
|
int |
sx = 0 , |
|
|
int |
sy = 0 , |
|
|
int |
sw = SrcSizeDefault , |
|
|
int |
sh = SrcSizeDefault , |
|
|
int |
cx = 0 , |
|
|
int |
cy = 0 , |
|
|
float |
angle = 0.0f , |
|
|
float |
scaleX = 1.0f , |
|
|
float |
scaleY = 1.0f , |
|
|
float |
alpha = 1.0f |
|
) |
| |
Draw texture.
- Parameters
-
[in] | texture | texture resource |
[in] | dx | destination X (center pos) |
[in] | dy | destination Y (center pos) |
[in] | lrInv | left-right invert |
[in] | udInv | up-down invert |
[in] | sx | source X |
[in] | sy | source Y |
[in] | sw | source width (texture size if SRC_SIZE_DEFAULT) |
[in] | sh | source height (texture size if SRC_SIZE_DEFAULT) |
[in] | cx | center X from (sx, sy) |
[in] | cy | center Y from (sx, sy) |
[in] | angle | rotation angle [rad] (using center pos) |
[in] | scaleX | size scaling factor X |
[in] | scaleY | size scaling factor Y |
[in] | alpha | alpha value |
Definition at line 504 of file graphics.cpp.
DGraphics::FontResourcePtr yappy::graphics::DGraphics::loadFont |
( |
const wchar_t * |
fontName, |
|
|
uint32_t |
startChar, |
|
|
uint32_t |
endChar, |
|
|
uint32_t |
w, |
|
|
uint32_t |
h |
|
) |
| |
LRESULT yappy::graphics::DGraphics::onSize |
( |
HWND |
hWnd, |
|
|
UINT |
msg, |
|
|
WPARAM |
wParam, |
|
|
LPARAM |
lParam |
|
) |
| |
void yappy::graphics::DGraphics::render |
( |
| ) |
|
const int yappy::graphics::DGraphics::SrcSizeDefault = -1 |
|
static |
Use texture size.
You can use cw, ch in drawTexture().
Definition at line 90 of file graphics.h.
The documentation for this class was generated from the following files: