Polygon¶
Inherits: UILayout
C++ type: Polygon
Polygon API exposed to Lua and C++ gameplay code.
Properties¶
| Name | Languages |
|---|---|
color |
C++ | Lua |
alpha |
C++ | Lua |
flipY |
C++ | Lua |
customShader |
C++ | Lua |
Methods¶
| Name | Languages |
|---|---|
addVertex |
C++ | Lua |
setColor |
C++ | Lua |
setTexture |
C++ | Lua |
getAABB |
C++ | Lua |
getWorldAABB |
C++ | Lua |
setShaderUniform |
C++ | Lua |
getShaderUniform |
C++ | Lua |
removeShaderUniform |
C++ | Lua |
Method details¶
customShader¶
- Setter:
void setCustomShader(const std::string& path) - Getter:
std::string getCustomShader() const
Project-relative base path of a forked shader ("shaders/glow" resolves to shaders/glow.vert and shaders/glow.frag, or "a.vert|b.frag" names the files separately). Empty (default) uses the scene default shader for this type, or the engine built-in. Changing it reloads the component. Same semantics as Mesh.customShader; see Custom Shaders.
setShaderUniform¶
void setShaderUniform(const std::string& name, const Vector4& value)void setShaderUniform(const std::string& name, const Vector3& value)void setShaderUniform(const std::string& name, const Vector2& value)void setShaderUniform(const std::string& name, float value)Vector4 getShaderUniform(const std::string& name) constbool removeShaderUniform(const std::string& name)
Values for the members of the custom shader's u_vs_customParams / u_fs_customParams blocks, by member name. Setting a value only rewrites the uploaded block, so it can run every frame; a member with no value reads zero, or the scene's value under a scene default shader, and time (seconds since startup) and resolution (render target size) are reserved for the engine. Same semantics as Mesh.setShaderUniform; see Custom Shaders — Shader uniforms.