载入中...
搜索中...
未找到
SpriteStack2D.cpp
浏览该文件的文档.
56 if (layerCount <= 0) throw eve::Exception("SpriteStack2D.setLayersFromAtlas: count must be > 0");
74 if (width <= 0.f || height <= 0.f) throw eve::Exception("SpriteStack2D.setSize: size must be > 0");
169void SpriteStack2D::renderWithCamera(graphics::Graphics *gfx, graphics::Camera2D *camera) const {
187void SpriteStackBatch::renderWithCamera(graphics::Graphics *gfx, graphics::Camera2D *camera) const {
203std::vector<image::ImageData *> SpriteStack::slicePrimitive(const std::string &kind, int layerCount,
Definition Graphics.h:125
virtual void drawTexturedRectShaderUVRotated(Texture *texture, Shader *shader, float cx, float cy, float w, float h, float degrees, float u0, float v0, float u1, float v1, const Color &color, bool rotatedUV=false, BlendMode blend=BlendMode::Alpha)=0
UV draw rotated degrees clockwise (screen Y-down) around the rect center. texture may be null → solid...
Texture * newTextureFromImageData(image::ImageData *data, bool repeatU=false, bool repeatV=false)
Creates a texture from image data. @ownership Caller deletes unless documented otherwise.
Definition Graphics.cpp:1737
virtual Texture * newTextureFromFile(const std::string &filename)=0
Creates a texture from file. @ownership Caller deletes unless documented otherwise.
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
Pure-2D sprite stack made from horizontal RGBA cross-sections.
Definition SpriteStack.h:61
void setLayersFromAtlas(graphics::Graphics *gfx, graphics::Texture *atlas, int layerCount)
Sets the layers from atlas.
Definition SpriteStack2D.cpp:52
void setOutline(float width, float r=0.f, float g=0.f, float b=0.f)
Draw enlarged dark copies behind the layers.
Definition SpriteStack2D.cpp:108
void setThickness(float thickness)
Upward 2D offset between adjacent layers.
Definition SpriteStack2D.cpp:66
void render(graphics::Graphics *gfx) const
Queue the stack into Graphics' normal 2D renderer.
Definition SpriteStack2D.cpp:165
void renderWithCamera(graphics::Graphics *gfx, graphics::Camera2D *camera) const
Renders with camera.
Definition SpriteStack2D.cpp:169
void setShadowEnabled(bool enabled)
Draw a cheap 2D contact shadow behind the stack.
Definition SpriteStack2D.cpp:101
graphics::Texture * getLayerTexture(int index) const
Returns the layer texture.
Definition SpriteStack2D.cpp:36
void setOutlineColor(float r, float g, float b)
Sets the outline color.
Definition SpriteStack2D.cpp:113
void setRotation(float degrees)
Rotate every slice around its common 2D center, in degrees.
Definition SpriteStack2D.cpp:87
void setSize(float width, float height)
Display size of every layer in 2D units.
Definition SpriteStack2D.cpp:73
void setLayerImage(graphics::Graphics *gfx, image::ImageData *img, int index)
Sets the layer image.
Definition SpriteStack2D.cpp:41
void setLayerFile(graphics::Graphics *gfx, const std::string &path, int index)
Sets the layer file.
Definition SpriteStack2D.cpp:47
void setLayerTexture(graphics::Texture *texture, int index)
Sets the layer texture.
Definition SpriteStack2D.cpp:28
Collection of 2D stacks; Graphics performs texture batching.
Definition SpriteStack.h:143
void renderWithCamera(graphics::Graphics *gfx, graphics::Camera2D *camera) const
Renders with camera.
Definition SpriteStack2D.cpp:187
SpriteStack module: horizontal slice baking plus pure-2D rendering.
Definition SpriteStack.h:162
SpriteStackBatch * newBatch(graphics::Graphics *gfx)
Creates a batch. @ownership Caller deletes unless documented otherwise.
Definition SpriteStack2D.cpp:198
std::vector< image::ImageData * > slicePrimitive(const std::string &kind, int layerCount, int imageW, int imageH, const std::string &axis, float thickness)
Slice primitive.
Definition SpriteStack2D.cpp:203
SpriteStack2D * newStack(graphics::Graphics *gfx)
Creates a stack. @ownership Caller deletes unless documented otherwise.
Definition SpriteStack2D.cpp:194
eve::Color Color
RGBA color used by every graphics draw call. Lives inside eve::graphics so including a graphics heade...
Definition Color.h:13
Definition SpriteStackTarget.h:22
void exposeSpriteStackModelBindings(ssq::Class &cls)
Register sliceModel when SpriteStackModel.cpp is linked (model3d on).
Definition SpriteStackModel.cpp:69
std::vector< image::ImageData * > slicePrimitiveToLayers(const std::string &kind, const SliceOptions &opt)
Slice primitive to layers.
Definition SpriteStack.cpp:332
Options for baking a mesh into equal-sized RGBA sprite layers.
Definition SpriteStack.h:36