Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
SpaceOverride
Area2D.swift:28enum SpaceOverride
Cases
case disabled
This area does not affect gravity/damping.
case combine
This area adds its gravity/damping values to whatever has been calculated so far (in
priority
order).case combineReplace
This area adds its gravity/damping values to whatever has been calculated so far (in
priority
order), ignoring any lower priority areas.case replace
This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas.
case replaceCombine
This area replaces any gravity/damping calculated so far (in
priority
order), but keeps calculating the rest of the areas.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (38) members.
Types
class Signal1
Signal support.
class Signal2
Signal support.
class Signal3
Signal support.
class Signal4
Signal support.
class Signal5
Signal support.
class Signal6
Signal support.
class Signal7
Signal support.
class Signal8
Signal support.
Type members
Instance members
var angularDamp: Double
The rate at which objects stop spinning in this area. Represents the angular velocity lost per second.
var angularDampSpaceOverride: Area2D.SpaceOverride
Override mode for angular damping calculations within this area. See
SpaceOverride
for possible values.var areaEntered: Signal7
Emitted when the received
area
enters this area. Requiresmonitoring
to be set totrue
.var areaExited: Signal8
Emitted when the received
area
exits this area. Requiresmonitoring
to be set totrue
.var areaShapeEntered: Signal5
Emitted when a
Shape2D
of the receivedarea
enters a shape of this area. Requiresmonitoring
to be set totrue
.var areaShapeExited: Signal6
Emitted when a
Shape2D
of the receivedarea
exits a shape of this area. Requiresmonitoring
to be set totrue
.var audioBusName: StringName
The name of the area’s audio bus.
var audioBusOverride: Bool
If
true
, the area’s audio bus overrides the default audio bus.var bodyEntered: Signal3
Emitted when the received
body
enters this area.body
can be aPhysicsBody2D
or aTileMap
.TileMap
s are detected if theirTileSet
has collision shapes configured. Requiresmonitoring
to be set totrue
.var bodyExited: Signal4
Emitted when the received
body
exits this area.body
can be aPhysicsBody2D
or aTileMap
.TileMap
s are detected if theirTileSet
has collision shapes configured. Requiresmonitoring
to be set totrue
.var bodyShapeEntered: Signal1
Emitted when a
Shape2D
of the receivedbody
enters a shape of this area.body
can be aPhysicsBody2D
or aTileMap
.TileMap
s are detected if theirTileSet
has collision shapes configured. Requiresmonitoring
to be set totrue
.var bodyShapeExited: Signal2
Emitted when a
Shape2D
of the receivedbody
exits a shape of this area.body
can be aPhysicsBody2D
or aTileMap
.TileMap
s are detected if theirTileSet
has collision shapes configured. Requiresmonitoring
to be set totrue
.var gravity: Double
The area’s gravity intensity (in pixels per second squared). This value multiplies the gravity direction. This is useful to alter the force of gravity without altering its direction.
var gravityDirection: Vector2
The area’s gravity vector (not normalized).
var gravityPoint: Bool
If
true
, gravity is calculated from a point (set viagravityPointCenter
). See alsogravitySpaceOverride
.var gravityPointCenter: Vector2
If gravity is a point (see
gravityPoint
), this will be the point of attraction.var gravityPointUnitDistance: Double
The distance at which the gravity strength is equal to
gravity
. For example, on a planet 100 pixels in radius with a surface gravity of 4.0 px/s², set thegravity
to 4.0 and the unit distance to 100.0. The gravity will have falloff according to the inverse square law, so in the example, at 200 pixels from the center the gravity will be 1.0 px/s² (twice the distance, 1/4th the gravity), at 50 pixels it will be 16.0 px/s² (half the distance, 4x the gravity), and so on.var gravitySpaceOverride: Area2D.SpaceOverride
Override mode for gravity calculations within this area. See
SpaceOverride
for possible values.var linearDamp: Double
The rate at which objects stop moving in this area. Represents the linear velocity lost per second.
var linearDampSpaceOverride: Area2D.SpaceOverride
Override mode for linear damping calculations within this area. See
SpaceOverride
for possible values.var monitorable: Bool
If
true
, other monitoring areas can detect this area.var monitoring: Bool
If
true
, the area detects bodies or areas entering and exiting it.var priority: Int32
The area’s priority. Higher priority areas are processed first. The
World2D
’s physics is always processed last, after all areas.func getOverlappingAreas(
) -> ObjectCollection<Area2D> Returns a list of intersecting
Area2D
s. The overlapping area’scollisionLayer
must be part of this area’scollisionMask
in order to be detected.func getOverlappingBodies(
) -> ObjectCollection<Node2D> Returns a list of intersecting
PhysicsBody2D
s andTileMap
s. The overlapping body’scollisionLayer
must be part of this area’scollisionMask
in order to be detected.func hasOverlappingAreas(
) -> Bool Returns
true
if intersecting anyArea2D
s, otherwise returnsfalse
. The overlapping area’scollisionLayer
must be part of this area’scollisionMask
in order to be detected.func hasOverlappingBodies(
) -> Bool Returns
true
if intersecting anyPhysicsBody2D
s orTileMap
s, otherwise returnsfalse
. The overlapping body’scollisionLayer
must be part of this area’scollisionMask
in order to be detected.func overlapsArea(Node?
) -> Bool Returns
true
if the givenArea2D
intersects or overlaps thisArea2D
,false
otherwise.func overlapsBody(Node?
) -> Bool Returns
true
if the given physics body intersects or overlaps thisArea2D
,false
otherwise.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.