for reading texture parameters from strings like "texture/whitedot.png:10 10 10 10", "texture/whitedot.png;0 0 64 64:10 10 10 10"
More...
#include <TextureParams.h>
|
int | m_left |
|
int | m_top |
|
int | m_right |
|
int | m_bottom |
|
int | m_toLeft |
|
int | m_toTop |
|
int | m_toRight |
|
int | m_toBottom |
|
TextureEntity * | m_pTexture |
|
|
void | DrawNineTileTexture (CPainter *painter, int x, int y, int w, int h, const RECT *rcTextures) |
|
void | DrawSingleTexture (CPainter *painter, int x, int y, int w, int h, const RECT &rc) |
|
for reading texture parameters from strings like "texture/whitedot.png:10 10 10 10", "texture/whitedot.png;0 0 64 64:10 10 10 10"
§ drawTexture()
void ParaEngine::TextureParams::drawTexture |
( |
CPainter * |
painter, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h, |
|
|
const RECT * |
rcTextures = NULL , |
|
|
int |
nCount = -1 |
|
) |
| |
draw texture to given target.
this is a helper function.
- Parameters
-
rcTextures | if NULL, it will use GetImageRects(). |
nCount | 1 or 9 depending on the texture type. -1 means automatic and only valid if rcTextures is NULL. |
§ GetImageRects()
int ParaEngine::TextureParams::GetImageRects |
( |
RECT * |
rcTextures | ) |
|
return all image rects
- Parameters
-
rcTextures | pass in pointer of RECT[9]. |
- Returns
- 0, 1 or 9 depending on the texture type. 0 means image rect is not determined.
§ HasSubRegion()
bool ParaEngine::TextureParams::HasSubRegion |
( |
| ) |
|
|
inline |
if a sub region of the original image should be used.
§ Init()
void ParaEngine::TextureParams::Init |
( |
const char * |
str | ) |
|
- Parameters
-
str | can be filename[; left top width height][:left top toright to bottom], such as "texture/whitedot.png", "texture/whitedot.png;0 0 64 64", "texture/whitedot.png:10 10 10 10", "texture/whitedot.png;0 0 64 64:10 10 10 10" [:left top toright to bottom] is used to specify the inner rect of the center tile in a nine texture element UI object |
§ IsNineTileTexture()
bool ParaEngine::TextureParams::IsNineTileTexture |
( |
| ) |
|
|
inline |
whether it is nine tile image.
The documentation for this class was generated from the following files:
- Client/trunk/ParaEngineClient/2dengine/TextureParams.h
- Client/trunk/ParaEngineClient/2dengine/TextureParams.cpp