Documentation ¶
Overview ¶
Package NavigationRegion2D provides methods for working with NavigationRegion2D object instances.
Index ¶
- type Advanced
- type Any
- type Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsNavigationRegion2D() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode2D() Node2D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) BakeNavigationPolygon()
- func (self Instance) Enabled() bool
- func (self Instance) EnterCost() Float.X
- func (self Instance) GetNavigationLayerValue(layer_number int) bool
- func (self Instance) GetNavigationMap() RID.NavigationMap2D
- func (self Instance) GetRegionRid() RID.NavigationRegion2D
- func (self Instance) GetRid() RID.NavigationRegion2D
- func (self Instance) IsBaking() bool
- func (self Instance) NavigationLayers() int
- func (self Instance) NavigationPolygon() [1]gdclass.NavigationPolygon
- func (self Instance) OnBakeFinished(cb func())
- func (self Instance) OnNavigationPolygonChanged(cb func())
- func (self Instance) SetEnabled(value bool)
- func (self Instance) SetEnterCost(value Float.X)
- func (self Instance) SetNavigationLayerValue(layer_number int, value bool)
- func (self Instance) SetNavigationLayers(value int)
- func (self Instance) SetNavigationMap(navigation_map RID.NavigationMap2D)
- func (self Instance) SetNavigationPolygon(value [1]gdclass.NavigationPolygon)
- func (self Instance) SetTravelCost(value Float.X)
- func (self Instance) SetUseEdgeConnections(value bool)
- func (self Instance) TravelCost() Float.X
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) UseEdgeConnections() bool
- 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 Instance ¶
type Instance [1]gdclass.NavigationRegion2D
A traversable 2D region based on a [NavigationPolygon] that [NavigationAgent2D]s can use for pathfinding. Two regions can be connected to each other if they share a similar edge. You can set the minimum distance between two vertices required to connect two edges by using [method NavigationServer2D.map_set_edge_connection_margin]. [b]Note:[/b] Overlapping two regions' navigation polygons is not enough for connecting two regions. They must share a similar edge. The pathfinding cost of entering a region from another region can be controlled with the [member enter_cost] value. [b]Note:[/b] This value is not added to the path cost when the start position is already inside this region. The pathfinding cost of traveling distances inside this region can be controlled with the [member travel_cost] multiplier. [b]Note:[/b] This node caches changes to its properties, so if you make changes to the underlying region [RID] in [NavigationServer2D], they will not be reflected in this node's properties.
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
func (Instance) AsNavigationRegion2D ¶
func (Instance) BakeNavigationPolygon ¶
func (self Instance) BakeNavigationPolygon()
Bakes the [NavigationPolygon]. If [param on_thread] is set to [code]true[/code] (default), the baking is done on a separate thread.
func (Instance) GetNavigationLayerValue ¶
Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32.
func (Instance) GetNavigationMap ¶
func (self Instance) GetNavigationMap() RID.NavigationMap2D
Returns the current navigation map [RID] used by this region.
func (Instance) GetRegionRid ¶
func (self Instance) GetRegionRid() RID.NavigationRegion2D
Returns the [RID] of this region on the [NavigationServer2D].
func (Instance) GetRid ¶
func (self Instance) GetRid() RID.NavigationRegion2D
Returns the [RID] of this region on the [NavigationServer2D]. Combined with [method NavigationServer2D.map_get_closest_point_owner] can be used to identify the [NavigationRegion2D] closest to a point on the merged navigation map.
func (Instance) IsBaking ¶
Returns [code]true[/code] when the [NavigationPolygon] is being baked on a background thread.
func (Instance) NavigationLayers ¶
func (Instance) NavigationPolygon ¶
func (self Instance) NavigationPolygon() [1]gdclass.NavigationPolygon
func (Instance) OnBakeFinished ¶
func (self Instance) OnBakeFinished(cb func())
func (Instance) OnNavigationPolygonChanged ¶
func (self Instance) OnNavigationPolygonChanged(cb func())
func (Instance) SetEnabled ¶
func (Instance) SetEnterCost ¶
func (Instance) SetNavigationLayerValue ¶
Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32.
func (Instance) SetNavigationLayers ¶
func (Instance) SetNavigationMap ¶
func (self Instance) SetNavigationMap(navigation_map RID.NavigationMap2D)
Sets the [RID] of the navigation map this region should use. By default the region will automatically join the [World2D] default navigation map so this function is only required to override the default map.
func (Instance) SetNavigationPolygon ¶
func (self Instance) SetNavigationPolygon(value [1]gdclass.NavigationPolygon)