CollisionShape2D
A node that provides a Shape2D
to a CollisionObject2D
parent.
class CollisionShape2D
A node that provides a Shape2D
to a CollisionObject2D
parent and allows to edit it. This can give a detection shape to an Area2D
or turn a PhysicsBody2D
into a solid object.
Superclasses
class Node2D
A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
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 Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
var debugColor: Color
The collision shape debug color.
var disabled: Bool
A disabled collision shape has no effect in the world. This property should be changed with
setDeferred(property:value:)
.var oneWayCollision: Bool
Sets whether this collision shape should only detect collision on one side (top or bottom).
var oneWayCollisionMargin: Double
The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the shape at a high velocity.
var shape: Shape2D?
The actual shape owned by this collision shape.