Documentation
¶
Overview ¶
Package Camera2D provides methods for working with Camera2D object instances.
Index ¶
- type Advanced
- type AnchorMode
- type Any
- type Camera2DProcessCallback
- type Instance
- func (self Instance) Align()
- func (self Instance) AnchorMode() gdclass.Camera2DAnchorMode
- func (self Instance) AsCamera2D() 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) CustomViewport() [1]gdclass.Node
- func (self Instance) DragBottomMargin() Float.X
- func (self Instance) DragHorizontalEnabled() bool
- func (self Instance) DragHorizontalOffset() Float.X
- func (self Instance) DragLeftMargin() Float.X
- func (self Instance) DragRightMargin() Float.X
- func (self Instance) DragTopMargin() Float.X
- func (self Instance) DragVerticalEnabled() bool
- func (self Instance) DragVerticalOffset() Float.X
- func (self Instance) EditorDrawDragMargin() bool
- func (self Instance) EditorDrawLimits() bool
- func (self Instance) EditorDrawScreen() bool
- func (self Instance) Enabled() bool
- func (self Instance) ForceUpdateScroll()
- func (self Instance) GetScreenCenterPosition() Vector2.XY
- func (self Instance) GetTargetPosition() Vector2.XY
- func (self Instance) IgnoreRotation() bool
- func (self Instance) IsCurrent() bool
- func (self Instance) LimitBottom() int
- func (self Instance) LimitLeft() int
- func (self Instance) LimitRight() int
- func (self Instance) LimitSmoothed() bool
- func (self Instance) LimitTop() int
- func (self Instance) MakeCurrent()
- func (self Instance) Offset() Vector2.XY
- func (self Instance) PositionSmoothingEnabled() bool
- func (self Instance) PositionSmoothingSpeed() Float.X
- func (self Instance) ProcessCallback() gdclass.Camera2DCamera2DProcessCallback
- func (self Instance) ResetSmoothing()
- func (self Instance) RotationSmoothingEnabled() bool
- func (self Instance) RotationSmoothingSpeed() Float.X
- func (self Instance) SetAnchorMode(value gdclass.Camera2DAnchorMode)
- func (self Instance) SetCustomViewport(value [1]gdclass.Node)
- func (self Instance) SetDragBottomMargin(value Float.X)
- func (self Instance) SetDragHorizontalEnabled(value bool)
- func (self Instance) SetDragHorizontalOffset(value Float.X)
- func (self Instance) SetDragLeftMargin(value Float.X)
- func (self Instance) SetDragRightMargin(value Float.X)
- func (self Instance) SetDragTopMargin(value Float.X)
- func (self Instance) SetDragVerticalEnabled(value bool)
- func (self Instance) SetDragVerticalOffset(value Float.X)
- func (self Instance) SetEditorDrawDragMargin(value bool)
- func (self Instance) SetEditorDrawLimits(value bool)
- func (self Instance) SetEditorDrawScreen(value bool)
- func (self Instance) SetEnabled(value bool)
- func (self Instance) SetIgnoreRotation(value bool)
- func (self Instance) SetLimitBottom(value int)
- func (self Instance) SetLimitLeft(value int)
- func (self Instance) SetLimitRight(value int)
- func (self Instance) SetLimitSmoothed(value bool)
- func (self Instance) SetLimitTop(value int)
- func (self Instance) SetOffset(value Vector2.XY)
- func (self Instance) SetPositionSmoothingEnabled(value bool)
- func (self Instance) SetPositionSmoothingSpeed(value Float.X)
- func (self Instance) SetProcessCallback(value gdclass.Camera2DCamera2DProcessCallback)
- func (self Instance) SetRotationSmoothingEnabled(value bool)
- func (self Instance) SetRotationSmoothingSpeed(value Float.X)
- func (self Instance) SetZoom(value Vector2.XY)
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) Zoom() Vector2.XY
- type Side
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 AnchorMode ¶
type AnchorMode = gdclass.Camera2DAnchorMode //gd:Camera2D.AnchorMode
const ( /*The camera's position is fixed so that the top-left corner is always at the origin.*/ AnchorModeFixedTopLeft AnchorMode = 0 /*The camera's position takes into account vertical/horizontal offsets and the screen size.*/ AnchorModeDragCenter AnchorMode = 1 )
type Camera2DProcessCallback ¶
type Camera2DProcessCallback = gdclass.Camera2DCamera2DProcessCallback //gd:Camera2D.Camera2DProcessCallback
const ( /*The camera updates during physics frames (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]).*/ Camera2dProcessPhysics Camera2DProcessCallback = 0 /*The camera updates during process frames (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]).*/ Camera2dProcessIdle Camera2DProcessCallback = 1 )
type Instance ¶
Camera node for 2D scenes. It forces the screen (current layer) to scroll following this node. This makes it easier (and faster) to program scrollable scenes than manually changing the position of [CanvasItem]-based nodes. Cameras register themselves in the nearest [Viewport] node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport. This node is intended to be a simple helper to get things going quickly, but more functionality may be desired to change how the camera works. To make your own custom camera node, inherit it from [Node2D] and change the transform of the canvas by setting [member Viewport.canvas_transform] in [Viewport] (you can obtain the current [Viewport] by using [method Node.get_viewport]). Note that the [Camera2D] node's [code]position[/code] doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use [method get_screen_center_position] to get the real position.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AnchorMode ¶
func (self Instance) AnchorMode() gdclass.Camera2DAnchorMode
func (Instance) AsCamera2D ¶
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) CustomViewport ¶
func (Instance) DragBottomMargin ¶
func (Instance) DragHorizontalEnabled ¶
func (Instance) DragHorizontalOffset ¶
func (Instance) DragLeftMargin ¶
func (Instance) DragRightMargin ¶
func (Instance) DragTopMargin ¶
func (Instance) DragVerticalEnabled ¶
func (Instance) DragVerticalOffset ¶
func (Instance) EditorDrawDragMargin ¶
func (Instance) EditorDrawLimits ¶
func (Instance) EditorDrawScreen ¶
func (Instance) ForceUpdateScroll ¶
func (self Instance) ForceUpdateScroll()
Forces the camera to update scroll immediately.
func (Instance) GetScreenCenterPosition ¶
Returns the center of the screen from this camera's point of view, in global coordinates. [b]Note:[/b] The exact targeted position of the camera may be different. See [method get_target_position].
func (Instance) GetTargetPosition ¶
Returns this camera's target position, in global coordinates. [b]Note:[/b] The returned value is not the same as [member Node2D.global_position], as it is affected by the drag properties. It is also not the same as the current position if [member position_smoothing_enabled] is [code]true[/code] (see [method get_screen_center_position]).
func (Instance) IgnoreRotation ¶
func (Instance) IsCurrent ¶
Returns [code]true[/code] if this [Camera2D] is the active camera (see [method Viewport.get_camera_2d]).
func (Instance) LimitBottom ¶
func (Instance) LimitRight ¶
func (Instance) LimitSmoothed ¶
func (Instance) MakeCurrent ¶
func (self Instance) MakeCurrent()
Forces this [Camera2D] to become the current active one. [member enabled] must be [code]true[/code].
func (Instance) PositionSmoothingEnabled ¶
func (Instance) PositionSmoothingSpeed ¶
func (Instance) ProcessCallback ¶
func (self Instance) ProcessCallback() gdclass.Camera2DCamera2DProcessCallback
func (Instance) ResetSmoothing ¶
func (self Instance) ResetSmoothing()
Sets the camera's position immediately to its current smoothing destination. This method has no effect if [member position_smoothing_enabled] is [code]false[/code].
func (Instance) RotationSmoothingEnabled ¶
func (Instance) RotationSmoothingSpeed ¶
func (Instance) SetAnchorMode ¶
func (self Instance) SetAnchorMode(value gdclass.Camera2DAnchorMode)
func (Instance) SetCustomViewport ¶
func (Instance) SetDragBottomMargin ¶
func (Instance) SetDragHorizontalEnabled ¶
func (Instance) SetDragHorizontalOffset ¶
func (Instance) SetDragLeftMargin ¶
func (Instance) SetDragRightMargin ¶
func (Instance) SetDragTopMargin ¶
func (Instance) SetDragVerticalEnabled ¶
func (Instance) SetDragVerticalOffset ¶
func (Instance) SetEditorDrawDragMargin ¶
func (Instance) SetEditorDrawLimits ¶
func (Instance) SetEditorDrawScreen ¶
func (Instance) SetEnabled ¶
func (Instance) SetIgnoreRotation ¶
func (Instance) SetLimitBottom ¶
func (Instance) SetLimitLeft ¶
func (Instance) SetLimitRight ¶
func (Instance) SetLimitSmoothed ¶
func (Instance) SetLimitTop ¶
func (Instance) SetPositionSmoothingEnabled ¶
func (Instance) SetPositionSmoothingSpeed ¶
func (Instance) SetProcessCallback ¶
func (self Instance) SetProcessCallback(value gdclass.Camera2DCamera2DProcessCallback)
func (Instance) SetRotationSmoothingEnabled ¶
func (Instance) SetRotationSmoothingSpeed ¶
func (*Instance) UnsafePointer ¶
type Side ¶
type Side int
const ( /*Left side, usually used for [Control] or [StyleBox]-derived classes.*/ SideLeft Side = 0 /*Top side, usually used for [Control] or [StyleBox]-derived classes.*/ SideTop Side = 1 /*Right side, usually used for [Control] or [StyleBox]-derived classes.*/ SideRight Side = 2 /*Bottom side, usually used for [Control] or [StyleBox]-derived classes.*/ SideBottom Side = 3 )