Header menu logo Mibo

DrawableBuilder Type

Builder for creating individual Drawable objects. Used via the draw computation expression.

Example

 draw {
     mesh myMesh
     at 0f 2f 0f
     withAlbedo Color.Gold
     withMetallic 1.0f
 }

Constructors

Constructor Description

DrawableBuilder()

Full Usage: DrawableBuilder()

Returns: DrawableBuilder

Instance members

Instance member Description

at x y z

Full Usage: at x y z

Parameters:
    x : float32
    y : float32
    z : float32

Returns: DrawState
Modifiers: inline

Sets the local position using individual coordinates.

x : float32
y : float32
z : float32
Returns: DrawState

at position

Full Usage: at position

Parameters:
    position : Vector3 - The target position vector.

Returns: DrawState
Modifiers: inline

Sets the local position of the object.

position : Vector3

The target position vector.

Returns: DrawState

lookAt target

Full Usage: lookAt target

Parameters:
Returns: DrawState
Modifiers: inline

Orientates the object to face a target point in world space.

target : Vector3
Returns: DrawState

mesh mesh

Full Usage: mesh mesh

Parameters:
Returns: DrawState
Modifiers: inline

Assigns the geometric mesh to the object. Required for rendering.

mesh : Mesh
Returns: DrawState

offset offset

Full Usage: offset offset

Parameters:
Returns: DrawState
Modifiers: inline

Shifts the current local position by an offset vector.

offset : Vector3
Returns: DrawState

relativeTo parentTransform

Full Usage: relativeTo parentTransform

Parameters:
Returns: DrawState
Modifiers: inline

Sets a parent world matrix. The object's local transform will be concatenated with this matrix. Useful for hierarchical rendering (e.g., equipment attached to a character).

parentTransform : Matrix
Returns: DrawState

rotatedBy rotation

Full Usage: rotatedBy rotation

Parameters:
Returns: DrawState
Modifiers: inline

Multiplies the current local rotation by a quaternion.

rotation : Quaternion
Returns: DrawState

rotatedByYawPitchRoll yaw pitch roll

Full Usage: rotatedByYawPitchRoll yaw pitch roll

Parameters:
    yaw : float32 - Rotation around the Y-axis (radians).
    pitch : float32 - Rotation around the X-axis (radians).
    roll : float32 - Rotation around the Z-axis (radians).

Returns: DrawState
Modifiers: inline

Multiplies the current local rotation using Euler angles (Yaw, Pitch, Roll).

yaw : float32

Rotation around the Y-axis (radians).

pitch : float32

Rotation around the X-axis (radians).

roll : float32

Rotation around the Z-axis (radians).

Returns: DrawState

this.Run

Full Usage: this.Run

Parameters:
Returns: Drawable voption
Modifiers: inline

Finalizes the accumulation state into an optional Drawable.

state : DrawState
Returns: Drawable voption

scaledBy scale

Full Usage: scaledBy scale

Parameters:
    scale : float32

Returns: DrawState
Modifiers: inline

Multiplies the current local scale uniformly on all axes.

scale : float32
Returns: DrawState

scaledByVec scale

Full Usage: scaledByVec scale

Parameters:
Returns: DrawState
Modifiers: inline

Multiplies the current local scale using a vector for non-uniform scaling.

scale : Vector3
Returns: DrawState

withAlbedo color

Full Usage: withAlbedo color

Parameters:
Returns: DrawState
Modifiers: inline

Sets the Albedo (base diffuse) color tint.

color : Color
Returns: DrawState

withAlbedoMap texture

Full Usage: withAlbedoMap texture

Parameters:
Returns: DrawState
Modifiers: inline

Sets the Albedo (diffuse) texture.

texture : Texture2D
Returns: DrawState

withBones bones

Full Usage: withBones bones

Parameters:
Returns: DrawState
Modifiers: inline

Sets the bone transformation matrices for skinned mesh animation.

bones : Matrix[]
Returns: DrawState

withEffect effect

Full Usage: withEffect effect

Parameters:
Returns: DrawState
Modifiers: inline

Overrides the automatic PBR shader selection with a specific MonoGame Effect. Used for custom shaders like Cel-shading, Dissolve, etc.

effect : Effect
Returns: DrawState

withEmissive color intensity

Full Usage: withEmissive color intensity

Parameters:
    color : Color - The glow color.
    intensity : float32 - The brightness multiplier. Values > 1.0 will trigger bloom glow.

Returns: DrawState
Modifiers: inline

Configures emissive (glow) properties. Required for objects to contribute to the Bloom pass.

color : Color

The glow color.

intensity : float32

The brightness multiplier. Values > 1.0 will trigger bloom glow.

Returns: DrawState

withFlags flags

Full Usage: withFlags flags

Parameters:
Returns: DrawState
Modifiers: inline

Sets material rendering flags (e.g. Transparent, DoubleSided, Unlit).

flags : MaterialFlags
Returns: DrawState

withMaterial material

Full Usage: withMaterial material

Parameters:
Returns: DrawState
Modifiers: inline

Replaces the entire material with a pre-configured template.

material : Material
Returns: DrawState

withMetallic metallic

Full Usage: withMetallic metallic

Parameters:
    metallic : float32

Returns: DrawState
Modifiers: inline

Sets the metallic factor (0.0 = Dielectric, 1.0 = Pure Metal).

metallic : float32
Returns: DrawState

withRoughness roughness

Full Usage: withRoughness roughness

Parameters:
    roughness : float32

Returns: DrawState
Modifiers: inline

Sets the roughness factor (0.0 = Perfectly Smooth, 1.0 = Maximally Rough).

roughness : float32
Returns: DrawState

withTransform transform

Full Usage: withTransform transform

Parameters:
Returns: DrawState
Modifiers: inline

Sets the complete world transform, overriding any previous position, rotation, or scale calls.

transform : Matrix
Returns: DrawState

this.Yield

Full Usage: this.Yield

Parameters:
    () : unit

Returns: DrawState
Modifiers: inline
() : unit
Returns: DrawState

Type something to start searching.