MaterialGroup class Materials
A set of materials that one value is pushed to at once.
A member that does not declare the name, or declares it with a different type, is skipped, so one group can span a heterogeneous set (every enemy, prop, and tower in a blast radius) without a partial write, unlike MaterialParameters, which throws on an unknown name or a type mismatch.
Constructors
-
MaterialGroup([Iterable<
PreprocessedMaterial> materials = const []]) -
Groups
materials, or none, to be added later. - MaterialGroup.of(Node root)
-
Every PreprocessedMaterial reachable from
root's subtree.factory
Properties
Methods
-
add(
PreprocessedMaterial material) → void -
Adds
materialto the group. -
clear(
) → void - Removes every material from the group.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
PreprocessedMaterial material) → bool -
Removes
materialfrom the group. Returns whether it was present. -
setColor(
String name, Color color) → void -
Sets a color parameter named
nameon every member that declares it. -
setFloat(
String name, double value) → void -
Sets a float parameter named
nameon every member that declares it. -
setInt(
String name, int value) → void -
Sets an int parameter named
nameon every member that declares it. -
setMat4(
String name, Matrix4 value) → void -
Sets a mat4 parameter named
nameon every member that declares it. -
setTexture(
String name, Texture texture, {SamplerOptions? sampler}) → void -
Sets a sampler parameter named
nameon every member that declares it. -
setVec2(
String name, Vector2 value) → void -
Sets a vec2 parameter named
nameon every member that declares it. -
setVec3(
String name, Vector3 value) → void -
Sets a vec3 parameter named
nameon every member that declares it. -
setVec4(
String name, Vector4 value) → void -
Sets a vec4 parameter named
nameon every member that declares it. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited