SpriteBase3D

    Inherited By: AnimatedSprite3D,

    2D sprite node in 3D environment.

    A node that displays 2D texture information in a 3D environment.

    Properties

    generate_triangle_mesh ( ) const

    get_draw_flag ( flag ) const

    Rect2

    ( ) const

    void

    set_draw_flag ( flag, bool enabled )

    Enumerations

    enum DrawFlags:

    • FLAG_TRANSPARENT = 0 —- If set, the texture’s transparency and the opacity are used to make those parts of the sprite invisible.

    • FLAG_DOUBLE_SIDED = 2 —- If set, texture can be seen from the back as well, if not, it is invisible when looking at it from behind.

    • FLAG_DISABLE_DEPTH_TEST = 3 —- Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it.

    • FLAG_FIXED_SIZE = 4 —- Sprite is scaled by depth so that it always appears the same size on screen.


    enum AlphaCutMode:

    • ALPHA_CUT_DISABLED = 0

    • ALPHA_CUT_DISCARD = 1

    • ALPHA_CUT_OPAQUE_PREPASS = 2

    • alpha_cut

    Default

    0

    Setter

    set_alpha_cut_mode(value)

    Getter

    get_alpha_cut_mode()


    • Vector3.Axis axis

    Default

    Setter

    set_axis(value)

    Getter

    get_axis()

    The direction in which the front of the texture faces.


    Default

    0

    Setter

    set_billboard_mode(value)

    Getter

    get_billboard_mode()


    • centered

    Default

    true

    Setter

    set_centered(value)

    Getter

    is_centered()

    If true, texture will be centered.


    If true, texture can be seen from the back as well, if false, it is invisible when looking at it from behind.


    • fixed_size

    Default

    false

    Setter

    set_draw_flag(value)

    Getter

    get_draw_flag()

    If true, the label is rendered at the same size regardless of distance.


    Default

    false

    Setter

    set_flip_h(value)

    Getter

    is_flipped_h()

    If true, texture is flipped horizontally.


    • flip_v

    Default

    false

    Setter

    set_flip_v(value)

    Getter

    is_flipped_v()


    Default

    Color( 1, 1, 1, 1 )

    Setter

    set_modulate(value)

    Getter

    get_modulate()

    A color value used to multiply the texture’s colors. Can be used for mood-coloring or to simulate the color of light.

    Note: If a GeometryInstance.material_override is defined on the SpriteBase3D, the material override must be configured to take vertex colors into account for albedo. Otherwise, the color defined in will be ignored. For a SpatialMaterial, must be true. For a ShaderMaterial, ALBEDO *= COLOR.rgb; must be inserted in the shader’s function.


    • no_depth_test

    Default

    false

    Setter

    set_draw_flag(value)

    Getter

    get_draw_flag()

    If true, depth testing is disabled and the object will be drawn in render order.


    The texture’s drawing offset.


    • opacity

    Default

    1.0

    Setter

    set_opacity(value)

    Getter

    get_opacity()

    The texture’s visibility on a scale from 0 (fully invisible) to 1 (fully visible). opacity is a multiplier for the color’s alpha channel.

    Note: If a GeometryInstance.material_override is defined on the SpriteBase3D, the material override must be configured to take vertex colors into account for albedo. Otherwise, the opacity defined in will be ignored. For a SpatialMaterial, must be true. For a ShaderMaterial, ALPHA *= COLOR.a; must be inserted in the shader’s fragment() function.


    • pixel_size

    Default

    0.01

    Setter

    set_pixel_size(value)

    Getter

    get_pixel_size()

    The size of one pixel’s width on the sprite to scale it in 3D.


    • int render_priority

    Default

    0

    Setter

    set_render_priority(value)

    Getter

    get_render_priority()

    Sets the render priority for the sprite. Higher priority objects will be sorted in front of lower priority objects.

    Note: This only applies if is set to ALPHA_CUT_DISABLED (default value).

    Note: This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).


    • shaded

    Default

    false

    Setter

    set_draw_flag(value)

    Getter

    get_draw_flag()

    If true, the Light in the has effects on the sprite.


    Default

    true

    Setter

    set_draw_flag(value)

    Getter

    get_draw_flag()

    If true, the texture’s transparency and the opacity are used to make those parts of the sprite invisible.

    Method Descriptions


    Returns the value of the specified flag.


    • get_item_rect ( ) const

    • void set_draw_flag ( DrawFlags flag, enabled )

    If , the specified flag will be enabled.