PointLight2D
Positional 2D light source.
PointLight2D.swift:11class PointLight2D
Casts light in a 2D environment. This light’s shape is defined by a (usually grayscale) texture.
Superclasses
class Light2D
Casts light in a 2D environment.
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 height: Double
The height of the light. Used with 2D normal mapping. The units are in pixels, e.g. if the height is 100, then it will illuminate an object 100 pixels away at a 45° angle to the plane.
var offset: Vector2
The offset of the light’s
texture
.var texture: Texture2D?
Texture2D
used for the light’s appearance.var textureScale: Double
The
texture
’s scale factor.