Default renderable entity for declarative 2D sprites / solid quads. 更多...
#include <RenderSystem.h>
类 | |
| struct | Sprite |
| struct | Transform2D |
| Transform2D public API. 更多... | |
Public 成员函数 | |
| void | release () override |
| Entity. | |
| void | setPosition (float x, float y) |
| Set world-space position in pixels. | |
| float | getX () |
| Return world-space X position. | |
| float | getY () |
| Return world-space Y position. | |
| void | setRotation (float degrees) |
| Set center rotation in degrees. | |
| float | getRotation () |
| Return center rotation in degrees. | |
| void | setScale (float sx, float sy) |
| Set independent X/Y scale. | |
| float | getScaleX () |
| Return X scale. | |
| float | getScaleY () |
| Return Y scale. | |
| void | setSize (float width, float height) |
| Set unscaled sprite dimensions in pixels. | |
| float | getWidth () |
| Return unscaled width. | |
| float | getHeight () |
| Return unscaled height. | |
| void | setTexture (Texture *texture) |
| Assign the borrowed sprite texture. | |
| Texture * | getTexture () |
| Return the assigned texture. | |
| void | setNormalTexture (Texture *texture) |
| Assign an optional tangent-space normal map for the GPU lit2d path. | |
| Texture * | getNormalTexture () |
Return the assigned normal map, or nullptr when unlit/flat. @ownership Returns a borrowed Texture*; the caller must not delete it. @lifetime Valid until setNormalTexture replaces or clears it, or the sprite is destroyed. | |
| void | setQuad (Quad *quad) |
| Assign the borrowed UV quad. | |
| Quad * | getQuad () |
| Return the assigned UV quad. | |
| void | setColor (float r, float g, float b, float a=1.f) |
| Set RGBA tint. | |
| void | setLayer (int layer) |
| Set integer painter-order layer. | |
| int | getLayer () |
| Return painter-order layer. | |
| void | setVisible (bool visible) |
| Include or exclude the sprite from collection. | |
| bool | getVisible () |
| Return whether the sprite is visible. | |
| void | setReceiveLight (bool receive) |
| Enable or disable 2D light reception. | |
| bool | getReceiveLight () |
| Return whether the sprite receives 2D lights. | |
| void | setBlend (const std::string &blend) |
Set blend mode (alpha or additive). | |
| std::string | getBlend () |
| Return blend mode name. | |
| void | setAnchor (float x, float y) |
| Set normalized transform pivot; (0,0) top-left, (0.5,0.5) center. | |
| float | getAnchorX () |
| Return normalized horizontal pivot. | |
| float | getAnchorY () |
| Return normalized vertical pivot. | |
| void | setFlip (bool horizontal, bool vertical) |
| Mirror atlas UVs without changing transform scale. | |
| bool | getFlipX () |
| Return horizontal mirror state. | |
| bool | getFlipY () |
| Return vertical mirror state. | |
| void | setFrameLayout (int sourceW, int sourceH, int trimW, int trimH, int offsetX, int offsetY) |
| Apply trimmed-frame layout while preserving the original canvas origin. | |
| void | setCastOcclusion (bool cast) |
| Enable or disable volumetric occlusion casting. | |
| bool | getCastOcclusion () |
| Return whether the sprite casts volumetric occlusion. | |
详细描述
Default renderable entity for declarative 2D sprites / solid quads.
在文件 RenderSystem.h 第 71 行定义.
成员函数说明
◆ getAnchorX()
| float eve::graphics::Renderable2D::getAnchorX | ( | ) |
Return normalized horizontal pivot.
在文件 RenderSystem.cpp 第 83 行定义.
◆ getAnchorY()
| float eve::graphics::Renderable2D::getAnchorY | ( | ) |
Return normalized vertical pivot.
在文件 RenderSystem.cpp 第 84 行定义.
◆ getBlend()
| std::string eve::graphics::Renderable2D::getBlend | ( | ) |
Return blend mode name.
在文件 RenderSystem.cpp 第 70 行定义.
引用了 eve::Additive, blend, eve::Multiply, eve::Opaque , 以及 eve::Premultiplied.
◆ getCastOcclusion()
| bool eve::graphics::Renderable2D::getCastOcclusion | ( | ) |
Return whether the sprite casts volumetric occlusion.
在文件 RenderSystem.cpp 第 144 行定义.
◆ getFlipX()
| bool eve::graphics::Renderable2D::getFlipX | ( | ) |
Return horizontal mirror state.
在文件 RenderSystem.cpp 第 89 行定义.
◆ getFlipY()
| bool eve::graphics::Renderable2D::getFlipY | ( | ) |
Return vertical mirror state.
在文件 RenderSystem.cpp 第 90 行定义.
◆ getHeight()
| float eve::graphics::Renderable2D::getHeight | ( | ) |
Return unscaled height.
在文件 RenderSystem.cpp 第 41 行定义.
◆ getLayer()
| int eve::graphics::Renderable2D::getLayer | ( | ) |
Return painter-order layer.
在文件 RenderSystem.cpp 第 55 行定义.
◆ getNormalTexture()
| Texture * eve::graphics::Renderable2D::getNormalTexture | ( | ) |
Return the assigned normal map, or nullptr when unlit/flat. @ownership Returns a borrowed Texture*; the caller must not delete it. @lifetime Valid until setNormalTexture replaces or clears it, or the sprite is destroyed.
在文件 RenderSystem.cpp 第 45 行定义.
◆ getQuad()
| Quad * eve::graphics::Renderable2D::getQuad | ( | ) |
Return the assigned UV quad.
在文件 RenderSystem.cpp 第 47 行定义.
◆ getReceiveLight()
| bool eve::graphics::Renderable2D::getReceiveLight | ( | ) |
Return whether the sprite receives 2D lights.
在文件 RenderSystem.cpp 第 59 行定义.
◆ getRotation()
| float eve::graphics::Renderable2D::getRotation | ( | ) |
Return center rotation in degrees.
在文件 RenderSystem.cpp 第 27 行定义.
◆ getScaleX()
| float eve::graphics::Renderable2D::getScaleX | ( | ) |
Return X scale.
在文件 RenderSystem.cpp 第 32 行定义.
◆ getScaleY()
| float eve::graphics::Renderable2D::getScaleY | ( | ) |
Return Y scale.
在文件 RenderSystem.cpp 第 33 行定义.
◆ getTexture()
| Texture * eve::graphics::Renderable2D::getTexture | ( | ) |
Return the assigned texture.
在文件 RenderSystem.cpp 第 43 行定义.
◆ getVisible()
| bool eve::graphics::Renderable2D::getVisible | ( | ) |
Return whether the sprite is visible.
在文件 RenderSystem.cpp 第 57 行定义.
◆ getWidth()
| float eve::graphics::Renderable2D::getWidth | ( | ) |
Return unscaled width.
在文件 RenderSystem.cpp 第 40 行定义.
◆ getX()
| float eve::graphics::Renderable2D::getX | ( | ) |
Return world-space X position.
在文件 RenderSystem.cpp 第 24 行定义.
◆ getY()
| float eve::graphics::Renderable2D::getY | ( | ) |
Return world-space Y position.
在文件 RenderSystem.cpp 第 25 行定义.
◆ release()
|
override |
◆ setAnchor()
| void eve::graphics::Renderable2D::setAnchor | ( | float | x, |
| float | y | ||
| ) |
Set normalized transform pivot; (0,0) top-left, (0.5,0.5) center.
在文件 RenderSystem.cpp 第 79 行定义.
◆ setBlend()
| void eve::graphics::Renderable2D::setBlend | ( | const std::string & | blend | ) |
Set blend mode (alpha or additive).
在文件 RenderSystem.cpp 第 60 行定义.
引用了 eve::Additive, eve::Alpha, blend, eve::Multiply, eve::Opaque , 以及 eve::Premultiplied.
◆ setCastOcclusion()
| void eve::graphics::Renderable2D::setCastOcclusion | ( | bool | cast | ) |
Enable or disable volumetric occlusion casting.
在文件 RenderSystem.cpp 第 142 行定义.
◆ setColor()
| void eve::graphics::Renderable2D::setColor | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float | a = 1.f |
||
| ) |
Set RGBA tint.
在文件 RenderSystem.cpp 第 48 行定义.
◆ setFlip()
| void eve::graphics::Renderable2D::setFlip | ( | bool | horizontal, |
| bool | vertical | ||
| ) |
Mirror atlas UVs without changing transform scale.
在文件 RenderSystem.cpp 第 85 行定义.
◆ setFrameLayout()
| void eve::graphics::Renderable2D::setFrameLayout | ( | int | sourceW, |
| int | sourceH, | ||
| int | trimW, | ||
| int | trimH, | ||
| int | offsetX, | ||
| int | offsetY | ||
| ) |
Apply trimmed-frame layout while preserving the original canvas origin.
在文件 RenderSystem.cpp 第 91 行定义.
◆ setLayer()
| void eve::graphics::Renderable2D::setLayer | ( | int | layer | ) |
◆ setNormalTexture()
| void eve::graphics::Renderable2D::setNormalTexture | ( | Texture * | texture | ) |
Assign an optional tangent-space normal map for the GPU lit2d path.
- 参数
-
texture Borrowed normal map, or nullptr to clear. Non-null with receiveLight and an albedo texture (and no custom shader) selects lit2d; otherwise lighting falls back to CPU modulation. @ownership textureremains owned by the caller (typically Graphics); this sprite only borrows it and never deletes it. @lifetime Must remain valid while assigned, or until cleared / the sprite is destroyed.
在文件 RenderSystem.cpp 第 44 行定义.
◆ setPosition()
| void eve::graphics::Renderable2D::setPosition | ( | float | x, |
| float | y | ||
| ) |
◆ setQuad()
| void eve::graphics::Renderable2D::setQuad | ( | Quad * | quad | ) |
Assign the borrowed UV quad.
在文件 RenderSystem.cpp 第 46 行定义.
◆ setReceiveLight()
| void eve::graphics::Renderable2D::setReceiveLight | ( | bool | receive | ) |
Enable or disable 2D light reception.
在文件 RenderSystem.cpp 第 58 行定义.
◆ setRotation()
| void eve::graphics::Renderable2D::setRotation | ( | float | degrees | ) |
◆ setScale()
| void eve::graphics::Renderable2D::setScale | ( | float | sx, |
| float | sy | ||
| ) |
◆ setSize()
| void eve::graphics::Renderable2D::setSize | ( | float | width, |
| float | height | ||
| ) |
Set unscaled sprite dimensions in pixels.
在文件 RenderSystem.cpp 第 34 行定义.
被这些函数引用 eve::avatar::AvatarInstance::linkSceneNode() , 以及 setFrameLayout().
◆ setTexture()
| void eve::graphics::Renderable2D::setTexture | ( | Texture * | texture | ) |
Assign the borrowed sprite texture.
在文件 RenderSystem.cpp 第 42 行定义.
◆ setVisible()
| void eve::graphics::Renderable2D::setVisible | ( | bool | visible | ) |
该类的文档由以下文件生成:
- src/modules/graphics/RenderSystem.h
- src/modules/graphics/RenderSystem.cpp