Struct godot::classes::RichTextLabel
#[repr(C)]pub struct RichTextLabel { /* private fields */ }
Expand description
Godot class RichTextLabel.
Inherits Control
.
Related symbols:
rich_text_label
: sidecar module with related enum/flag typesIRichTextLabel
: virtual methods
See also Godot docs for RichTextLabel
.
§Construction
This class is manually managed. You can create a new instance using RichTextLabel::new_alloc()
.
Do not forget to call free()
or hand over ownership to Godot.
Implementations§
§impl RichTextLabel
impl RichTextLabel
pub fn get_parsed_text(&self) -> GString
pub fn add_text(&mut self, text: GString)
pub fn set_text(&mut self, text: GString)
pub fn add_image(&mut self, image: Gd<Texture2D>)
pub fn add_image_ex(&mut self, image: Gd<Texture2D>) -> ExAddImage<'_>
pub fn update_image( &mut self, key: Variant, mask: ImageUpdateMask, image: Gd<Texture2D>, )
pub fn update_image_ex( &mut self, key: Variant, mask: ImageUpdateMask, image: Gd<Texture2D>, ) -> ExUpdateImage<'_>
pub fn newline(&mut self)
pub fn remove_paragraph(&mut self, paragraph: i32) -> bool
pub fn remove_paragraph_ex(&mut self, paragraph: i32) -> ExRemoveParagraph<'_>
pub fn invalidate_paragraph(&mut self, paragraph: i32) -> bool
pub fn push_font(&mut self, font: Gd<Font>)
pub fn push_font_ex(&mut self, font: Gd<Font>) -> ExPushFont<'_>
pub fn push_font_size(&mut self, font_size: i32)
pub fn push_normal(&mut self)
pub fn push_bold(&mut self)
pub fn push_bold_italics(&mut self)
pub fn push_italics(&mut self)
pub fn push_mono(&mut self)
pub fn push_color(&mut self, color: Color)
pub fn push_outline_size(&mut self, outline_size: i32)
pub fn push_outline_color(&mut self, color: Color)
pub fn push_paragraph(&mut self, alignment: HorizontalAlignment)
pub fn push_paragraph_ex( &mut self, alignment: HorizontalAlignment, ) -> ExPushParagraph<'_>
pub fn push_indent(&mut self, level: i32)
pub fn push_list(&mut self, level: i32, type_: ListType, capitalize: bool)
pub fn push_list_ex( &mut self, level: i32, type_: ListType, capitalize: bool, ) -> ExPushList<'_>
pub fn push_meta(&mut self, data: Variant)
pub fn push_meta_ex(&mut self, data: Variant) -> ExPushMeta<'_>
pub fn push_hint(&mut self, description: GString)
pub fn push_language(&mut self, language: GString)
pub fn push_underline(&mut self)
pub fn push_strikethrough(&mut self)
pub fn push_table(&mut self, columns: i32)
pub fn push_table_ex(&mut self, columns: i32) -> ExPushTable<'_>
pub fn push_dropcap(&mut self, string: GString, font: Gd<Font>, size: i32)
pub fn push_dropcap_ex( &mut self, string: GString, font: Gd<Font>, size: i32, ) -> ExPushDropcap<'_>
pub fn set_table_column_expand(&mut self, column: i32, expand: bool)
pub fn set_table_column_expand_ex( &mut self, column: i32, expand: bool, ) -> ExSetTableColumnExpand<'_>
pub fn set_cell_row_background_color( &mut self, odd_row_bg: Color, even_row_bg: Color, )
pub fn set_cell_border_color(&mut self, color: Color)
pub fn set_cell_size_override(&mut self, min_size: Vector2, max_size: Vector2)
pub fn set_cell_padding(&mut self, padding: Rect2)
pub fn push_cell(&mut self)
pub fn push_fgcolor(&mut self, fgcolor: Color)
pub fn push_bgcolor(&mut self, bgcolor: Color)
pub fn push_customfx(&mut self, effect: Gd<RichTextEffect>, env: Dictionary)
pub fn push_context(&mut self)
pub fn pop_context(&mut self)
pub fn pop(&mut self)
pub fn pop_all(&mut self)
pub fn clear(&mut self)
pub fn set_structured_text_bidi_override( &mut self, parser: StructuredTextParser, )
pub fn get_structured_text_bidi_override(&self) -> StructuredTextParser
pub fn set_structured_text_bidi_override_options(&mut self, args: OutArray)
pub fn get_structured_text_bidi_override_options(&self) -> OutArray
pub fn set_text_direction(&mut self, direction: TextDirection)
pub fn get_text_direction(&self) -> TextDirection
pub fn set_language(&mut self, language: GString)
pub fn get_language(&self) -> GString
pub fn set_autowrap_mode(&mut self, autowrap_mode: AutowrapMode)
pub fn get_autowrap_mode(&self) -> AutowrapMode
pub fn set_meta_underline(&mut self, enable: bool)
pub fn is_meta_underlined(&self) -> bool
pub fn set_hint_underline(&mut self, enable: bool)
pub fn is_hint_underlined(&self) -> bool
pub fn set_scroll_active(&mut self, active: bool)
pub fn is_scroll_active(&self) -> bool
pub fn set_scroll_follow(&mut self, follow: bool)
pub fn is_scroll_following(&self) -> bool
pub fn get_v_scroll_bar(&mut self) -> Option<Gd<VScrollBar>>
pub fn scroll_to_line(&mut self, line: i32)
pub fn scroll_to_paragraph(&mut self, paragraph: i32)
pub fn scroll_to_selection(&mut self)
pub fn set_tab_size(&mut self, spaces: i32)
pub fn get_tab_size(&self) -> i32
pub fn set_fit_content(&mut self, enabled: bool)
pub fn is_fit_content_enabled(&self) -> bool
pub fn set_selection_enabled(&mut self, enabled: bool)
pub fn is_selection_enabled(&self) -> bool
pub fn set_shortcut_keys_enabled(&mut self, enabled: bool)
pub fn is_shortcut_keys_enabled(&self) -> bool
pub fn set_deselect_on_focus_loss_enabled(&mut self, enable: bool)
pub fn is_deselect_on_focus_loss_enabled(&self) -> bool
pub fn set_drag_and_drop_selection_enabled(&mut self, enable: bool)
pub fn is_drag_and_drop_selection_enabled(&self) -> bool
pub fn get_selection_from(&self) -> i32
pub fn get_selection_to(&self) -> i32
pub fn select_all(&mut self)
pub fn get_selected_text(&self) -> GString
pub fn deselect(&mut self)
pub fn parse_bbcode(&mut self, bbcode: GString)
pub fn append_text(&mut self, bbcode: GString)
pub fn get_text(&self) -> GString
pub fn is_ready(&self) -> bool
pub fn set_threaded(&mut self, threaded: bool)
pub fn is_threaded(&self) -> bool
pub fn set_progress_bar_delay(&mut self, delay_ms: i32)
pub fn get_progress_bar_delay(&self) -> i32
pub fn set_visible_characters(&mut self, amount: i32)
pub fn get_visible_characters(&self) -> i32
pub fn get_visible_characters_behavior(&self) -> VisibleCharactersBehavior
pub fn set_visible_characters_behavior( &mut self, behavior: VisibleCharactersBehavior, )
pub fn set_visible_ratio(&mut self, ratio: f32)
pub fn get_visible_ratio(&self) -> f32
pub fn get_character_line(&mut self, character: i32) -> i32
pub fn get_character_paragraph(&mut self, character: i32) -> i32
pub fn get_total_character_count(&self) -> i32
pub fn set_use_bbcode(&mut self, enable: bool)
pub fn is_using_bbcode(&self) -> bool
pub fn get_line_count(&self) -> i32
pub fn get_visible_line_count(&self) -> i32
pub fn get_paragraph_count(&self) -> i32
pub fn get_visible_paragraph_count(&self) -> i32
pub fn get_content_height(&self) -> i32
pub fn get_content_width(&self) -> i32
pub fn get_line_offset(&mut self, line: i32) -> f32
pub fn get_paragraph_offset(&mut self, paragraph: i32) -> f32
pub fn parse_expressions_for_values( &mut self, expressions: PackedStringArray, ) -> Dictionary
pub fn set_effects(&mut self, effects: OutArray)
pub fn get_effects(&mut self) -> OutArray
pub fn install_effect(&mut self, effect: Variant)
Methods from Deref<Target = Control>§
pub fn accept_event(&mut self)
pub fn get_minimum_size(&self) -> Vector2
pub fn get_combined_minimum_size(&self) -> Vector2
pub fn set_anchors_preset(&mut self, preset: LayoutPreset)
pub fn set_anchors_preset_ex( &mut self, preset: LayoutPreset, ) -> ExSetAnchorsPreset<'_>
pub fn set_offsets_preset(&mut self, preset: LayoutPreset)
pub fn set_offsets_preset_ex( &mut self, preset: LayoutPreset, ) -> ExSetOffsetsPreset<'_>
pub fn set_anchors_and_offsets_preset(&mut self, preset: LayoutPreset)
pub fn set_anchors_and_offsets_preset_ex( &mut self, preset: LayoutPreset, ) -> ExSetAnchorsAndOffsetsPreset<'_>
pub fn set_anchor(&mut self, side: Side, anchor: f32)
pub fn set_anchor_ex(&mut self, side: Side, anchor: f32) -> ExSetAnchor<'_>
pub fn get_anchor(&self, side: Side) -> f32
pub fn set_offset(&mut self, side: Side, offset: f32)
pub fn get_offset(&self, offset: Side) -> f32
pub fn set_anchor_and_offset(&mut self, side: Side, anchor: f32, offset: f32)
pub fn set_anchor_and_offset_ex( &mut self, side: Side, anchor: f32, offset: f32, ) -> ExSetAnchorAndOffset<'_>
pub fn set_begin(&mut self, position: Vector2)
pub fn set_end(&mut self, position: Vector2)
pub fn set_position(&mut self, position: Vector2)
pub fn set_position_ex(&mut self, position: Vector2) -> ExSetPosition<'_>
pub fn set_size(&mut self, size: Vector2)
pub fn set_size_ex(&mut self, size: Vector2) -> ExSetSize<'_>
pub fn reset_size(&mut self)
pub fn set_custom_minimum_size(&mut self, size: Vector2)
pub fn set_global_position(&mut self, position: Vector2)
pub fn set_global_position_ex( &mut self, position: Vector2, ) -> ExSetGlobalPosition<'_>
pub fn set_rotation(&mut self, radians: f32)
pub fn set_rotation_degrees(&mut self, degrees: f32)
pub fn set_scale(&mut self, scale: Vector2)
pub fn set_pivot_offset(&mut self, pivot_offset: Vector2)
pub fn get_begin(&self) -> Vector2
pub fn get_end(&self) -> Vector2
pub fn get_position(&self) -> Vector2
pub fn get_size(&self) -> Vector2
pub fn get_rotation(&self) -> f32
pub fn get_rotation_degrees(&self) -> f32
pub fn get_scale(&self) -> Vector2
pub fn get_pivot_offset(&self) -> Vector2
pub fn get_custom_minimum_size(&self) -> Vector2
pub fn get_parent_area_size(&self) -> Vector2
pub fn get_global_position(&self) -> Vector2
pub fn get_screen_position(&self) -> Vector2
pub fn get_rect(&self) -> Rect2
pub fn get_global_rect(&self) -> Rect2
pub fn set_focus_mode(&mut self, mode: FocusMode)
pub fn get_focus_mode(&self) -> FocusMode
pub fn has_focus(&self) -> bool
pub fn grab_focus(&mut self)
pub fn release_focus(&mut self)
pub fn find_prev_valid_focus(&self) -> Option<Gd<Control>>
pub fn find_next_valid_focus(&self) -> Option<Gd<Control>>
pub fn find_valid_focus_neighbor(&self, side: Side) -> Option<Gd<Control>>
pub fn set_h_size_flags(&mut self, flags: SizeFlags)
pub fn get_h_size_flags(&self) -> SizeFlags
pub fn set_stretch_ratio(&mut self, ratio: f32)
pub fn get_stretch_ratio(&self) -> f32
pub fn set_v_size_flags(&mut self, flags: SizeFlags)
pub fn get_v_size_flags(&self) -> SizeFlags
pub fn set_theme(&mut self, theme: Gd<Theme>)
pub fn get_theme(&self) -> Option<Gd<Theme>>
pub fn set_theme_type_variation(&mut self, theme_type: StringName)
pub fn get_theme_type_variation(&self) -> StringName
pub fn begin_bulk_theme_override(&mut self)
pub fn end_bulk_theme_override(&mut self)
pub fn add_theme_icon_override( &mut self, name: StringName, texture: Gd<Texture2D>, )
pub fn add_theme_stylebox_override( &mut self, name: StringName, stylebox: Gd<StyleBox>, )
pub fn add_theme_font_override(&mut self, name: StringName, font: Gd<Font>)
pub fn add_theme_font_size_override(&mut self, name: StringName, font_size: i32)
pub fn add_theme_color_override(&mut self, name: StringName, color: Color)
pub fn add_theme_constant_override(&mut self, name: StringName, constant: i32)
pub fn remove_theme_icon_override(&mut self, name: StringName)
pub fn remove_theme_stylebox_override(&mut self, name: StringName)
pub fn remove_theme_font_override(&mut self, name: StringName)
pub fn remove_theme_font_size_override(&mut self, name: StringName)
pub fn remove_theme_color_override(&mut self, name: StringName)
pub fn remove_theme_constant_override(&mut self, name: StringName)
pub fn get_theme_icon(&self, name: StringName) -> Option<Gd<Texture2D>>
pub fn get_theme_icon_ex(&self, name: StringName) -> ExGetThemeIcon<'_>
pub fn get_theme_stylebox(&self, name: StringName) -> Option<Gd<StyleBox>>
pub fn get_theme_stylebox_ex(&self, name: StringName) -> ExGetThemeStylebox<'_>
pub fn get_theme_font(&self, name: StringName) -> Option<Gd<Font>>
pub fn get_theme_font_ex(&self, name: StringName) -> ExGetThemeFont<'_>
pub fn get_theme_font_size(&self, name: StringName) -> i32
pub fn get_theme_font_size_ex(&self, name: StringName) -> ExGetThemeFontSize<'_>
pub fn get_theme_color(&self, name: StringName) -> Color
pub fn get_theme_color_ex(&self, name: StringName) -> ExGetThemeColor<'_>
pub fn get_theme_constant(&self, name: StringName) -> i32
pub fn get_theme_constant_ex(&self, name: StringName) -> ExGetThemeConstant<'_>
pub fn has_theme_icon_override(&self, name: StringName) -> bool
pub fn has_theme_stylebox_override(&self, name: StringName) -> bool
pub fn has_theme_font_override(&self, name: StringName) -> bool
pub fn has_theme_font_size_override(&self, name: StringName) -> bool
pub fn has_theme_color_override(&self, name: StringName) -> bool
pub fn has_theme_constant_override(&self, name: StringName) -> bool
pub fn has_theme_icon(&self, name: StringName) -> bool
pub fn has_theme_icon_ex(&self, name: StringName) -> ExHasThemeIcon<'_>
pub fn has_theme_stylebox(&self, name: StringName) -> bool
pub fn has_theme_stylebox_ex(&self, name: StringName) -> ExHasThemeStylebox<'_>
pub fn has_theme_font(&self, name: StringName) -> bool
pub fn has_theme_font_ex(&self, name: StringName) -> ExHasThemeFont<'_>
pub fn has_theme_font_size(&self, name: StringName) -> bool
pub fn has_theme_font_size_ex(&self, name: StringName) -> ExHasThemeFontSize<'_>
pub fn has_theme_color(&self, name: StringName) -> bool
pub fn has_theme_color_ex(&self, name: StringName) -> ExHasThemeColor<'_>
pub fn has_theme_constant(&self, name: StringName) -> bool
pub fn has_theme_constant_ex(&self, name: StringName) -> ExHasThemeConstant<'_>
pub fn get_theme_default_base_scale(&self) -> f32
pub fn get_theme_default_font(&self) -> Option<Gd<Font>>
pub fn get_theme_default_font_size(&self) -> i32
pub fn get_parent_control(&self) -> Option<Gd<Control>>
pub fn set_h_grow_direction(&mut self, direction: GrowDirection)
pub fn get_h_grow_direction(&self) -> GrowDirection
pub fn set_v_grow_direction(&mut self, direction: GrowDirection)
pub fn get_v_grow_direction(&self) -> GrowDirection
pub fn set_tooltip_text(&mut self, hint: GString)
pub fn get_tooltip_text(&self) -> GString
pub fn get_tooltip(&self) -> GString
pub fn get_tooltip_ex(&self) -> ExGetTooltip<'_>
pub fn set_default_cursor_shape(&mut self, shape: CursorShape)
pub fn get_default_cursor_shape(&self) -> CursorShape
pub fn get_cursor_shape(&self) -> CursorShape
pub fn get_cursor_shape_ex(&self) -> ExGetCursorShape<'_>
pub fn set_focus_neighbor(&mut self, side: Side, neighbor: NodePath)
pub fn get_focus_neighbor(&self, side: Side) -> NodePath
pub fn set_focus_next(&mut self, next: NodePath)
pub fn get_focus_next(&self) -> NodePath
pub fn set_focus_previous(&mut self, previous: NodePath)
pub fn get_focus_previous(&self) -> NodePath
pub fn force_drag(&mut self, data: Variant, preview: Gd<Control>)
pub fn set_mouse_filter(&mut self, filter: MouseFilter)
pub fn get_mouse_filter(&self) -> MouseFilter
pub fn set_force_pass_scroll_events(&mut self, force_pass_scroll_events: bool)
pub fn is_force_pass_scroll_events(&self) -> bool
pub fn set_clip_contents(&mut self, enable: bool)
pub fn is_clipping_contents(&mut self) -> bool
pub fn grab_click_focus(&mut self)
pub fn set_drag_forwarding( &mut self, drag_func: Callable, can_drop_func: Callable, drop_func: Callable, )
pub fn set_drag_preview(&mut self, control: Gd<Control>)
pub fn is_drag_successful(&self) -> bool
pub fn warp_mouse(&mut self, position: Vector2)
pub fn set_shortcut_context(&mut self, node: Gd<Node>)
pub fn get_shortcut_context(&self) -> Option<Gd<Node>>
pub fn update_minimum_size(&mut self)
pub fn set_layout_direction(&mut self, direction: LayoutDirection)
pub fn get_layout_direction(&self) -> LayoutDirection
pub fn is_layout_rtl(&self) -> bool
pub fn set_auto_translate(&mut self, enable: bool)
pub fn is_auto_translating(&self) -> bool
pub fn set_localize_numeral_system(&mut self, enable: bool)
pub fn is_localizing_numeral_system(&self) -> bool
pub fn notify(&mut self, what: ControlNotification)
pub fn notify(&mut self, what: ControlNotification)
⚠️ 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: ControlNotification)
pub fn notify_reversed(&mut self, what: ControlNotification)
⚠️ 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 = 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_ex( &mut self, from: Vector2, to: Vector2, color: Color, ) -> ExDrawLine<'_>
pub fn draw_dashed_line(&mut self, from: Vector2, to: Vector2, color: Color)
pub fn draw_dashed_line_ex( &mut self, from: Vector2, to: Vector2, color: Color, ) -> ExDrawDashedLine<'_>
pub fn draw_polyline(&mut self, points: PackedVector2Array, color: Color)
pub fn draw_polyline_ex( &mut self, points: PackedVector2Array, color: Color, ) -> ExDrawPolyline<'_>
pub fn draw_polyline_colors( &mut self, points: PackedVector2Array, colors: PackedColorArray, )
pub fn draw_polyline_colors_ex( &mut self, points: PackedVector2Array, colors: PackedColorArray, ) -> ExDrawPolylineColors<'_>
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_ex( &mut self, center: Vector2, radius: f32, start_angle: f32, end_angle: f32, point_count: i32, color: Color, ) -> ExDrawArc<'_>
pub fn draw_multiline(&mut self, points: PackedVector2Array, color: Color)
pub fn draw_multiline_ex( &mut self, points: PackedVector2Array, color: Color, ) -> ExDrawMultiline<'_>
pub fn draw_multiline_colors( &mut self, points: PackedVector2Array, colors: PackedColorArray, )
pub fn draw_multiline_colors_ex( &mut self, points: PackedVector2Array, colors: PackedColorArray, ) -> ExDrawMultilineColors<'_>
pub fn draw_rect(&mut self, rect: Rect2, color: Color)
pub fn draw_rect_ex(&mut self, rect: Rect2, color: Color) -> ExDrawRect<'_>
pub fn draw_circle(&mut self, position: Vector2, radius: f32, color: Color)
pub fn draw_circle_ex( &mut self, position: Vector2, radius: f32, color: Color, ) -> ExDrawCircle<'_>
pub fn draw_texture(&mut self, texture: Gd<Texture2D>, position: Vector2)
pub fn draw_texture_ex( &mut self, texture: Gd<Texture2D>, position: Vector2, ) -> ExDrawTexture<'_>
pub fn draw_texture_rect( &mut self, texture: Gd<Texture2D>, rect: Rect2, tile: bool, )
pub fn draw_texture_rect_ex( &mut self, texture: Gd<Texture2D>, rect: Rect2, tile: bool, ) -> ExDrawTextureRect<'_>
pub fn draw_texture_rect_region( &mut self, texture: Gd<Texture2D>, rect: Rect2, src_rect: Rect2, )
pub fn draw_texture_rect_region_ex( &mut self, texture: Gd<Texture2D>, rect: Rect2, src_rect: Rect2, ) -> ExDrawTextureRectRegion<'_>
pub fn draw_msdf_texture_rect_region( &mut self, texture: Gd<Texture2D>, rect: Rect2, src_rect: Rect2, )
pub fn draw_msdf_texture_rect_region_ex( &mut self, texture: Gd<Texture2D>, rect: Rect2, src_rect: Rect2, ) -> ExDrawMsdfTextureRectRegion<'_>
pub fn draw_lcd_texture_rect_region( &mut self, texture: Gd<Texture2D>, rect: Rect2, src_rect: Rect2, )
pub fn draw_lcd_texture_rect_region_ex( &mut self, texture: Gd<Texture2D>, rect: Rect2, src_rect: Rect2, ) -> ExDrawLcdTextureRectRegion<'_>
pub fn draw_style_box(&mut self, style_box: Gd<StyleBox>, rect: Rect2)
pub fn draw_primitive( &mut self, points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array, )
pub fn draw_primitive_ex( &mut self, points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array, ) -> ExDrawPrimitive<'_>
pub fn draw_polygon( &mut self, points: PackedVector2Array, colors: PackedColorArray, )
pub fn draw_polygon_ex( &mut self, points: PackedVector2Array, colors: PackedColorArray, ) -> ExDrawPolygon<'_>
pub fn draw_colored_polygon(&mut self, points: PackedVector2Array, color: Color)
pub fn draw_colored_polygon_ex( &mut self, points: PackedVector2Array, color: Color, ) -> ExDrawColoredPolygon<'_>
pub fn draw_string(&self, font: Gd<Font>, pos: Vector2, text: GString)
pub fn draw_string_ex( &self, font: Gd<Font>, pos: Vector2, text: GString, ) -> ExDrawString<'_>
pub fn draw_multiline_string(&self, font: Gd<Font>, pos: Vector2, text: GString)
pub fn draw_multiline_string_ex( &self, font: Gd<Font>, pos: Vector2, text: GString, ) -> ExDrawMultilineString<'_>
pub fn draw_string_outline(&self, font: Gd<Font>, pos: Vector2, text: GString)
pub fn draw_string_outline_ex( &self, font: Gd<Font>, pos: Vector2, text: GString, ) -> ExDrawStringOutline<'_>
pub fn draw_multiline_string_outline( &self, font: Gd<Font>, pos: Vector2, text: GString, )
pub fn draw_multiline_string_outline_ex( &self, font: Gd<Font>, pos: Vector2, text: GString, ) -> ExDrawMultilineStringOutline<'_>
pub fn draw_char(&self, font: Gd<Font>, pos: Vector2, char: GString)
pub fn draw_char_ex( &self, font: Gd<Font>, pos: Vector2, char: GString, ) -> ExDrawChar<'_>
pub fn draw_char_outline(&self, font: Gd<Font>, pos: Vector2, char: GString)
pub fn draw_char_outline_ex( &self, font: Gd<Font>, pos: Vector2, char: GString, ) -> ExDrawCharOutline<'_>
pub fn draw_mesh(&mut self, mesh: Gd<Mesh>, texture: Gd<Texture2D>)
pub fn draw_mesh_ex( &mut self, mesh: Gd<Mesh>, texture: Gd<Texture2D>, ) -> ExDrawMesh<'_>
pub fn draw_multimesh( &mut self, multimesh: Gd<MultiMesh>, texture: Gd<Texture2D>, )
pub fn draw_set_transform(&mut self, position: Vector2)
pub fn draw_set_transform_ex( &mut self, position: Vector2, ) -> ExDrawSetTransform<'_>
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_ex( &mut self, animation_length: f64, slice_begin: f64, slice_end: f64, ) -> ExDrawAnimationSlice<'_>
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: Gd<Material>)
pub fn get_material(&self) -> Option<Gd<Material>>
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, screen_point: Vector2) -> Vector2
pub fn make_input_local(&self, event: 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 Into<NodePath>) -> Gd<T>
pub fn get_node_as<T>(&self, path: impl Into<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 Into<NodePath>) -> Option<Gd<T>>
pub fn try_get_node_as<T>(&self, path: impl Into<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: Gd<Node>)
pub fn add_sibling_ex(&mut self, sibling: Gd<Node>) -> ExAddSibling<'_>
pub fn set_name(&mut self, name: GString)
pub fn get_name(&self) -> StringName
pub fn add_child(&mut self, node: Gd<Node>)
pub fn add_child_ex(&mut self, node: Gd<Node>) -> ExAddChild<'_>
pub fn remove_child(&mut self, node: Gd<Node>)
pub fn reparent(&mut self, new_parent: Gd<Node>)
pub fn reparent_ex(&mut self, new_parent: Gd<Node>) -> ExReparent<'_>
pub fn get_child_count(&self) -> i32
pub fn get_child_count_ex(&self) -> ExGetChildCount<'_>
pub fn get_children(&self) -> Array<Gd<Node>>
pub fn get_children_ex(&self) -> ExGetChildren<'_>
pub fn get_child(&self, idx: i32) -> Option<Gd<Node>>
pub fn get_child_ex(&self, idx: i32) -> ExGetChild<'_>
pub fn has_node(&self, path: NodePath) -> bool
pub fn get_node_or_null(&self, path: NodePath) -> Option<Gd<Node>>
pub fn get_parent(&self) -> Option<Gd<Node>>
pub fn find_child(&self, pattern: GString) -> Option<Gd<Node>>
pub fn find_child_ex(&self, pattern: GString) -> ExFindChild<'_>
pub fn find_children(&self, pattern: GString) -> Array<Gd<Node>>
pub fn find_children_ex(&self, pattern: GString) -> ExFindChildren<'_>
pub fn find_parent(&self, pattern: GString) -> Option<Gd<Node>>
pub fn has_node_and_resource(&self, path: NodePath) -> bool
pub fn get_node_and_resource(&mut self, path: NodePath) -> OutArray
pub fn is_inside_tree(&self) -> bool
pub fn is_part_of_edited_scene(&self) -> bool
pub fn is_ancestor_of(&self, node: Gd<Node>) -> bool
pub fn is_greater_than(&self, node: Gd<Node>) -> bool
pub fn get_path(&self) -> NodePath
pub fn get_path_to(&self, node: Gd<Node>) -> NodePath
pub fn get_path_to_ex(&self, node: Gd<Node>) -> ExGetPathTo<'_>
pub fn add_to_group(&mut self, group: StringName)
pub fn add_to_group_ex(&mut self, group: StringName) -> ExAddToGroup<'_>
pub fn remove_from_group(&mut self, group: StringName)
pub fn is_in_group(&self, group: StringName) -> bool
pub fn move_child(&mut self, child_node: Gd<Node>, to_index: i32)
pub fn get_groups(&self) -> Array<StringName>
pub fn set_owner(&mut self, owner: Gd<Node>)
pub fn get_owner(&self) -> Option<Gd<Node>>
pub fn get_index(&self) -> i32
pub fn get_index_ex(&self) -> ExGetIndex<'_>
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: GString)
pub fn get_scene_file_path(&self) -> GString
pub fn propagate_notification(&mut self, what: i32)
pub fn propagate_call(&mut self, method: StringName)
pub fn propagate_call_ex(&mut self, method: StringName) -> ExPropagateCall<'_>
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 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_ex(&self) -> ExDuplicate<'_>
pub fn replace_by(&mut self, node: Gd<Node>)
pub fn replace_by_ex(&mut self, node: Gd<Node>) -> ExReplaceBy<'_>
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: Gd<Node>, is_editable: bool)
pub fn is_editable_instance(&self, node: 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
pub fn get_multiplayer(&self) -> Option<Gd<MultiplayerApi>>
pub fn rpc_config(&mut self, method: StringName, config: Variant)
pub fn set_editor_description(&mut self, editor_description: 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: GString) -> GString
pub fn atr_ex(&self, message: GString) -> ExAtr<'_>
pub fn atr_n( &self, message: GString, plural_message: StringName, n: i32, ) -> GString
pub fn atr_n_ex( &self, message: GString, plural_message: StringName, n: i32, ) -> ExAtrN<'_>
pub fn rpc(&mut self, method: StringName, varargs: &[Variant]) -> Error
pub fn rpc(&mut self, method: 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: StringName,
varargs: &[Variant],
) -> Result<Error, CallError>
pub fn try_rpc( &mut self, method: 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: StringName,
varargs: &[Variant],
) -> Error
pub fn rpc_id( &mut self, peer_id: i64, method: 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: StringName,
varargs: &[Variant],
) -> Result<Error, CallError>
pub fn try_rpc_id( &mut self, peer_id: i64, method: 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: StringName,
varargs: &[Variant],
) -> Variant
pub fn call_deferred_thread_group( &mut self, method: 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: StringName,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call_deferred_thread_group( &mut self, method: 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: StringName, value: Variant, )
pub fn notify_deferred_thread_group(&mut self, what: i32)
pub fn call_thread_safe(
&mut self,
method: StringName,
varargs: &[Variant],
) -> Variant
pub fn call_thread_safe( &mut self, method: 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: StringName,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call_thread_safe( &mut self, method: 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: 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_class(&self) -> GString
pub fn is_class(&self, class: GString) -> bool
pub fn set(&mut self, property: StringName, value: Variant)
pub fn get(&self, property: StringName) -> Variant
pub fn set_indexed(&mut self, property_path: NodePath, value: Variant)
pub fn get_indexed(&self, property_path: 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: StringName) -> bool
pub fn property_get_revert(&self, property: StringName) -> Variant
pub fn set_script(&mut self, script: Variant)
pub fn get_script(&self) -> Variant
pub fn set_meta(&mut self, name: StringName, value: Variant)
pub fn remove_meta(&mut self, name: StringName)
pub fn get_meta(&self, name: StringName) -> Variant
pub fn get_meta_ex(&self, name: StringName) -> ExGetMeta<'_>
pub fn has_meta(&self, name: StringName) -> bool
pub fn get_meta_list(&self) -> Array<StringName>
pub fn add_user_signal(&mut self, signal: GString)
pub fn add_user_signal_ex(&mut self, signal: GString) -> ExAddUserSignal<'_>
pub fn has_user_signal(&self, signal: StringName) -> bool
pub fn remove_user_signal(&mut self, signal: StringName)
pub fn emit_signal(&mut self, signal: StringName, varargs: &[Variant]) -> Error
pub fn emit_signal(&mut self, signal: 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: StringName,
varargs: &[Variant],
) -> Result<Error, CallError>
pub fn try_emit_signal( &mut self, signal: 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: StringName, varargs: &[Variant]) -> Variant
pub fn call(&mut self, method: 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: StringName,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call( &mut self, method: 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: StringName,
varargs: &[Variant],
) -> Variant
pub fn call_deferred( &mut self, method: 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: StringName,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call_deferred( &mut self, method: 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: StringName, value: Variant)
pub fn callv(&mut self, method: StringName, arg_array: OutArray) -> Variant
pub fn has_method(&self, method: StringName) -> bool
pub fn get_method_argument_count(&self, method: StringName) -> i32
pub fn has_signal(&self, signal: StringName) -> bool
pub fn get_signal_list(&self) -> Array<Dictionary>
pub fn get_signal_connection_list( &self, signal: StringName, ) -> Array<Dictionary>
pub fn get_incoming_connections(&self) -> Array<Dictionary>
pub fn connect(&mut self, signal: StringName, callable: Callable) -> Error
pub fn connect_ex( &mut self, signal: StringName, callable: Callable, ) -> ExConnect<'_>
pub fn disconnect(&mut self, signal: StringName, callable: Callable)
pub fn is_connected(&self, signal: StringName, callable: Callable) -> 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: StringName) -> GString
pub fn tr_ex(&self, message: StringName) -> ExTr<'_>
pub fn tr_n( &self, message: StringName, plural_message: StringName, n: i32, ) -> GString
pub fn tr_n_ex( &self, message: StringName, plural_message: StringName, n: i32, ) -> ExTrN<'_>
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.