[][src]Struct gdnative_bindings::ParallaxBackground

pub struct ParallaxBackground { /* fields omitted */ }

core class ParallaxBackground inherits CanvasLayer (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.

ParallaxBackground is a reference-only type. Persistent references can only exist in the unsafe Ref<ParallaxBackground> 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

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

pub fn new() -> Ref<Self, 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 limit_begin(&self) -> Vector2[src]

Top-left limits for scrolling to begin. If the camera is outside of this limit, the background will stop scrolling. Must be lower than [member scroll_limit_end] to work.

pub fn limit_end(&self) -> Vector2[src]

Bottom-right limits for scrolling to end. If the camera is outside of this limit, the background will stop scrolling. Must be higher than [member scroll_limit_begin] to work.

pub fn scroll_base_offset(&self) -> Vector2[src]

The base position offset for all [ParallaxLayer] children.

pub fn scroll_base_scale(&self) -> Vector2[src]

The base motion scale for all [ParallaxLayer] children.

pub fn scroll_offset(&self) -> Vector2[src]

The ParallaxBackground's scroll value. Calculated automatically when using a [Camera2D], but can be used to manually manage scrolling when no camera is present.

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

If [code]true[/code], elements in [ParallaxLayer] child aren't affected by the zoom level of the camera.

pub fn set_ignore_camera_zoom(&self, ignore: bool)[src]

If [code]true[/code], elements in [ParallaxLayer] child aren't affected by the zoom level of the camera.

pub fn set_limit_begin(&self, ofs: Vector2)[src]

Top-left limits for scrolling to begin. If the camera is outside of this limit, the background will stop scrolling. Must be lower than [member scroll_limit_end] to work.

pub fn set_limit_end(&self, ofs: Vector2)[src]

Bottom-right limits for scrolling to end. If the camera is outside of this limit, the background will stop scrolling. Must be higher than [member scroll_limit_begin] to work.

pub fn set_scroll_base_offset(&self, ofs: Vector2)[src]

The base position offset for all [ParallaxLayer] children.

pub fn set_scroll_base_scale(&self, scale: Vector2)[src]

The base motion scale for all [ParallaxLayer] children.

pub fn set_scroll_offset(&self, ofs: Vector2)[src]

The ParallaxBackground's scroll value. Calculated automatically when using a [Camera2D], but can be used to manually manage scrolling when no camera is present.

Methods from Deref<Target = CanvasLayer>

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

Returns the RID of the canvas used by this layer.

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

The custom [Viewport] node assigned to the [CanvasLayer]. If [code]null[/code], uses the default viewport instead.

pub fn follow_viewport_scale(&self) -> f64[src]

Scales the layer when using [member follow_viewport_enable]. Layers moving into the foreground should have increasing scales, while layers moving into the background should have decreasing scales.

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

Layer index for draw order. Lower values are drawn first.

pub fn offset(&self) -> Vector2[src]

The layer's base offset.

pub fn rotation(&self) -> f64[src]

The layer's rotation in radians.

pub fn rotation_degrees(&self) -> f64[src]

The layer's rotation in degrees.

pub fn scale(&self) -> Vector2[src]

The layer's scale.

pub fn transform(&self) -> Transform2D[src]

The layer's transform.

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

Sets the layer to follow the viewport in order to simulate a pseudo 3D effect.

pub fn set_custom_viewport(&self, viewport: impl AsArg<Node>)[src]

The custom [Viewport] node assigned to the [CanvasLayer]. If [code]null[/code], uses the default viewport instead.

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

Sets the layer to follow the viewport in order to simulate a pseudo 3D effect.

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

Scales the layer when using [member follow_viewport_enable]. Layers moving into the foreground should have increasing scales, while layers moving into the background should have decreasing scales.

pub fn set_layer(&self, layer: i64)[src]

Layer index for draw order. Lower values are drawn first.

pub fn set_offset(&self, offset: Vector2)[src]

The layer's base offset.

pub fn set_rotation(&self, radians: f64)[src]

The layer's rotation in radians.

pub fn set_rotation_degrees(&self, degrees: f64)[src]

The layer's rotation in degrees.

pub fn set_scale(&self, scale: Vector2)[src]

The layer's scale.

pub fn set_transform(&self, transform: Transform2D)[src]

The layer's transform.

Trait Implementations

impl Debug for ParallaxBackground[src]

impl Deref for ParallaxBackground[src]

type Target = CanvasLayer

The resulting type after dereferencing.

impl DerefMut for ParallaxBackground[src]

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

impl QueueFree for ParallaxBackground[src]

impl Sealed for ParallaxBackground[src]

impl SubClass<CanvasLayer> for ParallaxBackground[src]

impl SubClass<Node> for ParallaxBackground[src]

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