ShitEngine
基于 C++20 与 SDL3 的轻量级 2D 游戏引擎
载入中...
搜索中...
未找到
Sprite类 参考final

精灵数据,描述"画什么" 更多...

#include <Sprite.h>

Public 成员函数

 Sprite ()
 Sprite (const std::string &texturePath, const std::optional< SDL_FRect > &sourceRect=std::nullopt, bool flipped=false)
const std::string & getTexturePath () const
const std::optional< SDL_FRect > & getSourceRect () const
bool isFlipped () const
void setTexturePath (const std::string &texturePath)
void setSourceRect (const std::optional< SDL_FRect > &rect)
void setFlipped (bool flipped)
void setFrame (const SpriteSheet &sheet, int frameIndex)
 SpriteSheet 中取第 frameIndex 帧作为源矩形

详细描述

精灵数据,描述"画什么"

构造及析构函数说明

◆ Sprite() [1/2]

Sprite ( )

◆ Sprite() [2/2]

Sprite ( const std::string & texturePath,
const std::optional< SDL_FRect > & sourceRect = std::nullopt,
bool flipped = false )
inline

成员函数说明

◆ getSourceRect()

const std::optional< SDL_FRect > & getSourceRect ( ) const
inline

◆ getTexturePath()

const std::string & getTexturePath ( ) const
inline

◆ isFlipped()

bool isFlipped ( ) const
inline

◆ setFlipped()

void setFlipped ( bool flipped)
inline

◆ setFrame()

void setFrame ( const SpriteSheet & sheet,
int frameIndex )

SpriteSheet 中取第 frameIndex 帧作为源矩形

◆ setSourceRect()

void setSourceRect ( const std::optional< SDL_FRect > & rect)
inline

◆ setTexturePath()

void setTexturePath ( const std::string & texturePath)
inline

该类的文档由以下文件生成: