[][src]Struct gdnative::api::GraphNode

pub struct GraphNode { /* fields omitted */ }

core class GraphNode inherits Container (unsafe).

Official documentation

See the documentation of this class in the Godot engine's official documentation.

Memory management

Non reference counted objects such as the ones of this type are usually owned by the engine.

GraphNode is a reference-only type. Persistent references can only exist in the unsafe Ref<GraphNode> form.

In the cases where Rust code owns an object of this type, for example if the object was just created on the Rust side and not passed to the engine yet, ownership should be either given to the engine or the object must be manually destroyed using Ref::free, or Ref::queue_free if it is a Node.

Class hierarchy

GraphNode 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 GraphNode[src]

Constants

impl GraphNode[src]

pub fn new() -> Ref<GraphNode, Unique>[src]

Creates a new instance of this object.

Because this type is not reference counted, the lifetime of the returned object is not automatically managed.

Immediately after creation, the object is owned by the caller, and can be passed to the engine (in which case the engine will be responsible for destroying the object) or destroyed manually using Ref::free, or preferably Ref::queue_free if it is a Node.

pub fn clear_all_slots(&self)[src]

Disables all input and output slots of the GraphNode.

pub fn clear_slot(&self, idx: i64)[src]

Disables input and output slot whose index is [code]idx[/code].

pub fn get_connection_input_color(&self, idx: i64) -> Color[src]

Returns the color of the input connection [code]idx[/code].

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

Returns the number of enabled input slots (connections) to the GraphNode.

pub fn get_connection_input_position(
    &self,
    idx: i64
) -> Vector2D<f32, UnknownUnit>
[src]

Returns the position of the input connection [code]idx[/code].

pub fn get_connection_input_type(&self, idx: i64) -> i64[src]

Returns the type of the input connection [code]idx[/code].

pub fn get_connection_output_color(&self, idx: i64) -> Color[src]

Returns the color of the output connection [code]idx[/code].

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

Returns the number of enabled output slots (connections) of the GraphNode.

pub fn get_connection_output_position(
    &self,
    idx: i64
) -> Vector2D<f32, UnknownUnit>
[src]

Returns the position of the output connection [code]idx[/code].

pub fn get_connection_output_type(&self, idx: i64) -> i64[src]

Returns the type of the output connection [code]idx[/code].

pub fn offset(&self) -> Vector2D<f32, UnknownUnit>[src]

The offset of the GraphNode, relative to the scroll offset of the [GraphEdit].
			[b]Note:[/b] You cannot use position directly, as [GraphEdit] is a [Container].

pub fn overlay(&self) -> Overlay[src]

Sets the overlay shown above the GraphNode. See [enum Overlay].

pub fn get_slot_color_left(&self, idx: i64) -> Color[src]

Returns the color set to [code]idx[/code] left (input) slot.

pub fn get_slot_color_right(&self, idx: i64) -> Color[src]

Returns the color set to [code]idx[/code] right (output) slot.

pub fn get_slot_type_left(&self, idx: i64) -> i64[src]

Returns the (integer) type of left (input) [code]idx[/code] slot.

pub fn get_slot_type_right(&self, idx: i64) -> i64[src]

Returns the (integer) type of right (output) [code]idx[/code] slot.

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

The text displayed in the GraphNode's title bar.

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

If [code]true[/code], the close button will be visible.
			[b]Note:[/b] Pressing it will only emit the [signal close_request] signal, the GraphNode needs to be removed manually.

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

If [code]true[/code], the GraphNode is a comment node.

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

If [code]true[/code], the user can resize the GraphNode.
			[b]Note:[/b] Dragging the handle will only emit the [signal resize_request] signal, the GraphNode needs to be resized manually.

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

If [code]true[/code], the GraphNode is selected.

pub fn is_slot_enabled_left(&self, idx: i64) -> bool[src]

Returns [code]true[/code] if left (input) slot [code]idx[/code] is enabled, [code]false[/code] otherwise.

pub fn is_slot_enabled_right(&self, idx: i64) -> bool[src]

Returns [code]true[/code] if right (output) slot [code]idx[/code] is enabled, [code]false[/code] otherwise.

pub fn set_comment(&self, comment: bool)[src]

If [code]true[/code], the GraphNode is a comment node.

pub fn set_offset(&self, offset: Vector2D<f32, UnknownUnit>)[src]

The offset of the GraphNode, relative to the scroll offset of the [GraphEdit].
			[b]Note:[/b] You cannot use position directly, as [GraphEdit] is a [Container].

pub fn set_overlay(&self, overlay: i64)[src]

Sets the overlay shown above the GraphNode. See [enum Overlay].

pub fn set_resizable(&self, resizable: bool)[src]

If [code]true[/code], the user can resize the GraphNode.
			[b]Note:[/b] Dragging the handle will only emit the [signal resize_request] signal, the GraphNode needs to be resized manually.

pub fn set_selected(&self, selected: bool)[src]

If [code]true[/code], the GraphNode is selected.

pub fn set_show_close_button(&self, show: bool)[src]

If [code]true[/code], the close button will be visible.
			[b]Note:[/b] Pressing it will only emit the [signal close_request] signal, the GraphNode needs to be removed manually.

pub fn set_slot(
    &self,
    idx: i64,
    enable_left: bool,
    type_left: i64,
    color_left: Color,
    enable_right: bool,
    type_right: i64,
    color_right: Color,
    custom_left: impl AsArg<Texture>,
    custom_right: impl AsArg<Texture>
)
[src]

Sets properties of the slot with ID [code]idx[/code].
				If [code]enable_left[/code]/[code]right[/code], a port will appear and the slot will be able to be connected from this side.
				[code]type_left[/code]/[code]right[/code] is an arbitrary type of the port. Only ports with the same type values can be connected.
				[code]color_left[/code]/[code]right[/code] is the tint of the port's icon on this side.
				[code]custom_left[/code]/[code]right[/code] is a custom texture for this side's port.
				[b]Note:[/b] This method only sets properties of the slot. To create the slot, add a [Control]-derived child to the GraphNode.

Default Arguments

  • custom_left - null
  • custom_right - null

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

The text displayed in the GraphNode's title bar.

Methods from Deref<Target = Container>

pub fn fit_child_in_rect(
    &self,
    child: impl AsArg<Control>,
    rect: Rect<f32, UnknownUnit>
)
[src]

Fit a child control in a given rect. This is mainly a helper for creating custom container classes.

pub fn queue_sort(&self)[src]

Queue resort of the contained children. This is called automatically anyway, but can be called upon request.

Trait Implementations

impl Debug for GraphNode[src]

impl Deref for GraphNode[src]

type Target = Container

The resulting type after dereferencing.

impl DerefMut for GraphNode[src]

impl GodotObject for GraphNode[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 Instanciable for GraphNode[src]

impl QueueFree for GraphNode[src]

impl SubClass<CanvasItem> for GraphNode[src]

impl SubClass<Container> for GraphNode[src]

impl SubClass<Control> for GraphNode[src]

impl SubClass<Node> for GraphNode[src]

impl SubClass<Object> for GraphNode[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.