Struct gdnative_bindings::visual_server::VisualServer[][src]

pub struct VisualServer { /* fields omitted */ }

core singleton class VisualServer inherits Object (unsafe).

Official documentation

See the documentation of this class in the Godot engine's official documentation. The method descriptions are generated from it and typically contain code samples in GDScript, not Rust.

Class hierarchy

VisualServer inherits methods from:

Safety

All types in the Godot API have "interior mutability" in Rust parlance. To enforce that the official thread-safety guidelines are followed, the typestate pattern is used in the Ref and TRef smart pointers, and the Instance API. The typestate Access in these types tracks whether the access is unique, shared, or exclusive to the current thread. For more information, see the type-level documentation on Ref.

Implementations

impl VisualServer[src]

Constants

pub const ARRAY_BONES: i64[src]

pub const ARRAY_COLOR: i64[src]

pub const ARRAY_COMPRESS_BONES: i64[src]

pub const ARRAY_COMPRESS_COLOR: i64[src]

pub const ARRAY_COMPRESS_DEFAULT: i64[src]

pub const ARRAY_COMPRESS_INDEX: i64[src]

pub const ARRAY_COMPRESS_NORMAL: i64[src]

pub const ARRAY_COMPRESS_TANGENT: i64[src]

pub const ARRAY_COMPRESS_TEX_UV: i64[src]

pub const ARRAY_COMPRESS_TEX_UV2: i64[src]

pub const ARRAY_COMPRESS_VERTEX: i64[src]

pub const ARRAY_COMPRESS_WEIGHTS: i64[src]

pub const ARRAY_FLAG_USE_16_BIT_BONES: i64[src]

pub const ARRAY_FLAG_USE_2D_VERTICES: i64[src]

pub const ARRAY_FORMAT_BONES: i64[src]

pub const ARRAY_FORMAT_COLOR: i64[src]

pub const ARRAY_FORMAT_INDEX: i64[src]

pub const ARRAY_FORMAT_NORMAL: i64[src]

pub const ARRAY_FORMAT_TANGENT: i64[src]

pub const ARRAY_FORMAT_TEX_UV: i64[src]

pub const ARRAY_FORMAT_TEX_UV2: i64[src]

pub const ARRAY_FORMAT_VERTEX: i64[src]

pub const ARRAY_FORMAT_WEIGHTS: i64[src]

pub const ARRAY_INDEX: i64[src]

pub const ARRAY_MAX: i64[src]

pub const ARRAY_NORMAL: i64[src]

pub const ARRAY_TANGENT: i64[src]

pub const ARRAY_TEX_UV: i64[src]

pub const ARRAY_TEX_UV2: i64[src]

pub const ARRAY_VERTEX: i64[src]

pub const ARRAY_WEIGHTS: i64[src]

pub const ARRAY_WEIGHTS_SIZE: i64[src]

pub const BLEND_SHAPE_MODE_NORMALIZED: i64[src]

pub const BLEND_SHAPE_MODE_RELATIVE: i64[src]

pub const CANVAS_ITEM_Z_MAX: i64[src]

pub const CANVAS_ITEM_Z_MIN: i64[src]

pub const CANVAS_LIGHT_FILTER_NONE: i64[src]

pub const CANVAS_LIGHT_FILTER_PCF13: i64[src]

pub const CANVAS_LIGHT_FILTER_PCF3: i64[src]

pub const CANVAS_LIGHT_FILTER_PCF5: i64[src]

pub const CANVAS_LIGHT_FILTER_PCF7: i64[src]

pub const CANVAS_LIGHT_FILTER_PCF9: i64[src]

pub const CANVAS_LIGHT_MODE_ADD: i64[src]

pub const CANVAS_LIGHT_MODE_MASK: i64[src]

pub const CANVAS_LIGHT_MODE_MIX: i64[src]

pub const CANVAS_LIGHT_MODE_SUB: i64[src]

pub const CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE: i64[src]

pub const CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE: i64[src]

pub const CANVAS_OCCLUDER_POLYGON_CULL_DISABLED: i64[src]

pub const CUBEMAP_BACK: i64[src]

pub const CUBEMAP_BOTTOM: i64[src]

pub const CUBEMAP_FRONT: i64[src]

pub const CUBEMAP_LEFT: i64[src]

pub const CUBEMAP_RIGHT: i64[src]

pub const CUBEMAP_TOP: i64[src]

pub const ENV_BG_CANVAS: i64[src]

pub const ENV_BG_CLEAR_COLOR: i64[src]

pub const ENV_BG_COLOR: i64[src]

pub const ENV_BG_COLOR_SKY: i64[src]

pub const ENV_BG_KEEP: i64[src]

pub const ENV_BG_MAX: i64[src]

pub const ENV_BG_SKY: i64[src]

pub const ENV_DOF_BLUR_QUALITY_HIGH: i64[src]

pub const ENV_DOF_BLUR_QUALITY_LOW: i64[src]

pub const ENV_DOF_BLUR_QUALITY_MEDIUM: i64[src]

pub const ENV_SSAO_BLUR_1x1: i64[src]

pub const ENV_SSAO_BLUR_2x2: i64[src]

pub const ENV_SSAO_BLUR_3x3: i64[src]

pub const ENV_SSAO_BLUR_DISABLED: i64[src]

pub const ENV_SSAO_QUALITY_HIGH: i64[src]

pub const ENV_SSAO_QUALITY_LOW: i64[src]

pub const ENV_SSAO_QUALITY_MEDIUM: i64[src]

pub const ENV_TONE_MAPPER_ACES: i64[src]

pub const ENV_TONE_MAPPER_FILMIC: i64[src]

pub const ENV_TONE_MAPPER_LINEAR: i64[src]

pub const ENV_TONE_MAPPER_REINHARD: i64[src]

pub const FEATURE_MULTITHREADED: i64[src]

pub const FEATURE_SHADERS: i64[src]

pub const GLOW_BLEND_MODE_ADDITIVE: i64[src]

pub const GLOW_BLEND_MODE_REPLACE: i64[src]

pub const GLOW_BLEND_MODE_SCREEN: i64[src]

pub const GLOW_BLEND_MODE_SOFTLIGHT: i64[src]

pub const INFO_2D_DRAW_CALLS_IN_FRAME: i64[src]

pub const INFO_2D_ITEMS_IN_FRAME: i64[src]

pub const INFO_DRAW_CALLS_IN_FRAME: i64[src]

pub const INFO_MATERIAL_CHANGES_IN_FRAME: i64[src]

pub const INFO_OBJECTS_IN_FRAME: i64[src]

pub const INFO_SHADER_CHANGES_IN_FRAME: i64[src]

pub const INFO_SURFACE_CHANGES_IN_FRAME: i64[src]

pub const INFO_TEXTURE_MEM_USED: i64[src]

pub const INFO_USAGE_VIDEO_MEM_TOTAL: i64[src]

pub const INFO_VERTEX_MEM_USED: i64[src]

pub const INFO_VERTICES_IN_FRAME: i64[src]

pub const INFO_VIDEO_MEM_USED: i64[src]

pub const INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE: i64[src]

pub const INSTANCE_FLAG_MAX: i64[src]

pub const INSTANCE_FLAG_USE_BAKED_LIGHT: i64[src]

pub const INSTANCE_GEOMETRY_MASK: i64[src]

pub const INSTANCE_GI_PROBE: i64[src]

pub const INSTANCE_IMMEDIATE: i64[src]

pub const INSTANCE_LIGHT: i64[src]

pub const INSTANCE_LIGHTMAP_CAPTURE: i64[src]

pub const INSTANCE_MAX: i64[src]

pub const INSTANCE_MESH: i64[src]

pub const INSTANCE_MULTIMESH: i64[src]

pub const INSTANCE_NONE: i64[src]

pub const INSTANCE_PARTICLES: i64[src]

pub const INSTANCE_REFLECTION_PROBE: i64[src]

pub const LIGHT_DIRECTIONAL: i64[src]

pub const LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED: i64[src]

pub const LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE: i64[src]

pub const LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL: i64[src]

pub const LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: i64[src]

pub const LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: i64[src]

pub const LIGHT_OMNI: i64[src]

pub const LIGHT_OMNI_SHADOW_CUBE: i64[src]

pub const LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL: i64[src]

pub const LIGHT_OMNI_SHADOW_DETAIL_VERTICAL: i64[src]

pub const LIGHT_OMNI_SHADOW_DUAL_PARABOLOID: i64[src]

pub const LIGHT_PARAM_ATTENUATION: i64[src]

pub const LIGHT_PARAM_CONTACT_SHADOW_SIZE: i64[src]

pub const LIGHT_PARAM_ENERGY: i64[src]

pub const LIGHT_PARAM_MAX: i64[src]

pub const LIGHT_PARAM_RANGE: i64[src]

pub const LIGHT_PARAM_SHADOW_BIAS: i64[src]

pub const LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE: i64[src]

pub const LIGHT_PARAM_SHADOW_MAX_DISTANCE: i64[src]

pub const LIGHT_PARAM_SHADOW_NORMAL_BIAS: i64[src]

pub const LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET: i64[src]

pub const LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET: i64[src]

pub const LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET: i64[src]

pub const LIGHT_PARAM_SPECULAR: i64[src]

pub const LIGHT_PARAM_SPOT_ANGLE: i64[src]

pub const LIGHT_PARAM_SPOT_ATTENUATION: i64[src]

pub const LIGHT_SPOT: i64[src]

pub const MATERIAL_RENDER_PRIORITY_MAX: i64[src]

pub const MATERIAL_RENDER_PRIORITY_MIN: i64[src]

pub const MAX_CURSORS: i64[src]

pub const MAX_GLOW_LEVELS: i64[src]

pub const MULTIMESH_COLOR_8BIT: i64[src]

pub const MULTIMESH_COLOR_FLOAT: i64[src]

pub const MULTIMESH_COLOR_NONE: i64[src]

pub const MULTIMESH_CUSTOM_DATA_8BIT: i64[src]

pub const MULTIMESH_CUSTOM_DATA_FLOAT: i64[src]

pub const MULTIMESH_CUSTOM_DATA_NONE: i64[src]

pub const MULTIMESH_TRANSFORM_2D: i64[src]

pub const MULTIMESH_TRANSFORM_3D: i64[src]

pub const NINE_PATCH_STRETCH: i64[src]

pub const NINE_PATCH_TILE: i64[src]

pub const NINE_PATCH_TILE_FIT: i64[src]

pub const NO_INDEX_ARRAY: i64[src]

pub const PARTICLES_DRAW_ORDER_INDEX: i64[src]

pub const PARTICLES_DRAW_ORDER_LIFETIME: i64[src]

pub const PARTICLES_DRAW_ORDER_VIEW_DEPTH: i64[src]

pub const PRIMITIVE_LINES: i64[src]

pub const PRIMITIVE_LINE_LOOP: i64[src]

pub const PRIMITIVE_LINE_STRIP: i64[src]

pub const PRIMITIVE_MAX: i64[src]

pub const PRIMITIVE_POINTS: i64[src]

pub const PRIMITIVE_TRIANGLES: i64[src]

pub const PRIMITIVE_TRIANGLE_FAN: i64[src]

pub const PRIMITIVE_TRIANGLE_STRIP: i64[src]

pub const REFLECTION_PROBE_UPDATE_ALWAYS: i64[src]

pub const REFLECTION_PROBE_UPDATE_ONCE: i64[src]

pub const SCENARIO_DEBUG_DISABLED: i64[src]

pub const SCENARIO_DEBUG_OVERDRAW: i64[src]

pub const SCENARIO_DEBUG_SHADELESS: i64[src]

pub const SCENARIO_DEBUG_WIREFRAME: i64[src]

pub const SHADER_CANVAS_ITEM: i64[src]

pub const SHADER_MAX: i64[src]

pub const SHADER_PARTICLES: i64[src]

pub const SHADER_SPATIAL: i64[src]

pub const SHADOW_CASTING_SETTING_DOUBLE_SIDED: i64[src]

pub const SHADOW_CASTING_SETTING_OFF: i64[src]

pub const SHADOW_CASTING_SETTING_ON: i64[src]

pub const SHADOW_CASTING_SETTING_SHADOWS_ONLY: i64[src]

pub const TEXTURE_FLAGS_DEFAULT: i64[src]

pub const TEXTURE_FLAG_ANISOTROPIC_FILTER: i64[src]

pub const TEXTURE_FLAG_CONVERT_TO_LINEAR: i64[src]

pub const TEXTURE_FLAG_FILTER: i64[src]

pub const TEXTURE_FLAG_MIPMAPS: i64[src]

pub const TEXTURE_FLAG_MIRRORED_REPEAT: i64[src]

pub const TEXTURE_FLAG_REPEAT: i64[src]

pub const TEXTURE_FLAG_USED_FOR_STREAMING: i64[src]

pub const TEXTURE_TYPE_2D: i64[src]

pub const TEXTURE_TYPE_2D_ARRAY: i64[src]

pub const TEXTURE_TYPE_3D: i64[src]

pub const TEXTURE_TYPE_CUBEMAP: i64[src]

pub const VIEWPORT_CLEAR_ALWAYS: i64[src]

pub const VIEWPORT_CLEAR_NEVER: i64[src]

pub const VIEWPORT_CLEAR_ONLY_NEXT_FRAME: i64[src]

pub const VIEWPORT_DEBUG_DRAW_DISABLED: i64[src]

pub const VIEWPORT_DEBUG_DRAW_OVERDRAW: i64[src]

pub const VIEWPORT_DEBUG_DRAW_UNSHADED: i64[src]

pub const VIEWPORT_DEBUG_DRAW_WIREFRAME: i64[src]

pub const VIEWPORT_MSAA_16X: i64[src]

pub const VIEWPORT_MSAA_2X: i64[src]

pub const VIEWPORT_MSAA_4X: i64[src]

pub const VIEWPORT_MSAA_8X: i64[src]

pub const VIEWPORT_MSAA_DISABLED: i64[src]

pub const VIEWPORT_MSAA_EXT_2X: i64[src]

pub const VIEWPORT_MSAA_EXT_4X: i64[src]

pub const VIEWPORT_RENDER_INFO_2D_DRAW_CALLS_IN_FRAME: i64[src]

pub const VIEWPORT_RENDER_INFO_2D_ITEMS_IN_FRAME: i64[src]

pub const VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME: i64[src]

pub const VIEWPORT_RENDER_INFO_MATERIAL_CHANGES_IN_FRAME: i64[src]

pub const VIEWPORT_RENDER_INFO_MAX: i64[src]

pub const VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME: i64[src]

pub const VIEWPORT_RENDER_INFO_SHADER_CHANGES_IN_FRAME: i64[src]

pub const VIEWPORT_RENDER_INFO_SURFACE_CHANGES_IN_FRAME: i64[src]

pub const VIEWPORT_RENDER_INFO_VERTICES_IN_FRAME: i64[src]

pub const VIEWPORT_UPDATE_ALWAYS: i64[src]

pub const VIEWPORT_UPDATE_DISABLED: i64[src]

pub const VIEWPORT_UPDATE_ONCE: i64[src]

pub const VIEWPORT_UPDATE_WHEN_VISIBLE: i64[src]

pub const VIEWPORT_USAGE_2D: i64[src]

pub const VIEWPORT_USAGE_2D_NO_SAMPLING: i64[src]

pub const VIEWPORT_USAGE_3D: i64[src]

pub const VIEWPORT_USAGE_3D_NO_EFFECTS: i64[src]

impl VisualServer[src]

pub unsafe fn godot_singleton() -> &'static Self[src]

Returns a reference to the singleton instance.

Safety

This singleton server is only safe to access from outside the main thread if thread-safe operations are enabled in the project settings. See the official thread-safety guidelines for more information.

pub fn black_bars_set_images(
    &self,
    left: Rid,
    top: Rid,
    right: Rid,
    bottom: Rid
)
[src]

Sets images to be rendered in the window margin.

pub fn black_bars_set_margins(
    &self,
    left: i64,
    top: i64,
    right: i64,
    bottom: i64
)
[src]

Sets margin size, where black bars (or images, if [method black_bars_set_images] was used) are rendered.

pub fn camera_create(&self) -> Rid[src]

Creates a camera and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all camera_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn camera_set_cull_mask(&self, camera: Rid, layers: i64)[src]

Sets the cull mask associated with this camera. The cull mask describes which 3D layers are rendered by this camera. Equivalent to [member Camera.cull_mask].

pub fn camera_set_environment(&self, camera: Rid, env: Rid)[src]

Sets the environment used by this camera. Equivalent to [member Camera.environment].

pub fn camera_set_frustum(
    &self,
    camera: Rid,
    size: f64,
    offset: Vector2,
    z_near: f64,
    z_far: f64
)
[src]

Sets camera to use frustum projection. This mode allows adjusting the offset argument to create "tilted frustum" effects.

pub fn camera_set_orthogonal(
    &self,
    camera: Rid,
    size: f64,
    z_near: f64,
    z_far: f64
)
[src]

Sets camera to use orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are.

pub fn camera_set_perspective(
    &self,
    camera: Rid,
    fovy_degrees: f64,
    z_near: f64,
    z_far: f64
)
[src]

Sets camera to use perspective projection. Objects on the screen becomes smaller when they are far away.

pub fn camera_set_transform(&self, camera: Rid, transform: Transform)[src]

Sets Transform of camera.

pub fn camera_set_use_vertical_aspect(&self, camera: Rid, enable: bool)[src]

If true, preserves the horizontal aspect ratio which is equivalent to [constant Camera.KEEP_WIDTH]. If false, preserves the vertical aspect ratio which is equivalent to [constant Camera.KEEP_HEIGHT].

pub fn canvas_create(&self) -> Rid[src]

Creates a canvas and returns the assigned [RID]. It can be accessed with the RID that is returned. This RID will be used in all canvas_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn canvas_item_add_circle(
    &self,
    item: Rid,
    pos: Vector2,
    radius: f64,
    color: Color
)
[src]

Adds a circle command to the CanvasItem's draw commands.

pub fn canvas_item_add_clip_ignore(&self, item: Rid, ignore: bool)[src]

If ignore is true, the VisualServer does not perform clipping.

pub fn canvas_item_add_line(
    &self,
    item: Rid,
    from: Vector2,
    to: Vector2,
    color: Color,
    width: f64,
    antialiased: bool
)
[src]

Adds a line command to the CanvasItem's draw commands.

Default Arguments

  • width - 1.0
  • antialiased - false

pub fn canvas_item_add_mesh(
    &self,
    item: Rid,
    mesh: Rid,
    transform: Transform2D,
    modulate: Color,
    texture: Rid,
    normal_map: Rid
)
[src]

Adds a mesh command to the CanvasItem's draw commands.

Default Arguments

  • transform - Transform2D( 1, 0, 0, 1, 0, 0 )
  • modulate - Color( 1, 1, 1, 1 )

pub fn canvas_item_add_multimesh(
    &self,
    item: Rid,
    mesh: Rid,
    texture: Rid,
    normal_map: Rid
)
[src]

Adds a MultiMesh to the CanvasItem's draw commands. Only affects its aabb at the moment.

pub fn canvas_item_add_nine_patch(
    &self,
    item: Rid,
    rect: Rect2,
    source: Rect2,
    texture: Rid,
    topleft: Vector2,
    bottomright: Vector2,
    x_axis_mode: i64,
    y_axis_mode: i64,
    draw_center: bool,
    modulate: Color,
    normal_map: Rid
)
[src]

Adds a nine patch image to the CanvasItem's draw commands. See NinePatchRect for more explanation.

Default Arguments

  • x_axis_mode - 0
  • y_axis_mode - 0
  • draw_center - true
  • modulate - Color( 1, 1, 1, 1 )

pub fn canvas_item_add_particles(
    &self,
    item: Rid,
    particles: Rid,
    texture: Rid,
    normal_map: Rid
)
[src]

Adds a particle system to the CanvasItem's draw commands.

pub fn canvas_item_add_polygon(
    &self,
    item: Rid,
    points: Vector2Array,
    colors: ColorArray,
    uvs: Vector2Array,
    texture: Rid,
    normal_map: Rid,
    antialiased: bool
)
[src]

Adds a polygon to the CanvasItem's draw commands.

Default Arguments

  • uvs - PoolVector2Array( )
  • antialiased - false

pub fn canvas_item_add_polyline(
    &self,
    item: Rid,
    points: Vector2Array,
    colors: ColorArray,
    width: f64,
    antialiased: bool
)
[src]

Adds a polyline, which is a line from multiple points with a width, to the CanvasItem's draw commands.

Default Arguments

  • width - 1.0
  • antialiased - false

pub fn canvas_item_add_primitive(
    &self,
    item: Rid,
    points: Vector2Array,
    colors: ColorArray,
    uvs: Vector2Array,
    texture: Rid,
    width: f64,
    normal_map: Rid
)
[src]

Adds a primitive to the CanvasItem's draw commands.

Default Arguments

  • width - 1.0

pub fn canvas_item_add_rect(&self, item: Rid, rect: Rect2, color: Color)[src]

Adds a rectangle to the CanvasItem's draw commands.

pub fn canvas_item_add_set_transform(&self, item: Rid, transform: Transform2D)[src]

Adds a Transform2D command to the CanvasItem's draw commands. This sets the extra_matrix uniform when executed. This affects the later commands of the canvas item.

pub fn canvas_item_add_texture_rect(
    &self,
    item: Rid,
    rect: Rect2,
    texture: Rid,
    tile: bool,
    modulate: Color,
    transpose: bool,
    normal_map: Rid
)
[src]

Adds a textured rect to the CanvasItem's draw commands.

Default Arguments

  • tile - false
  • modulate - Color( 1, 1, 1, 1 )
  • transpose - false

pub fn canvas_item_add_texture_rect_region(
    &self,
    item: Rid,
    rect: Rect2,
    texture: Rid,
    src_rect: Rect2,
    modulate: Color,
    transpose: bool,
    normal_map: Rid,
    clip_uv: bool
)
[src]

Adds a texture rect with region setting to the CanvasItem's draw commands.

Default Arguments

  • modulate - Color( 1, 1, 1, 1 )
  • transpose - false
  • clip_uv - true

pub fn canvas_item_add_triangle_array(
    &self,
    item: Rid,
    indices: Int32Array,
    points: Vector2Array,
    colors: ColorArray,
    uvs: Vector2Array,
    bones: Int32Array,
    weights: Float32Array,
    texture: Rid,
    count: i64,
    normal_map: Rid,
    antialiased: bool,
    antialiasing_use_indices: bool
)
[src]

Adds a triangle array to the CanvasItem's draw commands.

Default Arguments

  • uvs - PoolVector2Array( )
  • bones - PoolIntArray( )
  • weights - PoolRealArray( )
  • count - -1
  • antialiased - false
  • antialiasing_use_indices - false

pub fn canvas_item_clear(&self, item: Rid)[src]

Clears the CanvasItem and removes all commands in it.

pub fn canvas_item_create(&self) -> Rid[src]

Creates a new CanvasItem and returns its [RID]. It can be accessed with the RID that is returned. This RID will be used in all canvas_item_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn canvas_item_set_clip(&self, item: Rid, clip: bool)[src]

Sets clipping for the CanvasItem.

pub fn canvas_item_set_copy_to_backbuffer(
    &self,
    item: Rid,
    enabled: bool,
    rect: Rect2
)
[src]

Sets the CanvasItem to copy a rect to the backbuffer.

pub fn canvas_item_set_custom_rect(
    &self,
    item: Rid,
    use_custom_rect: bool,
    rect: Rect2
)
[src]

Defines a custom drawing rectangle for the CanvasItem.

Default Arguments

  • rect - Rect2( 0, 0, 0, 0 )

pub fn canvas_item_set_distance_field_mode(&self, item: Rid, enabled: bool)[src]

Enables the use of distance fields for GUI elements that are rendering distance field based fonts.

pub fn canvas_item_set_draw_behind_parent(&self, item: Rid, enabled: bool)[src]

Sets CanvasItem to be drawn behind its parent.

pub fn canvas_item_set_draw_index(&self, item: Rid, index: i64)[src]

Sets the index for the CanvasItem.

pub fn canvas_item_set_light_mask(&self, item: Rid, mask: i64)[src]

The light mask. See LightOccluder2D for more information on light masks.

pub fn canvas_item_set_material(&self, item: Rid, material: Rid)[src]

Sets a new material to the CanvasItem.

pub fn canvas_item_set_modulate(&self, item: Rid, color: Color)[src]

Sets the color that modulates the CanvasItem and its children.

pub fn canvas_item_set_parent(&self, item: Rid, parent: Rid)[src]

Sets the parent for the CanvasItem. The parent can be another canvas item, or it can be the root canvas that is attached to the viewport.

pub fn canvas_item_set_self_modulate(&self, item: Rid, color: Color)[src]

Sets the color that modulates the CanvasItem without children.

pub fn canvas_item_set_sort_children_by_y(&self, item: Rid, enabled: bool)[src]

Sets if CanvasItem's children should be sorted by y-position.

pub fn canvas_item_set_transform(&self, item: Rid, transform: Transform2D)[src]

Sets the CanvasItem's Transform2D.

pub fn canvas_item_set_use_parent_material(&self, item: Rid, enabled: bool)[src]

Sets if the CanvasItem uses its parent's material.

pub fn canvas_item_set_visible(&self, item: Rid, visible: bool)[src]

Sets if the canvas item (including its children) is visible.

pub fn canvas_item_set_z_as_relative_to_parent(&self, item: Rid, enabled: bool)[src]

If this is enabled, the Z index of the parent will be added to the children's Z index.

pub fn canvas_item_set_z_index(&self, item: Rid, z_index: i64)[src]

Sets the CanvasItem's Z index, i.e. its draw order (lower indexes are drawn first).

pub fn canvas_light_attach_to_canvas(&self, light: Rid, canvas: Rid)[src]

Attaches the canvas light to the canvas. Removes it from its previous canvas.

pub fn canvas_light_create(&self) -> Rid[src]

Creates a canvas light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all canvas_light_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn canvas_light_occluder_attach_to_canvas(&self, occluder: Rid, canvas: Rid)[src]

Attaches a light occluder to the canvas. Removes it from its previous canvas.

pub fn canvas_light_occluder_create(&self) -> Rid[src]

Creates a light occluder and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all canvas_light_ocluder_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn canvas_light_occluder_set_enabled(&self, occluder: Rid, enabled: bool)[src]

Enables or disables light occluder.

pub fn canvas_light_occluder_set_light_mask(&self, occluder: Rid, mask: i64)[src]

The light mask. See LightOccluder2D for more information on light masks.

pub fn canvas_light_occluder_set_polygon(&self, occluder: Rid, polygon: Rid)[src]

Sets a light occluder's polygon.

pub fn canvas_light_occluder_set_transform(
    &self,
    occluder: Rid,
    transform: Transform2D
)
[src]

Sets a light occluder's Transform2D.

pub fn canvas_light_set_color(&self, light: Rid, color: Color)[src]

Sets the color for a light.

pub fn canvas_light_set_enabled(&self, light: Rid, enabled: bool)[src]

Enables or disables a canvas light.

pub fn canvas_light_set_energy(&self, light: Rid, energy: f64)[src]

Sets a canvas light's energy.

pub fn canvas_light_set_height(&self, light: Rid, height: f64)[src]

Sets a canvas light's height.

pub fn canvas_light_set_item_cull_mask(&self, light: Rid, mask: i64)[src]

The light mask. See LightOccluder2D for more information on light masks.

pub fn canvas_light_set_item_shadow_cull_mask(&self, light: Rid, mask: i64)[src]

The binary mask used to determine which layers this canvas light's shadows affects. See LightOccluder2D for more information on light masks.

pub fn canvas_light_set_layer_range(
    &self,
    light: Rid,
    min_layer: i64,
    max_layer: i64
)
[src]

The layer range that gets rendered with this light.

pub fn canvas_light_set_mode(&self, light: Rid, mode: i64)[src]

The mode of the light, see [enum CanvasLightMode] constants.

pub fn canvas_light_set_scale(&self, light: Rid, scale: f64)[src]

Sets the texture's scale factor of the light. Equivalent to [member Light2D.texture_scale].

pub fn canvas_light_set_shadow_buffer_size(&self, light: Rid, size: i64)[src]

Sets the width of the shadow buffer, size gets scaled to the next power of two for this.

pub fn canvas_light_set_shadow_color(&self, light: Rid, color: Color)[src]

Sets the color of the canvas light's shadow.

pub fn canvas_light_set_shadow_enabled(&self, light: Rid, enabled: bool)[src]

Enables or disables the canvas light's shadow.

pub fn canvas_light_set_shadow_filter(&self, light: Rid, filter: i64)[src]

Sets the canvas light's shadow's filter, see [enum CanvasLightShadowFilter] constants.

pub fn canvas_light_set_shadow_gradient_length(&self, light: Rid, length: f64)[src]

Sets the length of the shadow's gradient.

pub fn canvas_light_set_shadow_smooth(&self, light: Rid, smooth: f64)[src]

Smoothens the shadow. The lower, the smoother.

pub fn canvas_light_set_texture(&self, light: Rid, texture: Rid)[src]

Sets texture to be used by light. Equivalent to [member Light2D.texture].

pub fn canvas_light_set_texture_offset(&self, light: Rid, offset: Vector2)[src]

Sets the offset of the light's texture. Equivalent to [member Light2D.offset].

pub fn canvas_light_set_transform(&self, light: Rid, transform: Transform2D)[src]

Sets the canvas light's Transform2D.

pub fn canvas_light_set_z_range(&self, light: Rid, min_z: i64, max_z: i64)[src]

Sets the Z range of objects that will be affected by this light. Equivalent to [member Light2D.range_z_min] and [member Light2D.range_z_max].

pub fn canvas_occluder_polygon_create(&self) -> Rid[src]

Creates a new light occluder polygon and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all canvas_occluder_polygon_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn canvas_occluder_polygon_set_cull_mode(
    &self,
    occluder_polygon: Rid,
    mode: i64
)
[src]

Sets an occluder polygons cull mode. See [enum CanvasOccluderPolygonCullMode] constants.

pub fn canvas_occluder_polygon_set_shape(
    &self,
    occluder_polygon: Rid,
    shape: Vector2Array,
    closed: bool
)
[src]

Sets the shape of the occluder polygon.

pub fn canvas_occluder_polygon_set_shape_as_lines(
    &self,
    occluder_polygon: Rid,
    shape: Vector2Array
)
[src]

Sets the shape of the occluder polygon as lines.

pub fn canvas_set_item_mirroring(
    &self,
    canvas: Rid,
    item: Rid,
    mirroring: Vector2
)
[src]

A copy of the canvas item will be drawn with a local offset of the mirroring Vector2.

pub fn canvas_set_modulate(&self, canvas: Rid, color: Color)[src]

Modulates all colors in the given canvas.

pub fn directional_light_create(&self) -> Rid[src]

Creates a directional light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method. To place in a scene, attach this directional light to an instance using [method instance_set_base] using the returned RID.

pub fn draw(&self, swap_buffers: bool, frame_step: f64)[src]

Draws a frame. [i]This method is deprecated[/i], please use [method force_draw] instead.

Default Arguments

  • swap_buffers - true
  • frame_step - 0.0

pub fn environment_create(&self) -> Rid[src]

Creates an environment and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all environment_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn environment_set_adjustment(
    &self,
    env: Rid,
    enable: bool,
    brightness: f64,
    contrast: f64,
    saturation: f64,
    ramp: Rid
)
[src]

Sets the values to be used with the "Adjustment" post-process effect. See Environment for more details.

pub fn environment_set_ambient_light(
    &self,
    env: Rid,
    color: Color,
    energy: f64,
    sky_contibution: f64
)
[src]

Sets the ambient light parameters. See Environment for more details.

Default Arguments

  • energy - 1.0
  • sky_contibution - 0.0

pub fn environment_set_background(&self, env: Rid, bg: i64)[src]

Sets the [i]BGMode[/i] of the environment. Equivalent to [member Environment.background_mode].

pub fn environment_set_bg_color(&self, env: Rid, color: Color)[src]

Color displayed for clear areas of the scene (if using Custom color or Color+Sky background modes).

pub fn environment_set_bg_energy(&self, env: Rid, energy: f64)[src]

Sets the intensity of the background color.

pub fn environment_set_canvas_max_layer(&self, env: Rid, max_layer: i64)[src]

Sets the maximum layer to use if using Canvas background mode.

pub fn environment_set_dof_blur_far(
    &self,
    env: Rid,
    enable: bool,
    distance: f64,
    transition: f64,
    far_amount: f64,
    quality: i64
)
[src]

Sets the values to be used with the "DoF Far Blur" post-process effect. See Environment for more details.

pub fn environment_set_dof_blur_near(
    &self,
    env: Rid,
    enable: bool,
    distance: f64,
    transition: f64,
    far_amount: f64,
    quality: i64
)
[src]

Sets the values to be used with the "DoF Near Blur" post-process effect. See Environment for more details.

pub fn environment_set_fog(
    &self,
    env: Rid,
    enable: bool,
    color: Color,
    sun_color: Color,
    sun_amount: f64
)
[src]

Sets the variables to be used with the scene fog. See Environment for more details.

pub fn environment_set_fog_depth(
    &self,
    env: Rid,
    enable: bool,
    depth_begin: f64,
    depth_end: f64,
    depth_curve: f64,
    transmit: bool,
    transmit_curve: f64
)
[src]

Sets the variables to be used with the fog depth effect. See Environment for more details.

pub fn environment_set_fog_height(
    &self,
    env: Rid,
    enable: bool,
    min_height: f64,
    max_height: f64,
    height_curve: f64
)
[src]

Sets the variables to be used with the fog height effect. See Environment for more details.

pub fn environment_set_glow(
    &self,
    env: Rid,
    enable: bool,
    level_flags: i64,
    intensity: f64,
    strength: f64,
    bloom_threshold: f64,
    blend_mode: i64,
    hdr_bleed_threshold: f64,
    hdr_bleed_scale: f64,
    hdr_luminance_cap: f64,
    bicubic_upscale: bool
)
[src]

Sets the variables to be used with the "glow" post-process effect. See Environment for more details.

pub fn environment_set_sky(&self, env: Rid, sky: Rid)[src]

Sets the Sky to be used as the environment's background when using [i]BGMode[/i] sky. Equivalent to [member Environment.background_sky].

pub fn environment_set_sky_custom_fov(&self, env: Rid, scale: f64)[src]

Sets a custom field of view for the background Sky. Equivalent to [member Environment.background_sky_custom_fov].

pub fn environment_set_sky_orientation(&self, env: Rid, orientation: Basis)[src]

Sets the rotation of the background Sky expressed as a Basis. Equivalent to [member Environment.background_sky_orientation].

pub fn environment_set_ssao(
    &self,
    env: Rid,
    enable: bool,
    radius: f64,
    intensity: f64,
    radius2: f64,
    intensity2: f64,
    bias: f64,
    light_affect: f64,
    ao_channel_affect: f64,
    color: Color,
    quality: i64,
    blur: i64,
    bilateral_sharpness: f64
)
[src]

Sets the variables to be used with the "Screen Space Ambient Occlusion (SSAO)" post-process effect. See Environment for more details.

pub fn environment_set_ssr(
    &self,
    env: Rid,
    enable: bool,
    max_steps: i64,
    fade_in: f64,
    fade_out: f64,
    depth_tolerance: f64,
    roughness: bool
)
[src]

Sets the variables to be used with the "screen space reflections" post-process effect. See Environment for more details.

pub fn environment_set_tonemap(
    &self,
    env: Rid,
    tone_mapper: i64,
    exposure: f64,
    white: f64,
    auto_exposure: bool,
    min_luminance: f64,
    max_luminance: f64,
    auto_exp_speed: f64,
    auto_exp_grey: f64
)
[src]

Sets the variables to be used with the "tonemap" post-process effect. See Environment for more details.

pub fn finish(&self)[src]

Removes buffers and clears testcubes.

pub fn force_draw(&self, swap_buffers: bool, frame_step: f64)[src]

Forces a frame to be drawn when the function is called. Drawing a frame updates all Viewports that are set to update. Use with extreme caution.

Default Arguments

  • swap_buffers - true
  • frame_step - 0.0

pub fn force_sync(&self)[src]

Synchronizes threads.

pub fn free_rid(&self, rid: Rid)[src]

Tries to free an object in the VisualServer.

pub fn get_render_info(&self, info: i64) -> i64[src]

Returns a certain information, see [enum RenderInfo] for options.

pub fn get_test_cube(&self) -> Rid[src]

Returns the id of the test cube. Creates one if none exists.

pub fn get_test_texture(&self) -> Rid[src]

Returns the id of the test texture. Creates one if none exists.

pub fn get_video_adapter_name(&self) -> GodotString[src]

Returns the name of the video adapter (e.g. "GeForce GTX 1080/PCIe/SSE2"). Note: When running a headless or server binary, this function returns an empty string.

pub fn get_video_adapter_vendor(&self) -> GodotString[src]

Returns the vendor of the video adapter (e.g. "NVIDIA Corporation"). Note: When running a headless or server binary, this function returns an empty string.

pub fn get_white_texture(&self) -> Rid[src]

Returns the id of a white texture. Creates one if none exists.

pub fn gi_probe_create(&self) -> Rid[src]

Creates a GI probe and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all gi_probe_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method. To place in a scene, attach this GI probe to an instance using [method instance_set_base] using the returned RID.

pub fn gi_probe_get_bias(&self, probe: Rid) -> f64[src]

Returns the bias value for the GI probe. Bias is used to avoid self occlusion. Equivalent to [member GIProbeData.bias].

pub fn gi_probe_get_bounds(&self, probe: Rid) -> Aabb[src]

Returns the axis-aligned bounding box that covers the full extent of the GI probe.

pub fn gi_probe_get_cell_size(&self, probe: Rid) -> f64[src]

Returns the cell size set by [method gi_probe_set_cell_size].

pub fn gi_probe_get_dynamic_data(&self, probe: Rid) -> Int32Array[src]

Returns the data used by the GI probe.

pub fn gi_probe_get_dynamic_range(&self, probe: Rid) -> i64[src]

Returns the dynamic range set for this GI probe. Equivalent to [member GIProbe.dynamic_range].

pub fn gi_probe_get_energy(&self, probe: Rid) -> f64[src]

Returns the energy multiplier for this GI probe. Equivalent to [member GIProbe.energy].

pub fn gi_probe_get_normal_bias(&self, probe: Rid) -> f64[src]

Returns the normal bias for this GI probe. Equivalent to [member GIProbe.normal_bias].

pub fn gi_probe_get_propagation(&self, probe: Rid) -> f64[src]

Returns the propagation value for this GI probe. Equivalent to [member GIProbe.propagation].

pub fn gi_probe_get_to_cell_xform(&self, probe: Rid) -> Transform[src]

Returns the Transform set by [method gi_probe_set_to_cell_xform].

pub fn gi_probe_is_compressed(&self, probe: Rid) -> bool[src]

Returns true if the GI probe data associated with this GI probe is compressed. Equivalent to [member GIProbe.compress].

pub fn gi_probe_is_interior(&self, probe: Rid) -> bool[src]

Returns true if the GI probe is set to interior, meaning it does not account for sky light. Equivalent to [member GIProbe.interior].

pub fn gi_probe_set_bias(&self, probe: Rid, bias: f64)[src]

Sets the bias value to avoid self-occlusion. Equivalent to [member GIProbe.bias].

pub fn gi_probe_set_bounds(&self, probe: Rid, bounds: Aabb)[src]

Sets the axis-aligned bounding box that covers the extent of the GI probe.

pub fn gi_probe_set_cell_size(&self, probe: Rid, range: f64)[src]

Sets the size of individual cells within the GI probe.

pub fn gi_probe_set_compress(&self, probe: Rid, enable: bool)[src]

Sets the compression setting for the GI probe data. Compressed data will take up less space but may look worse. Equivalent to [member GIProbe.compress].

pub fn gi_probe_set_dynamic_data(&self, probe: Rid, data: Int32Array)[src]

Sets the data to be used in the GI probe for lighting calculations. Normally this is created and called internally within the GIProbe node. You should not try to set this yourself.

pub fn gi_probe_set_dynamic_range(&self, probe: Rid, range: i64)[src]

Sets the dynamic range of the GI probe. Dynamic range sets the limit for how bright lights can be. A smaller range captures greater detail but limits how bright lights can be. Equivalent to [member GIProbe.dynamic_range].

pub fn gi_probe_set_energy(&self, probe: Rid, energy: f64)[src]

Sets the energy multiplier for this GI probe. A higher energy makes the indirect light from the GI probe brighter. Equivalent to [member GIProbe.energy].

pub fn gi_probe_set_interior(&self, probe: Rid, enable: bool)[src]

Sets the interior value of this GI probe. A GI probe set to interior does not include the sky when calculating lighting. Equivalent to [member GIProbe.interior].

pub fn gi_probe_set_normal_bias(&self, probe: Rid, bias: f64)[src]

Sets the normal bias for this GI probe. Normal bias behaves similar to the other form of bias and may help reduce self-occlusion. Equivalent to [member GIProbe.normal_bias].

pub fn gi_probe_set_propagation(&self, probe: Rid, propagation: f64)[src]

Sets the propagation of light within this GI probe. Equivalent to [member GIProbe.propagation].

pub fn gi_probe_set_to_cell_xform(&self, probe: Rid, xform: Transform)[src]

Sets the to cell Transform for this GI probe.

pub fn has_changed(&self) -> bool[src]

Returns true if changes have been made to the VisualServer's data. [method draw] is usually called if this happens.

pub fn has_feature(&self, feature: i64) -> bool[src]

Not yet implemented. Always returns false.

pub fn has_os_feature(&self, feature: impl Into<GodotString>) -> bool[src]

Returns true if the OS supports a certain feature. Features might be s3tc, etc, etc2 and pvrtc.

pub fn immediate_begin(&self, immediate: Rid, primitive: i64, texture: Rid)[src]

Sets up ImmediateGeometry internals to prepare for drawing. Equivalent to [method ImmediateGeometry.begin].

pub fn immediate_clear(&self, immediate: Rid)[src]

Clears everything that was set up between [method immediate_begin] and [method immediate_end]. Equivalent to [method ImmediateGeometry.clear].

pub fn immediate_color(&self, immediate: Rid, color: Color)[src]

Sets the color to be used with next vertex. Equivalent to [method ImmediateGeometry.set_color].

pub fn immediate_create(&self) -> Rid[src]

Creates an immediate geometry and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all immediate_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method. To place in a scene, attach this immediate geometry to an instance using [method instance_set_base] using the returned RID.

pub fn immediate_end(&self, immediate: Rid)[src]

Ends drawing the ImmediateGeometry and displays it. Equivalent to [method ImmediateGeometry.end].

pub fn immediate_get_material(&self, immediate: Rid) -> Rid[src]

Returns the material assigned to the ImmediateGeometry.

pub fn immediate_normal(&self, immediate: Rid, normal: Vector3)[src]

Sets the normal to be used with next vertex. Equivalent to [method ImmediateGeometry.set_normal].

pub fn immediate_set_material(&self, immediate: Rid, material: Rid)[src]

Sets the material to be used to draw the ImmediateGeometry.

pub fn immediate_tangent(&self, immediate: Rid, tangent: Plane)[src]

Sets the tangent to be used with next vertex. Equivalent to [method ImmediateGeometry.set_tangent].

pub fn immediate_uv(&self, immediate: Rid, tex_uv: Vector2)[src]

Sets the UV to be used with next vertex. Equivalent to [method ImmediateGeometry.set_uv].

pub fn immediate_uv2(&self, immediate: Rid, tex_uv: Vector2)[src]

Sets the UV2 to be used with next vertex. Equivalent to [method ImmediateGeometry.set_uv2].

pub fn immediate_vertex(&self, immediate: Rid, vertex: Vector3)[src]

Adds the next vertex using the information provided in advance. Equivalent to [method ImmediateGeometry.add_vertex].

pub fn immediate_vertex_2d(&self, immediate: Rid, vertex: Vector2)[src]

Adds the next vertex using the information provided in advance. This is a helper class that calls [method immediate_vertex] under the hood. Equivalent to [method ImmediateGeometry.add_vertex].

pub fn init(&self)[src]

Initializes the visual server. This function is called internally by platform-dependent code during engine initialization. If called from a running game, it will not do anything.

pub fn instance_attach_object_instance_id(&self, instance: Rid, id: i64)[src]

Attaches a unique Object ID to instance. Object ID must be attached to instance for proper culling with [method instances_cull_aabb], [method instances_cull_convex], and [method instances_cull_ray].

pub fn instance_attach_skeleton(&self, instance: Rid, skeleton: Rid)[src]

Attaches a skeleton to an instance. Removes the previous skeleton from the instance.

pub fn instance_create(&self) -> Rid[src]

Creates a visual instance and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all instance_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method. An instance is a way of placing a 3D object in the scenario. Objects like particles, meshes, and reflection probes need to be associated with an instance to be visible in the scenario using [method instance_set_base].

pub fn instance_create2(&self, base: Rid, scenario: Rid) -> Rid[src]

Creates a visual instance, adds it to the VisualServer, and sets both base and scenario. It can be accessed with the RID that is returned. This RID will be used in all instance_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn instance_geometry_set_as_instance_lod(
    &self,
    instance: Rid,
    as_lod_of_instance: Rid
)
[src]

Not implemented in Godot 3.x.

pub fn instance_geometry_set_cast_shadows_setting(
    &self,
    instance: Rid,
    shadow_casting_setting: i64
)
[src]

Sets the shadow casting setting to one of [enum ShadowCastingSetting]. Equivalent to [member GeometryInstance.cast_shadow].

pub fn instance_geometry_set_draw_range(
    &self,
    instance: Rid,
    min: f64,
    max: f64,
    min_margin: f64,
    max_margin: f64
)
[src]

Not implemented in Godot 3.x.

pub fn instance_geometry_set_flag(
    &self,
    instance: Rid,
    flag: i64,
    enabled: bool
)
[src]

Sets the flag for a given [enum InstanceFlags]. See [enum InstanceFlags] for more details.

pub fn instance_geometry_set_material_override(
    &self,
    instance: Rid,
    material: Rid
)
[src]

Sets a material that will override the material for all surfaces on the mesh associated with this instance. Equivalent to [member GeometryInstance.material_override].

pub fn instance_set_base(&self, instance: Rid, base: Rid)[src]

Sets the base of the instance. A base can be any of the 3D objects that are created in the VisualServer that can be displayed. For example, any of the light types, mesh, multimesh, immediate geometry, particle system, reflection probe, lightmap capture, and the GI probe are all types that can be set as the base of an instance in order to be displayed in the scenario.

pub fn instance_set_blend_shape_weight(
    &self,
    instance: Rid,
    shape: i64,
    weight: f64
)
[src]

Sets the weight for a given blend shape associated with this instance.

pub fn instance_set_custom_aabb(&self, instance: Rid, aabb: Aabb)[src]

Sets a custom AABB to use when culling objects from the view frustum. Equivalent to [method GeometryInstance.set_custom_aabb].

pub fn instance_set_exterior(&self, instance: Rid, enabled: bool)[src]

Function not implemented in Godot 3.x.

pub fn instance_set_extra_visibility_margin(&self, instance: Rid, margin: f64)[src]

Sets a margin to increase the size of the AABB when culling objects from the view frustum. This allows you avoid culling objects that fall outside the view frustum. Equivalent to [member GeometryInstance.extra_cull_margin].

pub fn instance_set_layer_mask(&self, instance: Rid, mask: i64)[src]

Sets the render layers that this instance will be drawn to. Equivalent to [member VisualInstance.layers].

pub fn instance_set_scenario(&self, instance: Rid, scenario: Rid)[src]

Sets the scenario that the instance is in. The scenario is the 3D world that the objects will be displayed in.

pub fn instance_set_surface_material(
    &self,
    instance: Rid,
    surface: i64,
    material: Rid
)
[src]

Sets the material of a specific surface. Equivalent to [method MeshInstance.set_surface_material].

pub fn instance_set_transform(&self, instance: Rid, transform: Transform)[src]

Sets the world space transform of the instance. Equivalent to [member Spatial.transform].

pub fn instance_set_use_lightmap(
    &self,
    instance: Rid,
    lightmap_instance: Rid,
    lightmap: Rid
)
[src]

Sets the lightmap to use with this instance.

pub fn instance_set_visible(&self, instance: Rid, visible: bool)[src]

Sets whether an instance is drawn or not. Equivalent to [member Spatial.visible].

pub fn instances_cull_aabb(&self, aabb: Aabb, scenario: Rid) -> VariantArray[src]

Returns an array of object IDs intersecting with the provided AABB. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use [method @GDScript.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the World you want to query. This forces an update for all resources queued to update. Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.

pub fn instances_cull_convex(
    &self,
    convex: VariantArray,
    scenario: Rid
) -> VariantArray
[src]

Returns an array of object IDs intersecting with the provided convex shape. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use [method @GDScript.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the World you want to query. This forces an update for all resources queued to update. Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.

pub fn instances_cull_ray(
    &self,
    from: Vector3,
    to: Vector3,
    scenario: Rid
) -> VariantArray
[src]

Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use [method @GDScript.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the World you want to query. This forces an update for all resources queued to update. Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.

pub fn is_render_loop_enabled(&self) -> bool[src]

If false, disables rendering completely, but the engine logic is still being processed. You can call [method force_draw] to draw a frame even with rendering disabled.

pub fn light_directional_set_blend_splits(&self, light: Rid, enable: bool)[src]

If true, this directional light will blend between shadow map splits resulting in a smoother transition between them. Equivalent to [member DirectionalLight.directional_shadow_blend_splits].

pub fn light_directional_set_shadow_depth_range_mode(
    &self,
    light: Rid,
    range_mode: i64
)
[src]

Sets the shadow depth range mode for this directional light. Equivalent to [member DirectionalLight.directional_shadow_depth_range]. See [enum LightDirectionalShadowDepthRangeMode] for options.

pub fn light_directional_set_shadow_mode(&self, light: Rid, mode: i64)[src]

Sets the shadow mode for this directional light. Equivalent to [member DirectionalLight.directional_shadow_mode]. See [enum LightDirectionalShadowMode] for options.

pub fn light_omni_set_shadow_detail(&self, light: Rid, detail: i64)[src]

Sets whether to use vertical or horizontal detail for this omni light. This can be used to alleviate artifacts in the shadow map. Equivalent to [member OmniLight.omni_shadow_detail].

pub fn light_omni_set_shadow_mode(&self, light: Rid, mode: i64)[src]

Sets whether to use a dual paraboloid or a cubemap for the shadow map. Dual paraboloid is faster but may suffer from artifacts. Equivalent to [member OmniLight.omni_shadow_mode].

pub fn light_set_color(&self, light: Rid, color: Color)[src]

Sets the color of the light. Equivalent to [member Light.light_color].

pub fn light_set_cull_mask(&self, light: Rid, mask: i64)[src]

Sets the cull mask for this Light. Lights only affect objects in the selected layers. Equivalent to [member Light.light_cull_mask].

pub fn light_set_negative(&self, light: Rid, enable: bool)[src]

If true, light will subtract light instead of adding light. Equivalent to [member Light.light_negative].

pub fn light_set_param(&self, light: Rid, param: i64, value: f64)[src]

Sets the specified light parameter. See [enum LightParam] for options. Equivalent to [method Light.set_param].

pub fn light_set_projector(&self, light: Rid, texture: Rid)[src]

Not implemented in Godot 3.x.

pub fn light_set_reverse_cull_face_mode(&self, light: Rid, enabled: bool)[src]

If true, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double sided shadows with [method instance_geometry_set_cast_shadows_setting]. Equivalent to [member Light.shadow_reverse_cull_face].

pub fn light_set_shadow(&self, light: Rid, enabled: bool)[src]

If true, light will cast shadows. Equivalent to [member Light.shadow_enabled].

pub fn light_set_shadow_color(&self, light: Rid, color: Color)[src]

Sets the color of the shadow cast by the light. Equivalent to [member Light.shadow_color].

pub fn light_set_use_gi(&self, light: Rid, enabled: bool)[src]

Sets whether GI probes capture light information from this light.

pub fn lightmap_capture_create(&self) -> Rid[src]

Creates a lightmap capture and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all lightmap_capture_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method. To place in a scene, attach this lightmap capture to an instance using [method instance_set_base] using the returned RID.

pub fn lightmap_capture_get_bounds(&self, capture: Rid) -> Aabb[src]

Returns the size of the lightmap capture area.

pub fn lightmap_capture_get_energy(&self, capture: Rid) -> f64[src]

Returns the energy multiplier used by the lightmap capture.

pub fn lightmap_capture_get_octree(&self, capture: Rid) -> ByteArray[src]

Returns the octree used by the lightmap capture.

pub fn lightmap_capture_get_octree_cell_subdiv(&self, capture: Rid) -> i64[src]

Returns the cell subdivision amount used by this lightmap capture's octree.

pub fn lightmap_capture_get_octree_cell_transform(
    &self,
    capture: Rid
) -> Transform
[src]

Returns the cell transform for this lightmap capture's octree.

pub fn lightmap_capture_set_bounds(&self, capture: Rid, bounds: Aabb)[src]

Sets the size of the area covered by the lightmap capture. Equivalent to [member BakedLightmapData.bounds].

pub fn lightmap_capture_set_energy(&self, capture: Rid, energy: f64)[src]

Sets the energy multiplier for this lightmap capture. Equivalent to [member BakedLightmapData.energy].

pub fn lightmap_capture_set_octree(&self, capture: Rid, octree: ByteArray)[src]

Sets the octree to be used by this lightmap capture. This function is normally used by the BakedLightmap node. Equivalent to [member BakedLightmapData.octree].

pub fn lightmap_capture_set_octree_cell_subdiv(&self, capture: Rid, subdiv: i64)[src]

Sets the subdivision level of this lightmap capture's octree. Equivalent to [member BakedLightmapData.cell_subdiv].

pub fn lightmap_capture_set_octree_cell_transform(
    &self,
    capture: Rid,
    xform: Transform
)
[src]

Sets the octree cell transform for this lightmap capture's octree. Equivalent to [member BakedLightmapData.cell_space_transform].

pub fn make_sphere_mesh(
    &self,
    latitudes: i64,
    longitudes: i64,
    radius: f64
) -> Rid
[src]

Returns a mesh of a sphere with the given amount of horizontal and vertical subdivisions.

pub fn material_create(&self) -> Rid[src]

Creates an empty material and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all material_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn material_get_param(
    &self,
    material: Rid,
    parameter: impl Into<GodotString>
) -> Variant
[src]

Returns the value of a certain material's parameter.

pub fn material_get_param_default(
    &self,
    material: Rid,
    parameter: impl Into<GodotString>
) -> Variant
[src]

Returns the default value for the param if available. Otherwise returns an empty Variant.

pub fn material_get_shader(&self, shader_material: Rid) -> Rid[src]

Returns the shader of a certain material's shader. Returns an empty RID if the material doesn't have a shader.

pub fn material_set_line_width(&self, material: Rid, width: f64)[src]

Sets a material's line width.

pub fn material_set_next_pass(&self, material: Rid, next_material: Rid)[src]

Sets an object's next material.

pub fn material_set_param(
    &self,
    material: Rid,
    parameter: impl Into<GodotString>,
    value: impl OwnedToVariant
)
[src]

Sets a material's parameter.

pub fn material_set_render_priority(&self, material: Rid, priority: i64)[src]

Sets a material's render priority.

pub fn material_set_shader(&self, shader_material: Rid, shader: Rid)[src]

Sets a shader material's shader.

pub fn mesh_add_surface_from_arrays(
    &self,
    mesh: Rid,
    primitive: i64,
    arrays: VariantArray,
    blend_shapes: VariantArray,
    compress_format: i64
)
[src]

Adds a surface generated from the Arrays to a mesh. See [enum PrimitiveType] constants for types.

Default Arguments

  • blend_shapes - [ ]
  • compress_format - 97280

pub fn mesh_clear(&self, mesh: Rid)[src]

Removes all surfaces from a mesh.

pub fn mesh_create(&self) -> Rid[src]

Creates a new mesh and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all mesh_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method. To place in a scene, attach this mesh to an instance using [method instance_set_base] using the returned RID.

pub fn mesh_get_blend_shape_count(&self, mesh: Rid) -> i64[src]

Returns a mesh's blend shape count.

pub fn mesh_get_blend_shape_mode(&self, mesh: Rid) -> BlendShapeMode[src]

Returns a mesh's blend shape mode.

pub fn mesh_get_custom_aabb(&self, mesh: Rid) -> Aabb[src]

Returns a mesh's custom aabb.

pub fn mesh_get_surface_count(&self, mesh: Rid) -> i64[src]

Returns a mesh's number of surfaces.

pub fn mesh_remove_surface(&self, mesh: Rid, index: i64)[src]

Removes a mesh's surface.

pub fn mesh_set_blend_shape_count(&self, mesh: Rid, amount: i64)[src]

Sets a mesh's blend shape count.

pub fn mesh_set_blend_shape_mode(&self, mesh: Rid, mode: i64)[src]

Sets a mesh's blend shape mode.

pub fn mesh_set_custom_aabb(&self, mesh: Rid, aabb: Aabb)[src]

Sets a mesh's custom aabb.

pub fn mesh_surface_get_aabb(&self, mesh: Rid, surface: i64) -> Aabb[src]

Returns a mesh's surface's aabb.

pub fn mesh_surface_get_array(&self, mesh: Rid, surface: i64) -> ByteArray[src]

Returns a mesh's surface's vertex buffer.

pub fn mesh_surface_get_array_index_len(&self, mesh: Rid, surface: i64) -> i64[src]

Returns a mesh's surface's amount of indices.

pub fn mesh_surface_get_array_len(&self, mesh: Rid, surface: i64) -> i64[src]

Returns a mesh's surface's amount of vertices.

pub fn mesh_surface_get_arrays(&self, mesh: Rid, surface: i64) -> VariantArray[src]

Returns a mesh's surface's buffer arrays.

pub fn mesh_surface_get_blend_shape_arrays(
    &self,
    mesh: Rid,
    surface: i64
) -> VariantArray
[src]

Returns a mesh's surface's arrays for blend shapes.

pub fn mesh_surface_get_format(&self, mesh: Rid, surface: i64) -> i64[src]

Returns the format of a mesh's surface.

pub fn mesh_surface_get_format_offset(
    &self,
    format: i64,
    vertex_len: i64,
    index_len: i64,
    array_index: i64
) -> i64
[src]

Function is unused in Godot 3.x.

pub fn mesh_surface_get_format_stride(
    &self,
    format: i64,
    vertex_len: i64,
    index_len: i64
) -> i64
[src]

Function is unused in Godot 3.x.

pub fn mesh_surface_get_index_array(&self, mesh: Rid, surface: i64) -> ByteArray[src]

Returns a mesh's surface's index buffer.

pub fn mesh_surface_get_material(&self, mesh: Rid, surface: i64) -> Rid[src]

Returns a mesh's surface's material.

pub fn mesh_surface_get_primitive_type(
    &self,
    mesh: Rid,
    surface: i64
) -> PrimitiveType
[src]

Returns the primitive type of a mesh's surface.

pub fn mesh_surface_get_skeleton_aabb(
    &self,
    mesh: Rid,
    surface: i64
) -> VariantArray
[src]

Returns the aabb of a mesh's surface's skeleton.

pub fn mesh_surface_set_material(&self, mesh: Rid, surface: i64, material: Rid)[src]

Sets a mesh's surface's material.

pub fn mesh_surface_update_region(
    &self,
    mesh: Rid,
    surface: i64,
    offset: i64,
    data: ByteArray
)
[src]

Updates a specific region of a vertex buffer for the specified surface. Warning: this function alters the vertex buffer directly with no safety mechanisms, you can easily corrupt your mesh.

pub fn multimesh_allocate(
    &self,
    multimesh: Rid,
    instances: i64,
    transform_format: i64,
    color_format: i64,
    custom_data_format: i64
)
[src]

Allocates space for the multimesh data. Format parameters determine how the data will be stored by OpenGL. See [enum MultimeshTransformFormat], [enum MultimeshColorFormat], and [enum MultimeshCustomDataFormat] for usage. Equivalent to [member MultiMesh.instance_count].

Default Arguments

  • custom_data_format - 0

pub fn multimesh_create(&self) -> Rid[src]

Creates a new multimesh on the VisualServer and returns an [RID] handle. This RID will be used in all multimesh_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method. To place in a scene, attach this multimesh to an instance using [method instance_set_base] using the returned RID.

pub fn multimesh_get_aabb(&self, multimesh: Rid) -> Aabb[src]

Calculates and returns the axis-aligned bounding box that encloses all instances within the multimesh.

pub fn multimesh_get_instance_count(&self, multimesh: Rid) -> i64[src]

Returns the number of instances allocated for this multimesh.

pub fn multimesh_get_mesh(&self, multimesh: Rid) -> Rid[src]

Returns the RID of the mesh that will be used in drawing this multimesh.

pub fn multimesh_get_visible_instances(&self, multimesh: Rid) -> i64[src]

Returns the number of visible instances for this multimesh.

pub fn multimesh_instance_get_color(&self, multimesh: Rid, index: i64) -> Color[src]

Returns the color by which the specified instance will be modulated.

pub fn multimesh_instance_get_custom_data(
    &self,
    multimesh: Rid,
    index: i64
) -> Color
[src]

Returns the custom data associated with the specified instance.

pub fn multimesh_instance_get_transform(
    &self,
    multimesh: Rid,
    index: i64
) -> Transform
[src]

Returns the Transform of the specified instance.

pub fn multimesh_instance_get_transform_2d(
    &self,
    multimesh: Rid,
    index: i64
) -> Transform2D
[src]

Returns the Transform2D of the specified instance. For use when the multimesh is set to use 2D transforms.

pub fn multimesh_instance_set_color(
    &self,
    multimesh: Rid,
    index: i64,
    color: Color
)
[src]

Sets the color by which this instance will be modulated. Equivalent to [method MultiMesh.set_instance_color].

pub fn multimesh_instance_set_custom_data(
    &self,
    multimesh: Rid,
    index: i64,
    custom_data: Color
)
[src]

Sets the custom data for this instance. Custom data is passed as a Color, but is interpreted as a vec4 in the shader. Equivalent to [method MultiMesh.set_instance_custom_data].

pub fn multimesh_instance_set_transform(
    &self,
    multimesh: Rid,
    index: i64,
    transform: Transform
)
[src]

Sets the Transform for this instance. Equivalent to [method MultiMesh.set_instance_transform].

pub fn multimesh_instance_set_transform_2d(
    &self,
    multimesh: Rid,
    index: i64,
    transform: Transform2D
)
[src]

Sets the Transform2D for this instance. For use when multimesh is used in 2D. Equivalent to [method MultiMesh.set_instance_transform_2d].

pub fn multimesh_set_as_bulk_array(&self, multimesh: Rid, array: Float32Array)[src]

Sets all data related to the instances in one go. This is especially useful when loading the data from disk or preparing the data from GDNative.

All data is packed in one large float array. An array may look like this: Transform for instance 1, color data for instance 1, custom data for instance 1, transform for instance 2, color data for instance 2, etc.

Transform is stored as 12 floats, Transform2D is stored as 8 floats, COLOR_8BIT / CUSTOM_DATA_8BIT is stored as 1 float (4 bytes as is) and COLOR_FLOAT / CUSTOM_DATA_FLOAT is stored as 4 floats.

pub fn multimesh_set_mesh(&self, multimesh: Rid, mesh: Rid)[src]

Sets the mesh to be drawn by the multimesh. Equivalent to [member MultiMesh.mesh].

pub fn multimesh_set_visible_instances(&self, multimesh: Rid, visible: i64)[src]

Sets the number of instances visible at a given time. If -1, all instances that have been allocated are drawn. Equivalent to [member MultiMesh.visible_instance_count].

pub fn omni_light_create(&self) -> Rid[src]

Creates a new omni light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method. To place in a scene, attach this omni light to an instance using [method instance_set_base] using the returned RID.

pub fn particles_create(&self) -> Rid[src]

Creates a particle system and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all particles_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method. To place in a scene, attach these particles to an instance using [method instance_set_base] using the returned RID.

pub fn particles_get_current_aabb(&self, particles: Rid) -> Aabb[src]

Calculates and returns the axis-aligned bounding box that contains all the particles. Equivalent to [method Particles.capture_aabb].

pub fn particles_get_emitting(&self, particles: Rid) -> bool[src]

Returns true if particles are currently set to emitting.

pub fn particles_is_inactive(&self, particles: Rid) -> bool[src]

Returns true if particles are not emitting and particles are set to inactive.

pub fn particles_request_process(&self, particles: Rid)[src]

Add particle system to list of particle systems that need to be updated. Update will take place on the next frame, or on the next call to [method instances_cull_aabb], [method instances_cull_convex], or [method instances_cull_ray].

pub fn particles_restart(&self, particles: Rid)[src]

Reset the particles on the next update. Equivalent to [method Particles.restart].

pub fn particles_set_amount(&self, particles: Rid, amount: i64)[src]

Sets the number of particles to be drawn and allocates the memory for them. Equivalent to [member Particles.amount].

pub fn particles_set_custom_aabb(&self, particles: Rid, aabb: Aabb)[src]

Sets a custom axis-aligned bounding box for the particle system. Equivalent to [member Particles.visibility_aabb].

pub fn particles_set_draw_order(&self, particles: Rid, order: i64)[src]

Sets the draw order of the particles to one of the named enums from [enum ParticlesDrawOrder]. See [enum ParticlesDrawOrder] for options. Equivalent to [member Particles.draw_order].

pub fn particles_set_draw_pass_mesh(&self, particles: Rid, pass: i64, mesh: Rid)[src]

Sets the mesh to be used for the specified draw pass. Equivalent to [member Particles.draw_pass_1], [member Particles.draw_pass_2], [member Particles.draw_pass_3], and [member Particles.draw_pass_4].

pub fn particles_set_draw_passes(&self, particles: Rid, count: i64)[src]

Sets the number of draw passes to use. Equivalent to [member Particles.draw_passes].

pub fn particles_set_emission_transform(
    &self,
    particles: Rid,
    transform: Transform
)
[src]

Sets the Transform that will be used by the particles when they first emit.

pub fn particles_set_emitting(&self, particles: Rid, emitting: bool)[src]

If true, particles will emit over time. Setting to false does not reset the particles, but only stops their emission. Equivalent to [member Particles.emitting].

pub fn particles_set_explosiveness_ratio(&self, particles: Rid, ratio: f64)[src]

Sets the explosiveness ratio. Equivalent to [member Particles.explosiveness].

pub fn particles_set_fixed_fps(&self, particles: Rid, fps: i64)[src]

Sets the frame rate that the particle system rendering will be fixed to. Equivalent to [member Particles.fixed_fps].

pub fn particles_set_fractional_delta(&self, particles: Rid, enable: bool)[src]

If true, uses fractional delta which smooths the movement of the particles. Equivalent to [member Particles.fract_delta].

pub fn particles_set_lifetime(&self, particles: Rid, lifetime: f64)[src]

Sets the lifetime of each particle in the system. Equivalent to [member Particles.lifetime].

pub fn particles_set_one_shot(&self, particles: Rid, one_shot: bool)[src]

If true, particles will emit once and then stop. Equivalent to [member Particles.one_shot].

pub fn particles_set_pre_process_time(&self, particles: Rid, time: f64)[src]

Sets the preprocess time for the particles animation. This lets you delay starting an animation until after the particles have begun emitting. Equivalent to [member Particles.preprocess].

pub fn particles_set_process_material(&self, particles: Rid, material: Rid)[src]

Sets the material for processing the particles. Note: this is not the material used to draw the materials. Equivalent to [member Particles.process_material].

pub fn particles_set_randomness_ratio(&self, particles: Rid, ratio: f64)[src]

Sets the emission randomness ratio. This randomizes the emission of particles within their phase. Equivalent to [member Particles.randomness].

pub fn particles_set_speed_scale(&self, particles: Rid, scale: f64)[src]

Sets the speed scale of the particle system. Equivalent to [member Particles.speed_scale].

pub fn particles_set_use_local_coordinates(&self, particles: Rid, enable: bool)[src]

If true, particles use local coordinates. If false they use global coordinates. Equivalent to [member Particles.local_coords].

pub fn reflection_probe_create(&self) -> Rid[src]

Creates a reflection probe and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all reflection_probe_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method. To place in a scene, attach this reflection probe to an instance using [method instance_set_base] using the returned RID.

pub fn reflection_probe_set_as_interior(&self, probe: Rid, enable: bool)[src]

If true, reflections will ignore sky contribution. Equivalent to [member ReflectionProbe.interior_enable].

pub fn reflection_probe_set_cull_mask(&self, probe: Rid, layers: i64)[src]

Sets the render cull mask for this reflection probe. Only instances with a matching cull mask will be rendered by this probe. Equivalent to [member ReflectionProbe.cull_mask].

pub fn reflection_probe_set_enable_box_projection(
    &self,
    probe: Rid,
    enable: bool
)
[src]

If true, uses box projection. This can make reflections look more correct in certain situations. Equivalent to [member ReflectionProbe.box_projection].

pub fn reflection_probe_set_enable_shadows(&self, probe: Rid, enable: bool)[src]

If true, computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent to [member ReflectionProbe.enable_shadows].

pub fn reflection_probe_set_extents(&self, probe: Rid, extents: Vector3)[src]

Sets the size of the area that the reflection probe will capture. Equivalent to [member ReflectionProbe.extents].

pub fn reflection_probe_set_intensity(&self, probe: Rid, intensity: f64)[src]

Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to [member ReflectionProbe.intensity].

pub fn reflection_probe_set_interior_ambient(&self, probe: Rid, color: Color)[src]

Sets the ambient light color for this reflection probe when set to interior mode. Equivalent to [member ReflectionProbe.interior_ambient_color].

pub fn reflection_probe_set_interior_ambient_energy(
    &self,
    probe: Rid,
    energy: f64
)
[src]

Sets the energy multiplier for this reflection probes ambient light contribution when set to interior mode. Equivalent to [member ReflectionProbe.interior_ambient_energy].

pub fn reflection_probe_set_interior_ambient_probe_contribution(
    &self,
    probe: Rid,
    contrib: f64
)
[src]

Sets the contribution value for how much the reflection affects the ambient light for this reflection probe when set to interior mode. Useful so that ambient light matches the color of the room. Equivalent to [member ReflectionProbe.interior_ambient_contrib].

pub fn reflection_probe_set_max_distance(&self, probe: Rid, distance: f64)[src]

Sets the max distance away from the probe an object can be before it is culled. Equivalent to [member ReflectionProbe.max_distance].

pub fn reflection_probe_set_origin_offset(&self, probe: Rid, offset: Vector3)[src]

Sets the origin offset to be used when this reflection probe is in box project mode. Equivalent to [member ReflectionProbe.origin_offset].

pub fn reflection_probe_set_update_mode(&self, probe: Rid, mode: i64)[src]

Sets how often the reflection probe updates. Can either be once or every frame. See [enum ReflectionProbeUpdateMode] for options.

pub fn request_frame_drawn_callback(
    &self,
    _where: impl AsArg<Object>,
    method: impl Into<GodotString>,
    userdata: impl OwnedToVariant
)
[src]

Schedules a callback to the corresponding named method on where after a frame has been drawn. The callback method must use only 1 argument which will be called with userdata.

pub fn scenario_create(&self) -> Rid[src]

Creates a scenario and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all scenario_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method. The scenario is the 3D world that all the visual instances exist in.

pub fn scenario_set_debug(&self, scenario: Rid, debug_mode: i64)[src]

Sets the [enum ScenarioDebugMode] for this scenario. See [enum ScenarioDebugMode] for options.

pub fn scenario_set_environment(&self, scenario: Rid, environment: Rid)[src]

Sets the environment that will be used with this scenario.

pub fn scenario_set_fallback_environment(&self, scenario: Rid, environment: Rid)[src]

Sets the fallback environment to be used by this scenario. The fallback environment is used if no environment is set. Internally, this is used by the editor to provide a default environment.

pub fn scenario_set_reflection_atlas_size(
    &self,
    scenario: Rid,
    size: i64,
    subdiv: i64
)
[src]

Sets the size of the reflection atlas shared by all reflection probes in this scenario.

pub fn set_boot_image(
    &self,
    image: impl AsArg<Image>,
    color: Color,
    scale: bool,
    use_filter: bool
)
[src]

Sets a boot image. The color defines the background color. If scale is true, the image will be scaled to fit the screen size. If use_filter is true, the image will be scaled with linear interpolation. If use_filter is false, the image will be scaled with nearest-neighbor interpolation.

Default Arguments

  • use_filter - true

pub fn set_debug_generate_wireframes(&self, generate: bool)[src]

If true, the engine will generate wireframes for use with the wireframe debug mode.

pub fn set_default_clear_color(&self, color: Color)[src]

Sets the default clear color which is used when a specific clear color has not been selected.

pub fn set_render_loop_enabled(&self, enabled: bool)[src]

If false, disables rendering completely, but the engine logic is still being processed. You can call [method force_draw] to draw a frame even with rendering disabled.

pub fn set_shader_time_scale(&self, scale: f64)[src]

Sets the scale to apply to the passage of time for the shaders' TIME builtin. The default value is 1.0, which means TIME will count the real time as it goes by, without narrowing or stretching it.

pub fn shader_create(&self) -> Rid[src]

Creates an empty shader and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all shader_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn shader_get_code(&self, shader: Rid) -> GodotString[src]

Returns a shader's code.

pub fn shader_get_default_texture_param(
    &self,
    shader: Rid,
    name: impl Into<GodotString>
) -> Rid
[src]

Returns a default texture from a shader searched by name.

pub fn shader_get_param_list(&self, shader: Rid) -> VariantArray[src]

Returns the parameters of a shader.

pub fn shader_set_code(&self, shader: Rid, code: impl Into<GodotString>)[src]

Sets a shader's code.

pub fn shader_set_default_texture_param(
    &self,
    shader: Rid,
    name: impl Into<GodotString>,
    texture: Rid
)
[src]

Sets a shader's default texture. Overwrites the texture given by name.

pub fn skeleton_allocate(&self, skeleton: Rid, bones: i64, is_2d_skeleton: bool)[src]

Allocates the GPU buffers for this skeleton.

Default Arguments

  • is_2d_skeleton - false

pub fn skeleton_bone_get_transform(&self, skeleton: Rid, bone: i64) -> Transform[src]

Returns the Transform set for a specific bone of this skeleton.

pub fn skeleton_bone_get_transform_2d(
    &self,
    skeleton: Rid,
    bone: i64
) -> Transform2D
[src]

Returns the Transform2D set for a specific bone of this skeleton.

pub fn skeleton_bone_set_transform(
    &self,
    skeleton: Rid,
    bone: i64,
    transform: Transform
)
[src]

Sets the Transform for a specific bone of this skeleton.

pub fn skeleton_bone_set_transform_2d(
    &self,
    skeleton: Rid,
    bone: i64,
    transform: Transform2D
)
[src]

Sets the Transform2D for a specific bone of this skeleton.

pub fn skeleton_create(&self) -> Rid[src]

Creates a skeleton and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all skeleton_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn skeleton_get_bone_count(&self, skeleton: Rid) -> i64[src]

Returns the number of bones allocated for this skeleton.

pub fn sky_create(&self) -> Rid[src]

Creates an empty sky and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all sky_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn sky_set_texture(&self, sky: Rid, cube_map: Rid, radiance_size: i64)[src]

Sets a sky's texture.

pub fn spot_light_create(&self) -> Rid[src]

Creates a spot light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method. To place in a scene, attach this spot light to an instance using [method instance_set_base] using the returned RID.

pub fn sync(&self)[src]

Not implemented in Godot 3.x.

pub fn texture_allocate(
    &self,
    texture: Rid,
    width: i64,
    height: i64,
    depth_3d: i64,
    format: i64,
    _type: i64,
    flags: i64
)
[src]

Allocates the GPU memory for the texture.

Default Arguments

  • flags - 7

pub fn texture_bind(&self, texture: Rid, number: i64)[src]

Binds the texture to a texture slot.

pub fn texture_create(&self) -> Rid[src]

Creates an empty texture and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all texture_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn texture_create_from_image(
    &self,
    image: impl AsArg<Image>,
    flags: i64
) -> Rid
[src]

Creates a texture, allocates the space for an image, and fills in the image.

Default Arguments

  • flags - 7

pub fn texture_debug_usage(&self) -> VariantArray[src]

Returns a list of all the textures and their information.

pub fn texture_get_data(
    &self,
    texture: Rid,
    cube_side: i64
) -> Option<Ref<Image, Shared>>
[src]

Returns a copy of a texture's image unless it's a CubeMap, in which case it returns the [RID] of the image at one of the cubes sides.

Default Arguments

  • cube_side - 0

pub fn texture_get_depth(&self, texture: Rid) -> i64[src]

Returns the depth of the texture.

pub fn texture_get_flags(&self, texture: Rid) -> i64[src]

Returns the flags of a texture.

pub fn texture_get_format(&self, texture: Rid) -> Format[src]

Returns the format of the texture's image.

pub fn texture_get_height(&self, texture: Rid) -> i64[src]

Returns the texture's height.

pub fn texture_get_path(&self, texture: Rid) -> GodotString[src]

Returns the texture's path.

pub fn texture_get_texid(&self, texture: Rid) -> i64[src]

Returns the opengl id of the texture's image.

pub fn texture_get_type(&self, texture: Rid) -> TextureType[src]

Returns the type of the texture, can be any of the [enum TextureType].

pub fn texture_get_width(&self, texture: Rid) -> i64[src]

Returns the texture's width.

pub fn texture_set_data(
    &self,
    texture: Rid,
    image: impl AsArg<Image>,
    layer: i64
)
[src]

Sets the texture's image data. If it's a CubeMap, it sets the image data at a cube side.

Default Arguments

  • layer - 0

pub fn texture_set_data_partial(
    &self,
    texture: Rid,
    image: impl AsArg<Image>,
    src_x: i64,
    src_y: i64,
    src_w: i64,
    src_h: i64,
    dst_x: i64,
    dst_y: i64,
    dst_mip: i64,
    layer: i64
)
[src]

Sets a part of the data for a texture. Warning: this function calls the underlying graphics API directly and may corrupt your texture if used improperly.

Default Arguments

  • layer - 0

pub fn texture_set_flags(&self, texture: Rid, flags: i64)[src]

Sets the texture's flags. See [enum TextureFlags] for options.

pub fn texture_set_path(&self, texture: Rid, path: impl Into<GodotString>)[src]

Sets the texture's path.

pub fn texture_set_shrink_all_x2_on_set_data(&self, shrink: bool)[src]

If true, sets internal processes to shrink all image data to half the size.

pub fn texture_set_size_override(
    &self,
    texture: Rid,
    width: i64,
    height: i64,
    depth: i64
)
[src]

Resizes the texture to the specified dimensions.

pub fn textures_keep_original(&self, enable: bool)[src]

If true, the image will be stored in the texture's images array if overwritten.

pub fn viewport_attach_camera(&self, viewport: Rid, camera: Rid)[src]

Sets a viewport's camera.

pub fn viewport_attach_canvas(&self, viewport: Rid, canvas: Rid)[src]

Sets a viewport's canvas.

pub fn viewport_attach_to_screen(&self, viewport: Rid, rect: Rect2, screen: i64)[src]

Sample code is GDScript unless otherwise noted.

Copies viewport to a region of the screen specified by rect. If [member Viewport.render_direct_to_screen] is true, then viewport does not use a framebuffer and the contents of the viewport are rendered directly to screen. However, note that the root viewport is drawn last, therefore it will draw over the screen. Accordingly, you must set the root viewport to an area that does not cover the area that you have attached this viewport to. For example, you can set the root viewport to not render at all with the following code:

func _ready():
    get_viewport().set_attach_to_screen_rect(Rect2())
    $Viewport.set_attach_to_screen_rect(Rect2(0, 0, 600, 600))

Using this can result in significant optimization, especially on lower-end devices. However, it comes at the cost of having to manage your viewports manually. For a further optimization see, [method viewport_set_render_direct_to_screen].

Default Arguments

  • rect - Rect2( 0, 0, 0, 0 )
  • screen - 0

pub fn viewport_create(&self) -> Rid[src]

Creates an empty viewport and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all viewport_* VisualServer functions. Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.

pub fn viewport_detach(&self, viewport: Rid)[src]

Detaches the viewport from the screen.

pub fn viewport_get_render_info(&self, viewport: Rid, info: i64) -> i64[src]

Returns a viewport's render information. For options, see the [enum ViewportRenderInfo] constants.

pub fn viewport_get_texture(&self, viewport: Rid) -> Rid[src]

Returns the viewport's last rendered frame.

pub fn viewport_remove_canvas(&self, viewport: Rid, canvas: Rid)[src]

Detaches a viewport from a canvas and vice versa.

pub fn viewport_set_active(&self, viewport: Rid, active: bool)[src]

If true, sets the viewport active, else sets it inactive.

pub fn viewport_set_canvas_stacking(
    &self,
    viewport: Rid,
    canvas: Rid,
    layer: i64,
    sublayer: i64
)
[src]

Sets the stacking order for a viewport's canvas. layer is the actual canvas layer, while sublayer specifies the stacking order of the canvas among those in the same layer.

pub fn viewport_set_canvas_transform(
    &self,
    viewport: Rid,
    canvas: Rid,
    offset: Transform2D
)
[src]

Sets the transformation of a viewport's canvas.

pub fn viewport_set_clear_mode(&self, viewport: Rid, clear_mode: i64)[src]

Sets the clear mode of a viewport. See [enum ViewportClearMode] for options.

pub fn viewport_set_debug_draw(&self, viewport: Rid, draw: i64)[src]

Sets the debug draw mode of a viewport. See [enum ViewportDebugDraw] for options.

pub fn viewport_set_disable_3d(&self, viewport: Rid, disabled: bool)[src]

If true, a viewport's 3D rendering is disabled.

pub fn viewport_set_disable_environment(&self, viewport: Rid, disabled: bool)[src]

If true, rendering of a viewport's environment is disabled.

pub fn viewport_set_global_canvas_transform(
    &self,
    viewport: Rid,
    transform: Transform2D
)
[src]

Sets the viewport's global transformation matrix.

pub fn viewport_set_hdr(&self, viewport: Rid, enabled: bool)[src]

If true, the viewport renders to hdr.

pub fn viewport_set_hide_canvas(&self, viewport: Rid, hidden: bool)[src]

If true, the viewport's canvas is not rendered.

pub fn viewport_set_hide_scenario(&self, viewport: Rid, hidden: bool)[src]

Currently unimplemented in Godot 3.x.

pub fn viewport_set_msaa(&self, viewport: Rid, msaa: i64)[src]

Sets the anti-aliasing mode. See [enum ViewportMSAA] for options.

pub fn viewport_set_parent_viewport(&self, viewport: Rid, parent_viewport: Rid)[src]

Sets the viewport's parent to another viewport.

pub fn viewport_set_render_direct_to_screen(&self, viewport: Rid, enabled: bool)[src]

If true, render the contents of the viewport directly to screen. This allows a low-level optimization where you can skip drawing a viewport to the root viewport. While this optimization can result in a significant increase in speed (especially on older devices), it comes at a cost of usability. When this is enabled, you cannot read from the viewport or from the SCREEN_TEXTURE. You also lose the benefit of certain window settings, such as the various stretch modes. Another consequence to be aware of is that in 2D the rendering happens in window coordinates, so if you have a viewport that is double the size of the window, and you set this, then only the portion that fits within the window will be drawn, no automatic scaling is possible, even if your game scene is significantly larger than the window size.

pub fn viewport_set_scenario(&self, viewport: Rid, scenario: Rid)[src]

Sets a viewport's scenario. The scenario contains information about the [enum ScenarioDebugMode], environment information, reflection atlas etc.

pub fn viewport_set_shadow_atlas_quadrant_subdivision(
    &self,
    viewport: Rid,
    quadrant: i64,
    subdivision: i64
)
[src]

Sets the shadow atlas quadrant's subdivision.

pub fn viewport_set_shadow_atlas_size(&self, viewport: Rid, size: i64)[src]

Sets the size of the shadow atlas's images (used for omni and spot lights). The value will be rounded up to the nearest power of 2.

pub fn viewport_set_size(&self, viewport: Rid, width: i64, height: i64)[src]

Sets the viewport's width and height.

pub fn viewport_set_transparent_background(&self, viewport: Rid, enabled: bool)[src]

If true, the viewport renders its background as transparent.

pub fn viewport_set_update_mode(&self, viewport: Rid, update_mode: i64)[src]

Sets when the viewport should be updated. See [enum ViewportUpdateMode] constants for options.

pub fn viewport_set_usage(&self, viewport: Rid, usage: i64)[src]

Sets the viewport's 2D/3D mode. See [enum ViewportUsage] constants for options.

pub fn viewport_set_use_arvr(&self, viewport: Rid, use_arvr: bool)[src]

If true, the viewport uses augmented or virtual reality technologies. See ARVRInterface.

pub fn viewport_set_vflip(&self, viewport: Rid, enabled: bool)[src]

If true, the viewport's rendering is flipped vertically.

Methods from Deref<Target = Object>

pub fn add_user_signal(
    &self,
    signal: impl Into<GodotString>,
    arguments: VariantArray
)
[src]

Adds a user-defined signal. Arguments are optional, but can be added as an [Array] of dictionaries, each containing name: String and type: int (see [enum Variant.Type]) entries.

Default Arguments

  • arguments - [ ]

pub unsafe fn call(
    &self,
    method: impl Into<GodotString>,
    varargs: &[Variant]
) -> Variant
[src]

Sample code is GDScript unless otherwise noted.

Calls the method on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:

call("set", "position", Vector2(42.0, 0.0))

Note: In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).

Safety

This function bypasses Rust's static type checks (aliasing, thread boundaries, calls to free(), ...).

pub unsafe fn call_deferred(
    &self,
    method: impl Into<GodotString>,
    varargs: &[Variant]
) -> Variant
[src]

Sample code is GDScript unless otherwise noted.

Calls the method on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:

call_deferred("set", "position", Vector2(42.0, 0.0))

Note: In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).

Safety

This function bypasses Rust's static type checks (aliasing, thread boundaries, calls to free(), ...).

pub unsafe fn callv(
    &self,
    method: impl Into<GodotString>,
    arg_array: VariantArray
) -> Variant
[src]

Sample code is GDScript unless otherwise noted.

Calls the method on the object and returns the result. Contrarily to [method call], this method does not support a variable number of arguments but expects all parameters to be via a single [Array].

callv("set", [ "position", Vector2(42.0, 0.0) ])

Safety

This function bypasses Rust's static type checks (aliasing, thread boundaries, calls to free(), ...).

pub fn can_translate_messages(&self) -> bool[src]

Returns true if the object can translate strings. See [method set_message_translation] and [method tr].

pub fn connect(
    &self,
    signal: impl Into<GodotString>,
    target: impl AsArg<Object>,
    method: impl Into<GodotString>,
    binds: VariantArray,
    flags: i64
) -> GodotResult
[src]

Sample code is GDScript unless otherwise noted.

Connects a signal to a method on a target object. Pass optional binds to the call as an [Array] of parameters. These parameters will be passed to the method after any parameter used in the call to [method emit_signal]. Use flags to set deferred or one-shot connections. See [enum ConnectFlags] constants. A signal can only be connected once to a method. It will throw an error if already connected, unless the signal was connected with [constant CONNECT_REFERENCE_COUNTED]. To avoid this, first, use [method is_connected] to check for existing connections. If the target is destroyed in the game's lifecycle, the connection will be lost. Examples:

connect("pressed", self, "_on_Button_pressed") # BaseButton signal
connect("text_entered", self, "_on_LineEdit_text_entered") # LineEdit signal
connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # User-defined signal

An example of the relationship between binds passed to [method connect] and parameters used when calling [method emit_signal]:

connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # weapon_type and damage are passed last
emit_signal("hit", "Dark lord", 5) # "Dark lord" and 5 are passed first
func _on_Player_hit(hit_by, level, weapon_type, damage):
    print("Hit by %s (lvl %d) with weapon %s for %d damage" % [hit_by, level, weapon_type, damage])

Default Arguments

  • binds - [ ]
  • flags - 0

pub fn disconnect(
    &self,
    signal: impl Into<GodotString>,
    target: impl AsArg<Object>,
    method: impl Into<GodotString>
)
[src]

Disconnects a signal from a method on the given target. If you try to disconnect a connection that does not exist, the method will throw an error. Use [method is_connected] to ensure that the connection exists.

pub fn emit_signal(
    &self,
    signal: impl Into<GodotString>,
    varargs: &[Variant]
) -> Variant
[src]

Sample code is GDScript unless otherwise noted.

Emits the given signal. The signal must exist, so it should be a built-in signal of this class or one of its parent classes, or a user-defined signal. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:

emit_signal("hit", weapon_type, damage)
emit_signal("game_over")

pub fn get(&self, property: impl Into<GodotString>) -> Variant[src]

Returns the Variant value of the given property. If the property doesn't exist, this will return null. Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

pub fn get_class(&self) -> GodotString[src]

Returns the object's class as a String.

pub fn get_incoming_connections(&self) -> VariantArray[src]

Returns an [Array] of dictionaries with information about signals that are connected to the object. Each Dictionary contains three String entries:

  • source is a reference to the signal emitter.
  • signal_name is the name of the connected signal.
  • method_name is the name of the method to which the signal is connected.

pub fn get_indexed(&self, property: impl Into<NodePath>) -> Variant[src]

Gets the object's property indexed by the given NodePath. The node path should be relative to the current object and can use the colon character (:) to access nested properties. Examples: "position:x" or "material:next_pass:blend_mode".

pub fn get_instance_id(&self) -> i64[src]

Returns the object's unique instance ID. This ID can be saved in EncodedObjectAsID, and can be used to retrieve the object instance with [method @GDScript.instance_from_id].

pub fn get_meta(&self, name: impl Into<GodotString>) -> Variant[src]

Returns the object's metadata entry for the given name.

pub fn get_meta_list(&self) -> StringArray[src]

Returns the object's metadata as a [PoolStringArray].

pub fn get_method_list(&self) -> VariantArray[src]

Returns the object's methods and their signatures as an [Array].

pub fn get_property_list(&self) -> VariantArray[src]

Returns the object's property list as an [Array] of dictionaries. Each property's Dictionary contain at least name: String and type: int (see [enum Variant.Type]) entries. Optionally, it can also include hint: int (see [enum PropertyHint]), hint_string: String, and usage: int (see [enum PropertyUsageFlags]).

pub fn get_script(&self) -> Option<Ref<Reference, Shared>>[src]

Returns the object's Script instance, or null if none is assigned.

pub fn get_signal_connection_list(
    &self,
    signal: impl Into<GodotString>
) -> VariantArray
[src]

Returns an [Array] of connections for the given signal.

pub fn get_signal_list(&self) -> VariantArray[src]

Returns the list of signals as an [Array] of dictionaries.

pub fn has_meta(&self, name: impl Into<GodotString>) -> bool[src]

Returns true if a metadata entry is found with the given name.

pub fn has_method(&self, method: impl Into<GodotString>) -> bool[src]

Returns true if the object contains the given method.

pub fn has_signal(&self, signal: impl Into<GodotString>) -> bool[src]

Returns true if the given signal exists.

pub fn has_user_signal(&self, signal: impl Into<GodotString>) -> bool[src]

Returns true if the given user-defined signal exists. Only signals added using [method add_user_signal] are taken into account.

pub fn is_blocking_signals(&self) -> bool[src]

Returns true if signal emission blocking is enabled.

pub fn is_class(&self, class: impl Into<GodotString>) -> bool[src]

Returns true if the object inherits from the given class.

pub fn is_connected(
    &self,
    signal: impl Into<GodotString>,
    target: impl AsArg<Object>,
    method: impl Into<GodotString>
) -> bool
[src]

Returns true if a connection exists for a given signal, target, and method.

pub fn is_queued_for_deletion(&self) -> bool[src]

Returns true if the [method Node.queue_free] method was called for the object.

pub fn notification(&self, what: i64, reversed: bool)[src]

Send a given notification to the object, which will also trigger a call to the [method _notification] method of all classes that the object inherits from. If reversed is true, [method _notification] is called first on the object's own class, and then up to its successive parent classes. If reversed is false, [method _notification] is called first on the highest ancestor (Object itself), and then down to its successive inheriting classes.

Default Arguments

  • reversed - false

pub fn property_list_changed_notify(&self)[src]

Notify the editor that the property list has changed, so that editor plugins can take the new values into account. Does nothing on export builds.

pub fn remove_meta(&self, name: impl Into<GodotString>)[src]

Removes a given entry from the object's metadata. See also [method set_meta].

pub fn set(&self, property: impl Into<GodotString>, value: impl OwnedToVariant)[src]

Assigns a new value to the given property. If the property does not exist, nothing will happen. Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

pub fn set_block_signals(&self, enable: bool)[src]

If set to true, signal emission is blocked.

pub fn set_deferred(
    &self,
    property: impl Into<GodotString>,
    value: impl OwnedToVariant
)
[src]

Assigns a new value to the given property, after the current frame's physics step. This is equivalent to calling [method set] via [method call_deferred], i.e. call_deferred("set", property, value). Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

pub fn set_indexed(
    &self,
    property: impl Into<NodePath>,
    value: impl OwnedToVariant
)
[src]

Sample code is GDScript unless otherwise noted.

Assigns a new value to the property identified by the NodePath. The node path should be relative to the current object and can use the colon character (:) to access nested properties. Example:

set_indexed("position", Vector2(42, 0))
set_indexed("position:y", -10)
print(position) # (42, -10)

pub fn set_message_translation(&self, enable: bool)[src]

Defines whether the object can translate strings (with calls to [method tr]). Enabled by default.

pub fn set_meta(&self, name: impl Into<GodotString>, value: impl OwnedToVariant)[src]

Adds, changes or removes a given entry in the object's metadata. Metadata are serialized and can take any Variant value. To remove a given entry from the object's metadata, use [method remove_meta]. Metadata is also removed if its value is set to null. This means you can also use set_meta("name", null) to remove metadata for "name".

pub fn set_script(&self, script: impl AsArg<Reference>)[src]

Assigns a script to the object. Each object can have a single script assigned to it, which are used to extend its functionality. If the object already had a script, the previous script instance will be freed and its variables and state will be lost. The new script's [method _init] method will be called.

pub fn to_string(&self) -> GodotString[src]

Returns a String representing the object. If not overridden, defaults to "[ClassName:RID]". Override the method [method _to_string] to customize the String representation.

pub fn tr(&self, message: impl Into<GodotString>) -> GodotString[src]

Translates a message using translation catalogs configured in the Project Settings. Only works if message translation is enabled (which it is by default), otherwise it returns the message unchanged. See [method set_message_translation].

Trait Implementations

impl Debug for VisualServer[src]

impl Deref for VisualServer[src]

type Target = Object

The resulting type after dereferencing.

impl DerefMut for VisualServer[src]

impl GodotObject for VisualServer[src]

type RefKind = ManuallyManaged

The memory management kind of this type. This modifies the behavior of the Ref smart pointer. See its type-level documentation for more information. Read more

impl Sealed for VisualServer[src]

impl SubClass<Object> for VisualServer[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SubClass<T> for T where
    T: GodotObject
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.