实体
精灵 CSprite2d
2D 贴图矩形与进度条
CSprite2d.h
2D 贴图矩形。画在 drawingEvent;先 CTxdStore::SetCurrentTxd 再 SetTexture。
设贴图
SetTexture / Delete
void SetTexture(char* name);
void SetTexture(char* name, char* maskName);
void Delete();
RwTexture* m_pTexture;画精灵
Draw
多种重载:xywh、CRect、四角 UV、四角色。
void Draw(float x, float y, float width, float height, CRGBA const& color);
void Draw(CRect const& posn, CRGBA const& color);
void Draw(CRect const& posn, CRGBA const& color, float u1, float v1, float u2, float v2, float u3, float v3, float u4, float v4);
void Draw(CRect const& posn, CRGBA const& color1, CRGBA const& color2, CRGBA const& color3, CRGBA const& color4);纯色矩形
DrawRect / DrawRectXLU
static void DrawRect(CRect const& posn, CRGBA const& color);
static void DrawRect(CRect const& posn, CRGBA const& color1, CRGBA const& color2, CRGBA const& color3, CRGBA const& color4);
static void DrawRectXLU(CRect const& posn, CRGBA const& color1, CRGBA const& color2, CRGBA const& color3, CRGBA const& color4);
static void DrawAnyRect(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, CRGBA const& color1, CRGBA const& color2, CRGBA const& color3, CRGBA const& color4);进度条
DrawBarChart
progress 0..100。
static void DrawBarChart(float x, float y, unsigned short width, unsigned char height, float progress,
signed char progressAdd, unsigned char drawPercentage, unsigned char drawBlackBorder, CRGBA color, CRGBA addColor);渲染状态
SetRenderState / DrawTxRect
部分静态 Draw 需先设。
void SetRenderState();
static void DrawTxRect(CRect const& posn, CRGBA const& color);寻址模式
SetAddressing / SetAddressingUV
void SetAddressing(RwTextureAddressMode modeUV);
void SetAddressingUV(RwTextureAddressMode modeU, RwTextureAddressMode modeV);坐标换算用 Screen。批量资源可用 SpriteLoader。