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 ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode2D() Node2D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsParallax2D() Instance
- func (self Instance) Autoscroll() Vector2.XY
- func (self Instance) FollowViewport() bool
- func (self Instance) ID() ID
- func (self Instance) IgnoreCameraScroll() bool
- func (self Instance) LimitBegin() Vector2.XY
- func (self Instance) LimitEnd() Vector2.XY
- func (self Instance) RepeatSize() Vector2.XY
- func (self Instance) RepeatTimes() int
- func (self Instance) ScreenOffset() Vector2.XY
- func (self Instance) ScrollOffset() Vector2.XY
- func (self Instance) ScrollScale() Vector2.XY
- func (self Instance) SetAutoscroll(value Vector2.XY)
- func (self Instance) SetFollowViewport(value bool)
- func (self Instance) SetIgnoreCameraScroll(value bool)
- func (self Instance) SetLimitBegin(value Vector2.XY)
- func (self Instance) SetLimitEnd(value Vector2.XY)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetRepeatSize(value Vector2.XY)
- func (self Instance) SetRepeatTimes(value int)
- func (self Instance) SetScreenOffset(value Vector2.XY)
- func (self Instance) SetScrollOffset(value Vector2.XY)
- func (self Instance) SetScrollScale(value Vector2.XY)
- func (self Instance) Virtual(name string) reflect.Value
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 Extension ¶
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]) AsParallax2D ¶
type 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.
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 (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance