Parallax2D

package
v0.0.0-...-0d6c339 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

A graphics.gd/classdb/Parallax2D is used to create a parallax effect. It can move at a different speed relative to the camera movement using Instance.ScrollScale. This creates an illusion of depth in a 2D game. If manual scrolling is desired, the graphics.gd/classdb/Camera2D position can be ignored with Instance.IgnoreCameraScroll.

Note: Any changes to this node's position made after it enters the scene tree will be overridden if Instance.IgnoreCameraScroll is false or Instance.ScreenOffset is modified.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsParallax2D() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsCanvasItem

func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode2D

func (self *Extension[T]) AsNode2D() Node2D.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsParallax2D

func (self *Extension[T]) AsParallax2D() Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.Parallax2D

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode2D

func (self Instance) AsNode2D() Node2D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsParallax2D

func (self Instance) AsParallax2D() Instance

func (Instance) Autoscroll

func (self Instance) Autoscroll() Vector2.XY

func (Instance) FollowViewport

func (self Instance) FollowViewport() bool

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IgnoreCameraScroll

func (self Instance) IgnoreCameraScroll() bool

func (Instance) LimitBegin

func (self Instance) LimitBegin() Vector2.XY

func (Instance) LimitEnd

func (self Instance) LimitEnd() Vector2.XY

func (Instance) RepeatSize

func (self Instance) RepeatSize() Vector2.XY

func (Instance) RepeatTimes

func (self Instance) RepeatTimes() int

func (Instance) ScreenOffset

func (self Instance) ScreenOffset() Vector2.XY

func (Instance) ScrollOffset

func (self Instance) ScrollOffset() Vector2.XY

func (Instance) ScrollScale

func (self Instance) ScrollScale() Vector2.XY

func (Instance) SetAutoscroll

func (self Instance) SetAutoscroll(value Vector2.XY)

func (Instance) SetFollowViewport

func (self Instance) SetFollowViewport(value bool)

func (Instance) SetIgnoreCameraScroll

func (self Instance) SetIgnoreCameraScroll(value bool)

func (Instance) SetLimitBegin

func (self Instance) SetLimitBegin(value Vector2.XY)

func (Instance) SetLimitEnd

func (self Instance) SetLimitEnd(value Vector2.XY)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetRepeatSize

func (self Instance) SetRepeatSize(value Vector2.XY)

func (Instance) SetRepeatTimes

func (self Instance) SetRepeatTimes(value int)

func (Instance) SetScreenOffset

func (self Instance) SetScreenOffset(value Vector2.XY)

func (Instance) SetScrollOffset

func (self Instance) SetScrollOffset(value Vector2.XY)

func (Instance) SetScrollScale

func (self Instance) SetScrollScale(value Vector2.XY)

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL