Struct CpuParticles2D
#[repr(C)]pub struct CpuParticles2D { /* private fields */ }
Expand description
Godot class CPUParticles2D.
Inherits Node2D
.
Related symbols:
cpu_particles_2d
: sidecar module with related enum/flag typesICpuParticles2D
: virtual methodsSignalsOfCpuParticles2D
: signal collection
See also Godot docs for CPUParticles2D
.
§Construction
This class is manually managed. You can create a new instance using CpuParticles2D::new_alloc()
.
Do not forget to call free()
or hand over ownership to Godot.
Implementations§
§impl CpuParticles2D
impl CpuParticles2D
pub fn set_emitting(&mut self, emitting: bool)
pub fn set_amount(&mut self, amount: i32)
pub fn set_lifetime(&mut self, secs: f64)
pub fn set_one_shot(&mut self, enable: bool)
pub fn set_pre_process_time(&mut self, secs: f64)
pub fn set_explosiveness_ratio(&mut self, ratio: f32)
pub fn set_randomness_ratio(&mut self, ratio: f32)
pub fn set_lifetime_randomness(&mut self, random: f64)
pub fn set_use_local_coordinates(&mut self, enable: bool)
pub fn set_fixed_fps(&mut self, fps: i32)
pub fn set_fractional_delta(&mut self, enable: bool)
pub fn set_speed_scale(&mut self, scale: f64)
pub fn request_particles_process(&mut self, process_time: f32)
pub fn is_emitting(&self) -> bool
pub fn get_amount(&self) -> i32
pub fn get_lifetime(&self) -> f64
pub fn get_one_shot(&self) -> bool
pub fn get_pre_process_time(&self) -> f64
pub fn get_explosiveness_ratio(&self) -> f32
pub fn get_randomness_ratio(&self) -> f32
pub fn get_lifetime_randomness(&self) -> f64
pub fn get_use_local_coordinates(&self) -> bool
pub fn get_fixed_fps(&self) -> i32
pub fn get_fractional_delta(&self) -> bool
pub fn get_speed_scale(&self) -> f64
pub fn set_use_fixed_seed(&mut self, use_fixed_seed: bool)
pub fn get_use_fixed_seed(&self) -> bool
pub fn set_seed(&mut self, seed: u32)
pub fn get_seed(&self) -> u32
pub fn set_draw_order(&mut self, order: DrawOrder)
pub fn get_draw_order(&self) -> DrawOrder
pub fn set_texture(&mut self, texture: impl AsArg<Option<Gd<Texture2D>>>)
pub fn get_texture(&self) -> Option<Gd<Texture2D>>
pub fn restart(&mut self)
pub fn restart(&mut self)
To set the default parameters, use Self::restart_ex
and its builder methods. See the book for detailed usage instructions.
pub fn restart_ex<'a>(&'a mut self) -> ExRestart<'a>
pub fn set_direction(&mut self, direction: Vector2)
pub fn get_direction(&self) -> Vector2
pub fn set_spread(&mut self, spread: f32)
pub fn get_spread(&self) -> f32
pub fn set_param_min(&mut self, param: Parameter, value: f32)
pub fn get_param_min(&self, param: Parameter) -> f32
pub fn set_param_max(&mut self, param: Parameter, value: f32)
pub fn get_param_max(&self, param: Parameter) -> f32
pub fn set_param_curve( &mut self, param: Parameter, curve: impl AsArg<Option<Gd<Curve>>>, )
pub fn get_param_curve(&self, param: Parameter) -> Option<Gd<Curve>>
pub fn set_color(&mut self, color: Color)
pub fn get_color(&self) -> Color
pub fn set_color_ramp(&mut self, ramp: impl AsArg<Option<Gd<Gradient>>>)
pub fn get_color_ramp(&self) -> Option<Gd<Gradient>>
pub fn set_color_initial_ramp(&mut self, ramp: impl AsArg<Option<Gd<Gradient>>>)
pub fn get_color_initial_ramp(&self) -> Option<Gd<Gradient>>
pub fn set_particle_flag(&mut self, particle_flag: ParticleFlags, enable: bool)
pub fn get_particle_flag(&self, particle_flag: ParticleFlags) -> bool
pub fn set_emission_shape(&mut self, shape: EmissionShape)
pub fn get_emission_shape(&self) -> EmissionShape
pub fn set_emission_sphere_radius(&mut self, radius: f32)
pub fn get_emission_sphere_radius(&self) -> f32
pub fn set_emission_rect_extents(&mut self, extents: Vector2)
pub fn get_emission_rect_extents(&self) -> Vector2
pub fn set_emission_points(&mut self, array: &PackedArray<Vector2>)
pub fn get_emission_points(&self) -> PackedArray<Vector2>
pub fn set_emission_normals(&mut self, array: &PackedArray<Vector2>)
pub fn get_emission_normals(&self) -> PackedArray<Vector2>
pub fn set_emission_colors(&mut self, array: &PackedArray<Color>)
pub fn get_emission_colors(&self) -> PackedArray<Color>
pub fn get_gravity(&self) -> Vector2
pub fn set_gravity(&mut self, accel_vec: Vector2)
pub fn get_split_scale(&mut self) -> bool
pub fn set_split_scale(&mut self, split_scale: bool)
pub fn get_scale_curve_x(&self) -> Option<Gd<Curve>>
pub fn set_scale_curve_x(&mut self, scale_curve: impl AsArg<Option<Gd<Curve>>>)
pub fn get_scale_curve_y(&self) -> Option<Gd<Curve>>
pub fn set_scale_curve_y(&mut self, scale_curve: impl AsArg<Option<Gd<Curve>>>)
pub fn convert_from_particles( &mut self, particles: impl AsArg<Option<Gd<Node>>>, )
Methods from Deref<Target = Node2D>§
pub fn set_position(&mut self, position: Vector2)
pub fn set_rotation(&mut self, radians: f32)
pub fn set_rotation_degrees(&mut self, degrees: f32)
pub fn set_skew(&mut self, radians: f32)
pub fn set_scale(&mut self, scale: Vector2)
pub fn get_position(&self) -> Vector2
pub fn get_rotation(&self) -> f32
pub fn get_rotation_degrees(&self) -> f32
pub fn get_skew(&self) -> f32
pub fn get_scale(&self) -> Vector2
pub fn rotate(&mut self, radians: f32)
pub fn move_local_x(&mut self, delta: f32)
pub fn move_local_x(&mut self, delta: f32)
To set the default parameters, use Self::move_local_x_ex
and its builder methods. See the book for detailed usage instructions.
pub fn move_local_x_ex<'a>(&'a mut self, delta: f32) -> ExMoveLocalX<'a>
pub fn move_local_y(&mut self, delta: f32)
pub fn move_local_y(&mut self, delta: f32)
To set the default parameters, use Self::move_local_y_ex
and its builder methods. See the book for detailed usage instructions.
pub fn move_local_y_ex<'a>(&'a mut self, delta: f32) -> ExMoveLocalY<'a>
pub fn translate(&mut self, offset: Vector2)
pub fn global_translate(&mut self, offset: Vector2)
pub fn apply_scale(&mut self, ratio: Vector2)
pub fn set_global_position(&mut self, position: Vector2)
pub fn get_global_position(&self) -> Vector2
pub fn set_global_rotation(&mut self, radians: f32)
pub fn set_global_rotation_degrees(&mut self, degrees: f32)
pub fn get_global_rotation(&self) -> f32
pub fn get_global_rotation_degrees(&self) -> f32
pub fn set_global_skew(&mut self, radians: f32)
pub fn get_global_skew(&self) -> f32
pub fn set_global_scale(&mut self, scale: Vector2)
pub fn get_global_scale(&self) -> Vector2
pub fn set_transform(&mut self, xform: Transform2D)
pub fn set_global_transform(&mut self, xform: Transform2D)
pub fn look_at(&mut self, point: Vector2)
pub fn get_angle_to(&self, point: Vector2) -> f32
pub fn to_local(&self, global_point: Vector2) -> Vector2
pub fn to_global(&self, local_point: Vector2) -> Vector2
pub fn get_relative_transform_to_parent( &self, parent: impl AsArg<Option<Gd<Node>>>, ) -> Transform2D
Methods from Deref<Target = CanvasItem>§
pub fn get_canvas_item(&self) -> Rid
pub fn set_visible(&mut self, visible: bool)
pub fn is_visible(&self) -> bool
pub fn is_visible_in_tree(&self) -> bool
pub fn show(&mut self)
pub fn hide(&mut self)
pub fn queue_redraw(&mut self)
pub fn move_to_front(&mut self)
pub fn set_as_top_level(&mut self, enable: bool)
pub fn is_set_as_top_level(&self) -> bool
pub fn set_light_mask(&mut self, light_mask: i32)
pub fn get_light_mask(&self) -> i32
pub fn set_modulate(&mut self, modulate: Color)
pub fn get_modulate(&self) -> Color
pub fn set_self_modulate(&mut self, self_modulate: Color)
pub fn get_self_modulate(&self) -> Color
pub fn set_z_index(&mut self, z_index: i32)
pub fn get_z_index(&self) -> i32
pub fn set_z_as_relative(&mut self, enable: bool)
pub fn is_z_relative(&self) -> bool
pub fn set_y_sort_enabled(&mut self, enabled: bool)
pub fn is_y_sort_enabled(&self) -> bool
pub fn set_draw_behind_parent(&mut self, enable: bool)
pub fn is_draw_behind_parent_enabled(&self) -> bool
pub fn draw_line(&mut self, from: Vector2, to: Vector2, color: Color)
pub fn draw_line(&mut self, from: Vector2, to: Vector2, color: Color)
To set the default parameters, use Self::draw_line_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_line_ex<'a>( &'a mut self, from: Vector2, to: Vector2, color: Color, ) -> ExDrawLine<'a>
pub fn draw_dashed_line(&mut self, from: Vector2, to: Vector2, color: Color)
pub fn draw_dashed_line(&mut self, from: Vector2, to: Vector2, color: Color)
To set the default parameters, use Self::draw_dashed_line_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_dashed_line_ex<'a>( &'a mut self, from: Vector2, to: Vector2, color: Color, ) -> ExDrawDashedLine<'a>
pub fn draw_polyline(&mut self, points: &PackedArray<Vector2>, color: Color)
pub fn draw_polyline(&mut self, points: &PackedArray<Vector2>, color: Color)
To set the default parameters, use Self::draw_polyline_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_polyline_ex<'a>( &'a mut self, points: &'a PackedArray<Vector2>, color: Color, ) -> ExDrawPolyline<'a>
pub fn draw_polyline_colors(
&mut self,
points: &PackedArray<Vector2>,
colors: &PackedArray<Color>,
)
pub fn draw_polyline_colors( &mut self, points: &PackedArray<Vector2>, colors: &PackedArray<Color>, )
To set the default parameters, use Self::draw_polyline_colors_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_polyline_colors_ex<'a>( &'a mut self, points: &'a PackedArray<Vector2>, colors: &'a PackedArray<Color>, ) -> ExDrawPolylineColors<'a>
pub fn draw_arc(
&mut self,
center: Vector2,
radius: f32,
start_angle: f32,
end_angle: f32,
point_count: i32,
color: Color,
)
pub fn draw_arc( &mut self, center: Vector2, radius: f32, start_angle: f32, end_angle: f32, point_count: i32, color: Color, )
To set the default parameters, use Self::draw_arc_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_arc_ex<'a>( &'a mut self, center: Vector2, radius: f32, start_angle: f32, end_angle: f32, point_count: i32, color: Color, ) -> ExDrawArc<'a>
pub fn draw_multiline(&mut self, points: &PackedArray<Vector2>, color: Color)
pub fn draw_multiline(&mut self, points: &PackedArray<Vector2>, color: Color)
To set the default parameters, use Self::draw_multiline_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_multiline_ex<'a>( &'a mut self, points: &'a PackedArray<Vector2>, color: Color, ) -> ExDrawMultiline<'a>
pub fn draw_multiline_colors(
&mut self,
points: &PackedArray<Vector2>,
colors: &PackedArray<Color>,
)
pub fn draw_multiline_colors( &mut self, points: &PackedArray<Vector2>, colors: &PackedArray<Color>, )
To set the default parameters, use Self::draw_multiline_colors_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_multiline_colors_ex<'a>( &'a mut self, points: &'a PackedArray<Vector2>, colors: &'a PackedArray<Color>, ) -> ExDrawMultilineColors<'a>
pub fn draw_rect(&mut self, rect: Rect2, color: Color)
pub fn draw_rect(&mut self, rect: Rect2, color: Color)
To set the default parameters, use Self::draw_rect_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_rect_ex<'a>( &'a mut self, rect: Rect2, color: Color, ) -> ExDrawRect<'a>
pub fn draw_circle(&mut self, position: Vector2, radius: f32, color: Color)
pub fn draw_circle(&mut self, position: Vector2, radius: f32, color: Color)
To set the default parameters, use Self::draw_circle_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_circle_ex<'a>( &'a mut self, position: Vector2, radius: f32, color: Color, ) -> ExDrawCircle<'a>
pub fn draw_texture(
&mut self,
texture: impl AsArg<Option<Gd<Texture2D>>>,
position: Vector2,
)
pub fn draw_texture( &mut self, texture: impl AsArg<Option<Gd<Texture2D>>>, position: Vector2, )
To set the default parameters, use Self::draw_texture_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_texture_ex<'a>( &'a mut self, texture: impl AsArg<Option<Gd<Texture2D>>> + 'a, position: Vector2, ) -> ExDrawTexture<'a>
pub fn draw_texture_rect(
&mut self,
texture: impl AsArg<Option<Gd<Texture2D>>>,
rect: Rect2,
tile: bool,
)
pub fn draw_texture_rect( &mut self, texture: impl AsArg<Option<Gd<Texture2D>>>, rect: Rect2, tile: bool, )
To set the default parameters, use Self::draw_texture_rect_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_texture_rect_ex<'a>( &'a mut self, texture: impl AsArg<Option<Gd<Texture2D>>> + 'a, rect: Rect2, tile: bool, ) -> ExDrawTextureRect<'a>
pub fn draw_texture_rect_region(
&mut self,
texture: impl AsArg<Option<Gd<Texture2D>>>,
rect: Rect2,
src_rect: Rect2,
)
pub fn draw_texture_rect_region( &mut self, texture: impl AsArg<Option<Gd<Texture2D>>>, rect: Rect2, src_rect: Rect2, )
To set the default parameters, use Self::draw_texture_rect_region_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_texture_rect_region_ex<'a>( &'a mut self, texture: impl AsArg<Option<Gd<Texture2D>>> + 'a, rect: Rect2, src_rect: Rect2, ) -> ExDrawTextureRectRegion<'a>
pub fn draw_msdf_texture_rect_region(
&mut self,
texture: impl AsArg<Option<Gd<Texture2D>>>,
rect: Rect2,
src_rect: Rect2,
)
pub fn draw_msdf_texture_rect_region( &mut self, texture: impl AsArg<Option<Gd<Texture2D>>>, rect: Rect2, src_rect: Rect2, )
To set the default parameters, use Self::draw_msdf_texture_rect_region_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_msdf_texture_rect_region_ex<'a>( &'a mut self, texture: impl AsArg<Option<Gd<Texture2D>>> + 'a, rect: Rect2, src_rect: Rect2, ) -> ExDrawMsdfTextureRectRegion<'a>
pub fn draw_lcd_texture_rect_region(
&mut self,
texture: impl AsArg<Option<Gd<Texture2D>>>,
rect: Rect2,
src_rect: Rect2,
)
pub fn draw_lcd_texture_rect_region( &mut self, texture: impl AsArg<Option<Gd<Texture2D>>>, rect: Rect2, src_rect: Rect2, )
To set the default parameters, use Self::draw_lcd_texture_rect_region_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_lcd_texture_rect_region_ex<'a>( &'a mut self, texture: impl AsArg<Option<Gd<Texture2D>>> + 'a, rect: Rect2, src_rect: Rect2, ) -> ExDrawLcdTextureRectRegion<'a>
pub fn draw_style_box( &mut self, style_box: impl AsArg<Option<Gd<StyleBox>>>, rect: Rect2, )
pub fn draw_primitive(
&mut self,
points: &PackedArray<Vector2>,
colors: &PackedArray<Color>,
uvs: &PackedArray<Vector2>,
)
pub fn draw_primitive( &mut self, points: &PackedArray<Vector2>, colors: &PackedArray<Color>, uvs: &PackedArray<Vector2>, )
To set the default parameters, use Self::draw_primitive_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_primitive_ex<'a>( &'a mut self, points: &'a PackedArray<Vector2>, colors: &'a PackedArray<Color>, uvs: &'a PackedArray<Vector2>, ) -> ExDrawPrimitive<'a>
pub fn draw_polygon(
&mut self,
points: &PackedArray<Vector2>,
colors: &PackedArray<Color>,
)
pub fn draw_polygon( &mut self, points: &PackedArray<Vector2>, colors: &PackedArray<Color>, )
To set the default parameters, use Self::draw_polygon_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_polygon_ex<'a>( &'a mut self, points: &'a PackedArray<Vector2>, colors: &'a PackedArray<Color>, ) -> ExDrawPolygon<'a>
pub fn draw_colored_polygon(
&mut self,
points: &PackedArray<Vector2>,
color: Color,
)
pub fn draw_colored_polygon( &mut self, points: &PackedArray<Vector2>, color: Color, )
To set the default parameters, use Self::draw_colored_polygon_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_colored_polygon_ex<'a>( &'a mut self, points: &'a PackedArray<Vector2>, color: Color, ) -> ExDrawColoredPolygon<'a>
pub fn draw_string(
&self,
font: impl AsArg<Option<Gd<Font>>>,
pos: Vector2,
text: impl AsArg<GString>,
)
pub fn draw_string( &self, font: impl AsArg<Option<Gd<Font>>>, pos: Vector2, text: impl AsArg<GString>, )
To set the default parameters, use Self::draw_string_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_string_ex<'a>( &'a self, font: impl AsArg<Option<Gd<Font>>> + 'a, pos: Vector2, text: impl AsArg<GString> + 'a, ) -> ExDrawString<'a>
pub fn draw_multiline_string(
&self,
font: impl AsArg<Option<Gd<Font>>>,
pos: Vector2,
text: impl AsArg<GString>,
)
pub fn draw_multiline_string( &self, font: impl AsArg<Option<Gd<Font>>>, pos: Vector2, text: impl AsArg<GString>, )
To set the default parameters, use Self::draw_multiline_string_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_multiline_string_ex<'a>( &'a self, font: impl AsArg<Option<Gd<Font>>> + 'a, pos: Vector2, text: impl AsArg<GString> + 'a, ) -> ExDrawMultilineString<'a>
pub fn draw_string_outline(
&self,
font: impl AsArg<Option<Gd<Font>>>,
pos: Vector2,
text: impl AsArg<GString>,
)
pub fn draw_string_outline( &self, font: impl AsArg<Option<Gd<Font>>>, pos: Vector2, text: impl AsArg<GString>, )
To set the default parameters, use Self::draw_string_outline_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_string_outline_ex<'a>( &'a self, font: impl AsArg<Option<Gd<Font>>> + 'a, pos: Vector2, text: impl AsArg<GString> + 'a, ) -> ExDrawStringOutline<'a>
pub fn draw_multiline_string_outline(
&self,
font: impl AsArg<Option<Gd<Font>>>,
pos: Vector2,
text: impl AsArg<GString>,
)
pub fn draw_multiline_string_outline( &self, font: impl AsArg<Option<Gd<Font>>>, pos: Vector2, text: impl AsArg<GString>, )
To set the default parameters, use Self::draw_multiline_string_outline_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_multiline_string_outline_ex<'a>( &'a self, font: impl AsArg<Option<Gd<Font>>> + 'a, pos: Vector2, text: impl AsArg<GString> + 'a, ) -> ExDrawMultilineStringOutline<'a>
pub fn draw_char(
&self,
font: impl AsArg<Option<Gd<Font>>>,
pos: Vector2,
char: impl AsArg<GString>,
)
pub fn draw_char( &self, font: impl AsArg<Option<Gd<Font>>>, pos: Vector2, char: impl AsArg<GString>, )
To set the default parameters, use Self::draw_char_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_char_ex<'a>( &'a self, font: impl AsArg<Option<Gd<Font>>> + 'a, pos: Vector2, char: impl AsArg<GString> + 'a, ) -> ExDrawChar<'a>
pub fn draw_char_outline(
&self,
font: impl AsArg<Option<Gd<Font>>>,
pos: Vector2,
char: impl AsArg<GString>,
)
pub fn draw_char_outline( &self, font: impl AsArg<Option<Gd<Font>>>, pos: Vector2, char: impl AsArg<GString>, )
To set the default parameters, use Self::draw_char_outline_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_char_outline_ex<'a>( &'a self, font: impl AsArg<Option<Gd<Font>>> + 'a, pos: Vector2, char: impl AsArg<GString> + 'a, ) -> ExDrawCharOutline<'a>
pub fn draw_mesh(
&mut self,
mesh: impl AsArg<Option<Gd<Mesh>>>,
texture: impl AsArg<Option<Gd<Texture2D>>>,
)
pub fn draw_mesh( &mut self, mesh: impl AsArg<Option<Gd<Mesh>>>, texture: impl AsArg<Option<Gd<Texture2D>>>, )
To set the default parameters, use Self::draw_mesh_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_mesh_ex<'a>( &'a mut self, mesh: impl AsArg<Option<Gd<Mesh>>> + 'a, texture: impl AsArg<Option<Gd<Texture2D>>> + 'a, ) -> ExDrawMesh<'a>
pub fn draw_multimesh( &mut self, multimesh: impl AsArg<Option<Gd<MultiMesh>>>, texture: impl AsArg<Option<Gd<Texture2D>>>, )
pub fn draw_set_transform(&mut self, position: Vector2)
pub fn draw_set_transform(&mut self, position: Vector2)
To set the default parameters, use Self::draw_set_transform_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_set_transform_ex<'a>( &'a mut self, position: Vector2, ) -> ExDrawSetTransform<'a>
pub fn draw_set_transform_matrix(&mut self, xform: Transform2D)
pub fn draw_animation_slice(
&mut self,
animation_length: f64,
slice_begin: f64,
slice_end: f64,
)
pub fn draw_animation_slice( &mut self, animation_length: f64, slice_begin: f64, slice_end: f64, )
To set the default parameters, use Self::draw_animation_slice_ex
and its builder methods. See the book for detailed usage instructions.
pub fn draw_animation_slice_ex<'a>( &'a mut self, animation_length: f64, slice_begin: f64, slice_end: f64, ) -> ExDrawAnimationSlice<'a>
pub fn draw_end_animation(&mut self)
pub fn get_transform(&self) -> Transform2D
pub fn get_global_transform(&self) -> Transform2D
pub fn get_global_transform_with_canvas(&self) -> Transform2D
pub fn get_viewport_transform(&self) -> Transform2D
pub fn get_viewport_rect(&self) -> Rect2
pub fn get_canvas_transform(&self) -> Transform2D
pub fn get_screen_transform(&self) -> Transform2D
pub fn get_local_mouse_position(&self) -> Vector2
pub fn get_global_mouse_position(&self) -> Vector2
pub fn get_canvas(&self) -> Rid
pub fn get_canvas_layer_node(&self) -> Option<Gd<CanvasLayer>>
pub fn get_world_2d(&self) -> Option<Gd<World2D>>
pub fn set_material(&mut self, material: impl AsArg<Option<Gd<Material>>>)
pub fn get_material(&self) -> Option<Gd<Material>>
pub fn set_instance_shader_parameter( &mut self, name: impl AsArg<StringName>, value: &Variant, )
pub fn get_instance_shader_parameter( &self, name: impl AsArg<StringName>, ) -> Variant
pub fn set_use_parent_material(&mut self, enable: bool)
pub fn get_use_parent_material(&self) -> bool
pub fn set_notify_local_transform(&mut self, enable: bool)
pub fn is_local_transform_notification_enabled(&self) -> bool
pub fn set_notify_transform(&mut self, enable: bool)
pub fn is_transform_notification_enabled(&self) -> bool
pub fn force_update_transform(&mut self)
pub fn make_canvas_position_local(&self, viewport_point: Vector2) -> Vector2
pub fn make_input_local( &self, event: impl AsArg<Option<Gd<InputEvent>>>, ) -> Option<Gd<InputEvent>>
pub fn set_visibility_layer(&mut self, layer: u32)
pub fn get_visibility_layer(&self) -> u32
pub fn set_visibility_layer_bit(&mut self, layer: u32, enabled: bool)
pub fn get_visibility_layer_bit(&self, layer: u32) -> bool
pub fn set_texture_filter(&mut self, mode: TextureFilter)
pub fn get_texture_filter(&self) -> TextureFilter
pub fn set_texture_repeat(&mut self, mode: TextureRepeat)
pub fn get_texture_repeat(&self) -> TextureRepeat
pub fn set_clip_children_mode(&mut self, mode: ClipChildrenMode)
pub fn get_clip_children_mode(&self) -> ClipChildrenMode
pub fn notify(&mut self, what: CanvasItemNotification)
pub fn notify(&mut self, what: CanvasItemNotification)
⚠️ Sends a Godot notification to all classes inherited by the object.
Triggers calls to on_notification()
, and depending on the notification, also to Godot’s lifecycle callbacks such as ready()
.
Starts from the highest ancestor (the Object
class) and goes down the hierarchy.
See also Godot docs for Object::notification()
.
§Panics
If you call this method on a user-defined object while holding a GdRef
or GdMut
guard on the instance, you will encounter
a panic. The reason is that the receiving virtual method on_notification()
acquires a GdMut
lock dynamically, which must
be exclusive.
pub fn notify_reversed(&mut self, what: CanvasItemNotification)
pub fn notify_reversed(&mut self, what: CanvasItemNotification)
⚠️ Like Self::notify()
, but starts at the most-derived class and goes up the hierarchy.
See docs of that method, including the panics.
Methods from Deref<Target = Node>§
pub fn get_node_as<T>(&self, path: impl AsArg<NodePath>) -> Gd<T>
pub fn get_node_as<T>(&self, path: impl AsArg<NodePath>) -> Gd<T>
⚠️ Retrieves the node at path path
, panicking if not found or bad type.
§Panics
If the node is not found, or if it does not have type T
or inherited.
pub fn try_get_node_as<T>(&self, path: impl AsArg<NodePath>) -> Option<Gd<T>>
pub fn try_get_node_as<T>(&self, path: impl AsArg<NodePath>) -> Option<Gd<T>>
Retrieves the node at path path
(fallible).
If the node is not found, or if it does not have type T
or inherited,
None
will be returned.
pub fn add_sibling(&mut self, sibling: impl AsArg<Option<Gd<Node>>>)
pub fn add_sibling(&mut self, sibling: impl AsArg<Option<Gd<Node>>>)
To set the default parameters, use Self::add_sibling_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_sibling_ex<'a>( &'a mut self, sibling: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExAddSibling<'a>
pub fn set_name(&mut self, name: impl AsArg<GString>)
pub fn get_name(&self) -> StringName
pub fn add_child(&mut self, node: impl AsArg<Option<Gd<Node>>>)
pub fn add_child(&mut self, node: impl AsArg<Option<Gd<Node>>>)
To set the default parameters, use Self::add_child_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_child_ex<'a>( &'a mut self, node: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExAddChild<'a>
pub fn remove_child(&mut self, node: impl AsArg<Option<Gd<Node>>>)
pub fn reparent(&mut self, new_parent: impl AsArg<Option<Gd<Node>>>)
pub fn reparent(&mut self, new_parent: impl AsArg<Option<Gd<Node>>>)
To set the default parameters, use Self::reparent_ex
and its builder methods. See the book for detailed usage instructions.
pub fn reparent_ex<'a>( &'a mut self, new_parent: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExReparent<'a>
pub fn get_child_count(&self) -> i32
pub fn get_child_count(&self) -> i32
To set the default parameters, use Self::get_child_count_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_child_count_ex<'a>(&'a self) -> ExGetChildCount<'a>
pub fn get_children(&self) -> Array<Gd<Node>>
pub fn get_children(&self) -> Array<Gd<Node>>
To set the default parameters, use Self::get_children_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_children_ex<'a>(&'a self) -> ExGetChildren<'a>
pub fn get_child(&self, idx: i32) -> Option<Gd<Node>>
pub fn get_child(&self, idx: i32) -> Option<Gd<Node>>
To set the default parameters, use Self::get_child_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_child_ex<'a>(&'a self, idx: i32) -> ExGetChild<'a>
pub fn has_node(&self, path: impl AsArg<NodePath>) -> bool
pub fn get_node_or_null(&self, path: impl AsArg<NodePath>) -> Option<Gd<Node>>
pub fn get_parent(&self) -> Option<Gd<Node>>
pub fn find_child(&self, pattern: impl AsArg<GString>) -> Option<Gd<Node>>
pub fn find_child(&self, pattern: impl AsArg<GString>) -> Option<Gd<Node>>
To set the default parameters, use Self::find_child_ex
and its builder methods. See the book for detailed usage instructions.
pub fn find_child_ex<'a>( &'a self, pattern: impl AsArg<GString> + 'a, ) -> ExFindChild<'a>
pub fn find_children(&self, pattern: impl AsArg<GString>) -> Array<Gd<Node>>
pub fn find_children(&self, pattern: impl AsArg<GString>) -> Array<Gd<Node>>
To set the default parameters, use Self::find_children_ex
and its builder methods. See the book for detailed usage instructions.
pub fn find_children_ex<'a>( &'a self, pattern: impl AsArg<GString> + 'a, ) -> ExFindChildren<'a>
pub fn find_parent(&self, pattern: impl AsArg<GString>) -> Option<Gd<Node>>
pub fn has_node_and_resource(&self, path: impl AsArg<NodePath>) -> bool
pub fn get_node_and_resource( &mut self, path: impl AsArg<NodePath>, ) -> Array<Variant>
pub fn is_inside_tree(&self) -> bool
pub fn is_part_of_edited_scene(&self) -> bool
pub fn is_ancestor_of(&self, node: impl AsArg<Option<Gd<Node>>>) -> bool
pub fn is_greater_than(&self, node: impl AsArg<Option<Gd<Node>>>) -> bool
pub fn get_path(&self) -> NodePath
pub fn get_path_to(&self, node: impl AsArg<Option<Gd<Node>>>) -> NodePath
pub fn get_path_to(&self, node: impl AsArg<Option<Gd<Node>>>) -> NodePath
To set the default parameters, use Self::get_path_to_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_path_to_ex<'a>( &'a self, node: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExGetPathTo<'a>
pub fn add_to_group(&mut self, group: impl AsArg<StringName>)
pub fn add_to_group(&mut self, group: impl AsArg<StringName>)
To set the default parameters, use Self::add_to_group_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_to_group_ex<'a>( &'a mut self, group: impl AsArg<StringName> + 'a, ) -> ExAddToGroup<'a>
pub fn remove_from_group(&mut self, group: impl AsArg<StringName>)
pub fn is_in_group(&self, group: impl AsArg<StringName>) -> bool
pub fn move_child( &mut self, child_node: impl AsArg<Option<Gd<Node>>>, to_index: i32, )
pub fn get_groups(&self) -> Array<StringName>
pub fn set_owner(&mut self, owner: impl AsArg<Option<Gd<Node>>>)
pub fn get_owner(&self) -> Option<Gd<Node>>
pub fn get_index(&self) -> i32
pub fn get_index(&self) -> i32
To set the default parameters, use Self::get_index_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_index_ex<'a>(&'a self) -> ExGetIndex<'a>
pub fn print_tree(&mut self)
pub fn print_tree_pretty(&mut self)
pub fn get_tree_string(&mut self) -> GString
pub fn get_tree_string_pretty(&mut self) -> GString
pub fn set_scene_file_path(&mut self, scene_file_path: impl AsArg<GString>)
pub fn get_scene_file_path(&self) -> GString
pub fn propagate_notification(&mut self, what: i32)
pub fn propagate_call(&mut self, method: impl AsArg<StringName>)
pub fn propagate_call(&mut self, method: impl AsArg<StringName>)
To set the default parameters, use Self::propagate_call_ex
and its builder methods. See the book for detailed usage instructions.
pub fn propagate_call_ex<'a>( &'a mut self, method: impl AsArg<StringName> + 'a, ) -> ExPropagateCall<'a>
pub fn set_physics_process(&mut self, enable: bool)
pub fn get_physics_process_delta_time(&self) -> f64
pub fn is_physics_processing(&self) -> bool
pub fn get_process_delta_time(&self) -> f64
pub fn set_process(&mut self, enable: bool)
pub fn set_process_priority(&mut self, priority: i32)
pub fn get_process_priority(&self) -> i32
pub fn set_physics_process_priority(&mut self, priority: i32)
pub fn get_physics_process_priority(&self) -> i32
pub fn is_processing(&self) -> bool
pub fn set_process_input(&mut self, enable: bool)
pub fn is_processing_input(&self) -> bool
pub fn set_process_shortcut_input(&mut self, enable: bool)
pub fn is_processing_shortcut_input(&self) -> bool
pub fn set_process_unhandled_input(&mut self, enable: bool)
pub fn is_processing_unhandled_input(&self) -> bool
pub fn set_process_unhandled_key_input(&mut self, enable: bool)
pub fn is_processing_unhandled_key_input(&self) -> bool
pub fn set_process_mode(&mut self, mode: ProcessMode)
pub fn get_process_mode(&self) -> ProcessMode
pub fn can_process(&self) -> bool
pub fn set_process_thread_group(&mut self, mode: ProcessThreadGroup)
pub fn get_process_thread_group(&self) -> ProcessThreadGroup
pub fn set_process_thread_messages(&mut self, flags: ProcessThreadMessages)
pub fn get_process_thread_messages(&self) -> ProcessThreadMessages
pub fn set_process_thread_group_order(&mut self, order: i32)
pub fn get_process_thread_group_order(&self) -> i32
pub fn set_display_folded(&mut self, fold: bool)
pub fn is_displayed_folded(&self) -> bool
pub fn set_process_internal(&mut self, enable: bool)
pub fn is_processing_internal(&self) -> bool
pub fn set_physics_process_internal(&mut self, enable: bool)
pub fn is_physics_processing_internal(&self) -> bool
pub fn set_physics_interpolation_mode(&mut self, mode: PhysicsInterpolationMode)
pub fn get_physics_interpolation_mode(&self) -> PhysicsInterpolationMode
pub fn is_physics_interpolated(&self) -> bool
pub fn is_physics_interpolated_and_enabled(&self) -> bool
pub fn reset_physics_interpolation(&mut self)
pub fn set_auto_translate_mode(&mut self, mode: AutoTranslateMode)
pub fn get_auto_translate_mode(&self) -> AutoTranslateMode
pub fn set_translation_domain_inherited(&mut self)
pub fn get_window(&self) -> Option<Gd<Window>>
pub fn get_last_exclusive_window(&self) -> Option<Gd<Window>>
pub fn get_tree(&self) -> Option<Gd<SceneTree>>
pub fn create_tween(&mut self) -> Option<Gd<Tween>>
pub fn duplicate(&self) -> Option<Gd<Node>>
pub fn duplicate(&self) -> Option<Gd<Node>>
To set the default parameters, use Self::duplicate_ex
and its builder methods. See the book for detailed usage instructions.
pub fn duplicate_ex<'a>(&'a self) -> ExDuplicate<'a>
pub fn replace_by(&mut self, node: impl AsArg<Option<Gd<Node>>>)
pub fn replace_by(&mut self, node: impl AsArg<Option<Gd<Node>>>)
To set the default parameters, use Self::replace_by_ex
and its builder methods. See the book for detailed usage instructions.
pub fn replace_by_ex<'a>( &'a mut self, node: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExReplaceBy<'a>
pub fn set_scene_instance_load_placeholder(&mut self, load_placeholder: bool)
pub fn get_scene_instance_load_placeholder(&self) -> bool
pub fn set_editable_instance( &mut self, node: impl AsArg<Option<Gd<Node>>>, is_editable: bool, )
pub fn is_editable_instance(&self, node: impl AsArg<Option<Gd<Node>>>) -> bool
pub fn get_viewport(&self) -> Option<Gd<Viewport>>
pub fn queue_free(&mut self)
pub fn request_ready(&mut self)
pub fn is_node_ready(&self) -> bool
To set the default parameters, use Self::set_multiplayer_authority_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_multiplayer(&self) -> Option<Gd<MultiplayerApi>>
pub fn rpc_config(&mut self, method: impl AsArg<StringName>, config: &Variant)
pub fn get_rpc_config(&self) -> Variant
pub fn set_editor_description( &mut self, editor_description: impl AsArg<GString>, )
pub fn get_editor_description(&self) -> GString
pub fn set_unique_name_in_owner(&mut self, enable: bool)
pub fn is_unique_name_in_owner(&self) -> bool
pub fn atr(&self, message: impl AsArg<GString>) -> GString
pub fn atr(&self, message: impl AsArg<GString>) -> GString
To set the default parameters, use Self::atr_ex
and its builder methods. See the book for detailed usage instructions.
pub fn atr_ex<'a>(&'a self, message: impl AsArg<GString> + 'a) -> ExAtr<'a>
pub fn atr_n(
&self,
message: impl AsArg<GString>,
plural_message: impl AsArg<StringName>,
n: i32,
) -> GString
pub fn atr_n( &self, message: impl AsArg<GString>, plural_message: impl AsArg<StringName>, n: i32, ) -> GString
To set the default parameters, use Self::atr_n_ex
and its builder methods. See the book for detailed usage instructions.
pub fn atr_n_ex<'a>( &'a self, message: impl AsArg<GString> + 'a, plural_message: impl AsArg<StringName> + 'a, n: i32, ) -> ExAtrN<'a>
pub fn rpc(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Error
pub fn rpc( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Error
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_rpc(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Error, CallError>
pub fn try_rpc( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Error, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn rpc_id(
&mut self,
peer_id: i64,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Error
pub fn rpc_id( &mut self, peer_id: i64, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Error
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_rpc_id(
&mut self,
peer_id: i64,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Error, CallError>
pub fn try_rpc_id( &mut self, peer_id: i64, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Error, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn update_configuration_warnings(&mut self)
pub fn call_deferred_thread_group(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Variant
pub fn call_deferred_thread_group( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Variant
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_call_deferred_thread_group(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call_deferred_thread_group( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Variant, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn set_deferred_thread_group( &mut self, property: impl AsArg<StringName>, value: &Variant, )
pub fn notify_deferred_thread_group(&mut self, what: i32)
pub fn call_thread_safe(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Variant
pub fn call_thread_safe( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Variant
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_call_thread_safe(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call_thread_safe( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Variant, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn set_thread_safe( &mut self, property: impl AsArg<StringName>, value: &Variant, )
pub fn notify_thread_safe(&mut self, what: i32)
pub fn notify(&mut self, what: NodeNotification)
pub fn notify(&mut self, what: NodeNotification)
⚠️ Sends a Godot notification to all classes inherited by the object.
Triggers calls to on_notification()
, and depending on the notification, also to Godot’s lifecycle callbacks such as ready()
.
Starts from the highest ancestor (the Object
class) and goes down the hierarchy.
See also Godot docs for Object::notification()
.
§Panics
If you call this method on a user-defined object while holding a GdRef
or GdMut
guard on the instance, you will encounter
a panic. The reason is that the receiving virtual method on_notification()
acquires a GdMut
lock dynamically, which must
be exclusive.
pub fn notify_reversed(&mut self, what: NodeNotification)
pub fn notify_reversed(&mut self, what: NodeNotification)
⚠️ Like Self::notify()
, but starts at the most-derived class and goes up the hierarchy.
See docs of that method, including the panics.
Methods from Deref<Target = Object>§
pub fn get_script(&self) -> Option<Gd<Script>>
pub fn set_script(&mut self, script: impl AsArg<Option<Gd<Script>>>)
pub fn connect( &mut self, signal: impl AsArg<StringName>, callable: &Callable, ) -> Error
pub fn connect_flags( &mut self, signal: impl AsArg<StringName>, callable: &Callable, flags: ConnectFlags, ) -> Error
pub fn get_class(&self) -> GString
pub fn is_class(&self, class: impl AsArg<GString>) -> bool
pub fn set(&mut self, property: impl AsArg<StringName>, value: &Variant)
pub fn get(&self, property: impl AsArg<StringName>) -> Variant
pub fn set_indexed( &mut self, property_path: impl AsArg<NodePath>, value: &Variant, )
pub fn get_indexed(&self, property_path: impl AsArg<NodePath>) -> Variant
pub fn get_property_list(&self) -> Array<Dictionary>
pub fn get_method_list(&self) -> Array<Dictionary>
pub fn property_can_revert(&self, property: impl AsArg<StringName>) -> bool
pub fn property_get_revert(&self, property: impl AsArg<StringName>) -> Variant
pub fn set_meta(&mut self, name: impl AsArg<StringName>, value: &Variant)
pub fn remove_meta(&mut self, name: impl AsArg<StringName>)
pub fn get_meta(&self, name: impl AsArg<StringName>) -> Variant
pub fn get_meta(&self, name: impl AsArg<StringName>) -> Variant
To set the default parameters, use Self::get_meta_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_meta_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExGetMeta<'a>
pub fn has_meta(&self, name: impl AsArg<StringName>) -> bool
pub fn get_meta_list(&self) -> Array<StringName>
pub fn add_user_signal(&mut self, signal: impl AsArg<GString>)
pub fn add_user_signal(&mut self, signal: impl AsArg<GString>)
To set the default parameters, use Self::add_user_signal_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_user_signal_ex<'a>( &'a mut self, signal: impl AsArg<GString> + 'a, ) -> ExAddUserSignal<'a>
pub fn has_user_signal(&self, signal: impl AsArg<StringName>) -> bool
pub fn remove_user_signal(&mut self, signal: impl AsArg<StringName>)
pub fn emit_signal(
&mut self,
signal: impl AsArg<StringName>,
varargs: &[Variant],
) -> Error
pub fn emit_signal( &mut self, signal: impl AsArg<StringName>, varargs: &[Variant], ) -> Error
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_emit_signal(
&mut self,
signal: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Error, CallError>
pub fn try_emit_signal( &mut self, signal: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Error, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn call(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Variant
pub fn call( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Variant
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_call(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Variant, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn call_deferred(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Variant
pub fn call_deferred( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Variant
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_call_deferred(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call_deferred( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Variant, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn set_deferred( &mut self, property: impl AsArg<StringName>, value: &Variant, )
pub fn callv( &mut self, method: impl AsArg<StringName>, arg_array: &Array<Variant>, ) -> Variant
pub fn has_method(&self, method: impl AsArg<StringName>) -> bool
pub fn get_method_argument_count(&self, method: impl AsArg<StringName>) -> i32
pub fn has_signal(&self, signal: impl AsArg<StringName>) -> bool
pub fn get_signal_list(&self) -> Array<Dictionary>
pub fn get_signal_connection_list( &self, signal: impl AsArg<StringName>, ) -> Array<Dictionary>
pub fn get_incoming_connections(&self) -> Array<Dictionary>
pub fn disconnect( &mut self, signal: impl AsArg<StringName>, callable: &Callable, )
pub fn is_connected( &self, signal: impl AsArg<StringName>, callable: &Callable, ) -> bool
pub fn has_connections(&self, signal: impl AsArg<StringName>) -> bool
pub fn set_block_signals(&mut self, enable: bool)
pub fn is_blocking_signals(&self) -> bool
pub fn notify_property_list_changed(&mut self)
pub fn set_message_translation(&mut self, enable: bool)
pub fn can_translate_messages(&self) -> bool
pub fn tr(&self, message: impl AsArg<StringName>) -> GString
pub fn tr(&self, message: impl AsArg<StringName>) -> GString
To set the default parameters, use Self::tr_ex
and its builder methods. See the book for detailed usage instructions.
pub fn tr_ex<'a>(&'a self, message: impl AsArg<StringName> + 'a) -> ExTr<'a>
pub fn tr_n(
&self,
message: impl AsArg<StringName>,
plural_message: impl AsArg<StringName>,
n: i32,
) -> GString
pub fn tr_n( &self, message: impl AsArg<StringName>, plural_message: impl AsArg<StringName>, n: i32, ) -> GString
To set the default parameters, use Self::tr_n_ex
and its builder methods. See the book for detailed usage instructions.
pub fn tr_n_ex<'a>( &'a self, message: impl AsArg<StringName> + 'a, plural_message: impl AsArg<StringName> + 'a, n: i32, ) -> ExTrN<'a>
pub fn get_translation_domain(&self) -> StringName
pub fn set_translation_domain(&mut self, domain: impl AsArg<StringName>)
pub fn is_queued_for_deletion(&self) -> bool
pub fn cancel_free(&mut self)
pub fn notify(&mut self, what: ObjectNotification)
pub fn notify(&mut self, what: ObjectNotification)
⚠️ Sends a Godot notification to all classes inherited by the object.
Triggers calls to on_notification()
, and depending on the notification, also to Godot’s lifecycle callbacks such as ready()
.
Starts from the highest ancestor (the Object
class) and goes down the hierarchy.
See also Godot docs for Object::notification()
.
§Panics
If you call this method on a user-defined object while holding a GdRef
or GdMut
guard on the instance, you will encounter
a panic. The reason is that the receiving virtual method on_notification()
acquires a GdMut
lock dynamically, which must
be exclusive.
pub fn notify_reversed(&mut self, what: ObjectNotification)
pub fn notify_reversed(&mut self, what: ObjectNotification)
⚠️ Like Self::notify()
, but starts at the most-derived class and goes up the hierarchy.
See docs of that method, including the panics.
Trait Implementations§
§impl Bounds for CpuParticles2D
impl Bounds for CpuParticles2D
§impl Debug for CpuParticles2D
impl Debug for CpuParticles2D
§impl Deref for CpuParticles2D
impl Deref for CpuParticles2D
§impl DerefMut for CpuParticles2D
impl DerefMut for CpuParticles2D
§fn deref_mut(&mut self) -> &mut <CpuParticles2D as Deref>::Target
fn deref_mut(&mut self) -> &mut <CpuParticles2D as Deref>::Target
§impl GodotClass for CpuParticles2D
impl GodotClass for CpuParticles2D
§const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene
const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene
§fn class_id() -> ClassId
fn class_id() -> ClassId
§fn class_name() -> ClassId
fn class_name() -> ClassId
class_id()
§fn inherits<Base>() -> boolwhere
Base: GodotClass,
fn inherits<Base>() -> boolwhere
Base: GodotClass,
§impl Inherits<CanvasItem> for CpuParticles2D
impl Inherits<CanvasItem> for CpuParticles2D
§const IS_SAME_CLASS: bool = false
const IS_SAME_CLASS: bool = false
Self == Base
. Read more§impl Inherits<Node> for CpuParticles2D
impl Inherits<Node> for CpuParticles2D
§const IS_SAME_CLASS: bool = false
const IS_SAME_CLASS: bool = false
Self == Base
. Read more§impl Inherits<Node2D> for CpuParticles2D
impl Inherits<Node2D> for CpuParticles2D
§const IS_SAME_CLASS: bool = false
const IS_SAME_CLASS: bool = false
Self == Base
. Read more§impl Inherits<Object> for CpuParticles2D
impl Inherits<Object> for CpuParticles2D
§const IS_SAME_CLASS: bool = false
const IS_SAME_CLASS: bool = false
Self == Base
. Read more§impl WithSignals for CpuParticles2D
impl WithSignals for CpuParticles2D
§type SignalCollection<'c, C: WithSignals> = SignalsOfCpuParticles2D<'c, C>
type SignalCollection<'c, C: WithSignals> = SignalsOfCpuParticles2D<'c, C>
impl GodotDefault for CpuParticles2D
Auto Trait Implementations§
impl Freeze for CpuParticles2D
impl RefUnwindSafe for CpuParticles2D
impl !Send for CpuParticles2D
impl !Sync for CpuParticles2D
impl Unpin for CpuParticles2D
impl UnwindSafe for CpuParticles2D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Inherits<T> for Twhere
T: GodotClass,
impl<T> Inherits<T> for Twhere
T: GodotClass,
§const IS_SAME_CLASS: bool = true
const IS_SAME_CLASS: bool = true
Self == Base
. Read more