载入中...
搜索中...
未找到
eve::spritestack::SpriteStack2D类 参考

Pure-2D sprite stack made from horizontal RGBA cross-sections. 更多...

#include <SpriteStack.h>

Public 成员函数

 SpriteStack2D ()=default
 Sprite stack 2 d.
 
 SpriteStack2D (const SpriteStack2D &)=delete
 
SpriteStack2D & operator= (const SpriteStack2D &)=delete
 
void setLayerCount (int count)
 Sets the layer count.
 
int getLayerCount () const
 Returns the layer count.
 
void setLayerTexture (graphics::Texture *texture, int index)
 Sets the layer texture.
 
graphics::Texture * getLayerTexture (int index) const
 Returns the layer texture.
 
void setLayerImage (graphics::Graphics *gfx, image::ImageData *img, int index)
 Sets the layer image.
 
void setLayerFile (graphics::Graphics *gfx, const std::string &path, int index)
 Sets the layer file.
 
void setLayersFromAtlas (graphics::Graphics *gfx, graphics::Texture *atlas, int layerCount)
 Sets the layers from atlas.
 
void setThickness (float thickness)
 Upward 2D offset between adjacent layers.
 
float getThickness () const
 Returns the thickness.
 
void setSize (float width, float height)
 Display size of every layer in 2D units.
 
float getWidth () const
 Returns the width.
 
float getHeight () const
 Returns the height.
 
void setPosition (float x, float y)
 Sets the position.
 
void setRotation (float degrees)
 Rotate every slice around its common 2D center, in degrees.
 
void setTint (float r, float g, float b, float a=1.f)
 Sets the tint.
 
void setVisible (bool visible)
 Sets the visible.
 
bool getVisible () const
 Returns the visible.
 
void setShadowEnabled (bool enabled)
 Draw a cheap 2D contact shadow behind the stack.
 
bool getShadowEnabled () const
 Returns the shadow enabled.
 
void setShadowOpacity (float opacity)
 Sets the shadow opacity.
 
void setShadowOffset (float x, float y)
 Sets the shadow offset.
 
void setOutline (float width, float r=0.f, float g=0.f, float b=0.f)
 Draw enlarged dark copies behind the layers.
 
float getOutlineWidth () const
 Returns the outline width.
 
void setOutlineColor (float r, float g, float b)
 Sets the outline color.
 
uint64_t getVersion () const
 Returns the version.
 
void render (graphics::Graphics *gfx) const
 Queue the stack into Graphics' normal 2D renderer.
 
void renderWithCamera (graphics::Graphics *gfx, graphics::Camera2D *camera) const
 Renders with camera.
 

友元

class SpriteStackBatch
 

详细描述

Pure-2D sprite stack made from horizontal RGBA cross-sections.

Layers are drawn bottom-to-top through the normal 2D textured-quad path. Each higher layer is offset upward by thickness 2D units. Rotation is applied in the 2D plane; no Camera3D, depth buffer, G-buffer, mesh, or 3D pass is used.

在文件 SpriteStack.h 第 61 行定义.

构造及析构函数说明

◆ SpriteStack2D() [1/2]

eve::spritestack::SpriteStack2D::SpriteStack2D ( )
default

Sprite stack 2 d.

◆ SpriteStack2D() [2/2]

eve::spritestack::SpriteStack2D::SpriteStack2D ( const SpriteStack2D &  )
delete

成员函数说明

◆ getHeight()

float eve::spritestack::SpriteStack2D::getHeight ( ) const

Returns the height.

在文件 SpriteStack2D.cpp 第 80 行定义.

◆ getLayerCount()

int eve::spritestack::SpriteStack2D::getLayerCount ( ) const

Returns the layer count.

在文件 SpriteStack2D.cpp 第 26 行定义.

◆ getLayerTexture()

graphics::Texture * eve::spritestack::SpriteStack2D::getLayerTexture ( int  index) const

Returns the layer texture.

在文件 SpriteStack2D.cpp 第 36 行定义.

引用了 index.

◆ getOutlineWidth()

float eve::spritestack::SpriteStack2D::getOutlineWidth ( ) const

Returns the outline width.

在文件 SpriteStack2D.cpp 第 112 行定义.

◆ getShadowEnabled()

bool eve::spritestack::SpriteStack2D::getShadowEnabled ( ) const

Returns the shadow enabled.

在文件 SpriteStack2D.cpp 第 102 行定义.

◆ getThickness()

float eve::spritestack::SpriteStack2D::getThickness ( ) const

Returns the thickness.

在文件 SpriteStack2D.cpp 第 71 行定义.

◆ getVersion()

uint64_t eve::spritestack::SpriteStack2D::getVersion ( ) const
inline

Returns the version.

在文件 SpriteStack.h 第 117 行定义.

◆ getVisible()

bool eve::spritestack::SpriteStack2D::getVisible ( ) const

Returns the visible.

在文件 SpriteStack2D.cpp 第 99 行定义.

◆ getWidth()

float eve::spritestack::SpriteStack2D::getWidth ( ) const

Returns the width.

在文件 SpriteStack2D.cpp 第 79 行定义.

◆ operator=()

SpriteStack2D & eve::spritestack::SpriteStack2D::operator= ( const SpriteStack2D &  )
delete

◆ render()

void eve::spritestack::SpriteStack2D::render ( graphics::Graphics *  gfx) const

Queue the stack into Graphics' normal 2D renderer.

在文件 SpriteStack2D.cpp 第 165 行定义.

引用了 draw.

◆ renderWithCamera()

void eve::spritestack::SpriteStack2D::renderWithCamera ( graphics::Graphics *  gfx,
graphics::Camera2D *  camera 
) const

Renders with camera.

在文件 SpriteStack2D.cpp 第 169 行定义.

引用了 camera , 以及 draw.

◆ setLayerCount()

void eve::spritestack::SpriteStack2D::setLayerCount ( int  count)

Sets the layer count.

在文件 SpriteStack2D.cpp 第 19 行定义.

引用了 count.

被这些函数引用 setLayersFromAtlas().

◆ setLayerFile()

void eve::spritestack::SpriteStack2D::setLayerFile ( graphics::Graphics *  gfx,
const std::string &  path,
int  index 
)

Sets the layer file.

在文件 SpriteStack2D.cpp 第 47 行定义.

引用了 index, eve::graphics::Graphics::newTextureFromFile(), path , 以及 setLayerTexture().

◆ setLayerImage()

void eve::spritestack::SpriteStack2D::setLayerImage ( graphics::Graphics *  gfx,
image::ImageData *  img,
int  index 
)

Sets the layer image.

在文件 SpriteStack2D.cpp 第 41 行定义.

引用了 index, eve::graphics::Graphics::newTextureFromImageData() , 以及 setLayerTexture().

◆ setLayersFromAtlas()

void eve::spritestack::SpriteStack2D::setLayersFromAtlas ( graphics::Graphics *  gfx,
graphics::Texture *  atlas,
int  layerCount 
)

Sets the layers from atlas.

在文件 SpriteStack2D.cpp 第 52 行定义.

引用了 setLayerCount().

◆ setLayerTexture()

void eve::spritestack::SpriteStack2D::setLayerTexture ( graphics::Texture *  texture,
int  index 
)

Sets the layer texture.

在文件 SpriteStack2D.cpp 第 28 行定义.

引用了 index.

被这些函数引用 setLayerFile() , 以及 setLayerImage().

◆ setOutline()

void eve::spritestack::SpriteStack2D::setOutline ( float  width,
float  r = 0.f,
float  g = 0.f,
float  b = 0.f 
)

Draw enlarged dark copies behind the layers.

在文件 SpriteStack2D.cpp 第 108 行定义.

引用了 b, g, r, setOutlineColor() , 以及 width.

◆ setOutlineColor()

void eve::spritestack::SpriteStack2D::setOutlineColor ( float  r,
float  g,
float  b 
)

Sets the outline color.

在文件 SpriteStack2D.cpp 第 113 行定义.

引用了 b, g , 以及 r.

被这些函数引用 setOutline().

◆ setPosition()

void eve::spritestack::SpriteStack2D::setPosition ( float  x,
float  y 
)

Sets the position.

在文件 SpriteStack2D.cpp 第 82 行定义.

引用了 x , 以及 y.

◆ setRotation()

void eve::spritestack::SpriteStack2D::setRotation ( float  degrees)

Rotate every slice around its common 2D center, in degrees.

在文件 SpriteStack2D.cpp 第 87 行定义.

引用了 degrees.

◆ setShadowEnabled()

void eve::spritestack::SpriteStack2D::setShadowEnabled ( bool  enabled)

Draw a cheap 2D contact shadow behind the stack.

在文件 SpriteStack2D.cpp 第 101 行定义.

引用了 enabled.

◆ setShadowOffset()

void eve::spritestack::SpriteStack2D::setShadowOffset ( float  x,
float  y 
)

Sets the shadow offset.

在文件 SpriteStack2D.cpp 第 104 行定义.

引用了 x , 以及 y.

◆ setShadowOpacity()

void eve::spritestack::SpriteStack2D::setShadowOpacity ( float  opacity)

Sets the shadow opacity.

在文件 SpriteStack2D.cpp 第 103 行定义.

引用了 opacity.

◆ setSize()

void eve::spritestack::SpriteStack2D::setSize ( float  width,
float  height 
)

Display size of every layer in 2D units.

在文件 SpriteStack2D.cpp 第 73 行定义.

引用了 height , 以及 width.

◆ setThickness()

void eve::spritestack::SpriteStack2D::setThickness ( float  thickness)

Upward 2D offset between adjacent layers.

在文件 SpriteStack2D.cpp 第 66 行定义.

引用了 thickness.

◆ setTint()

void eve::spritestack::SpriteStack2D::setTint ( float  r,
float  g,
float  b,
float  a = 1.f 
)

Sets the tint.

在文件 SpriteStack2D.cpp 第 91 行定义.

引用了 a, b, g , 以及 r.

◆ setVisible()

void eve::spritestack::SpriteStack2D::setVisible ( bool  visible)

Sets the visible.

在文件 SpriteStack2D.cpp 第 98 行定义.

引用了 visible.

友元及相关函数文档

◆ SpriteStackBatch

friend class SpriteStackBatch
friend

在文件 SpriteStack.h 第 124 行定义.


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