LightwellLayerInfo

public struct LightwellLayerInfo

A struct containing all of the info to display static layer content.

All layers share display properties related to positioning, sizing, transforming, and transparency. Additionally, if an ambient animation was defined in the Lightwell editor, a CAAnimation will be stored in LightwellLayerInfo.ambientAnimation.

The layer info will have a different LightwellLayerInfo.LayerContent depending on the contents that were defined for the layer in the Lightwell editor.

  • The name of the layer, and the key for LightwellLoadingContext.view(for:)

    Declaration

    Swift

    public var name: String?
  • The position relative to the default iOS origin (top left).

    Declaration

    Swift

    public var position: CGPoint
  • The size of the contents before transforms are applied.

    Declaration

    Swift

    public var size: CGSize
  • The anchor point defining what point in the layer the position corresponds to and where transforms will be applied around. Normalized between top left (0.0, 0.0), and bottom right (1.0, 1.0).

    Declaration

    Swift

    public var anchorPoint: CGPoint
  • The affine transform combining scale and rotation values.

    Declaration

    Swift

    public var transform: CGAffineTransform
  • The opacity of the layer.

    Declaration

    Swift

    public var alpha: CGFloat
  • A looping, autoreversing, additive animation.

    Declaration

    Swift

    public var ambientAnimation: CAAnimation?
  • Specifies the type of content, and contains all of the information needed to describe how to display it.

    Declaration

    Swift

    public var content: LightwellLayerInfo.LayerContent
  • An enum defining all of the potential types of layer content exported from Lightwell.

    Each type has different associated information to describe the contents.

    • image: corresponds to a layer linked to a single png or jpg image. If the linked image cannot be found in the current project, the associated image will be nil.
    • imageSequence: corresponds to a layer linked to multiple images defining frame-by-frame animation. For more details on the associated content see ImageSequenceDetail.
    • box: corresponds to a rectange pimitive shape defined in Lightwell. For more details on the associated content see BoxDetail.
    • shape: corresponds to all other pimitive shapes defined in Lightwell. For more details on the associated content see ShapeDetail.
    • vector: corresponds to a layer linked to an svg asset. It will store an array of ShapeDetail defining all of the nested shapes.
    • text: corresponds to a text layer. It will store all of the font, color, and text infomation. For more details on the associated content see TextDetail.
    • scrollArea: corresponds to a scroll layer. It will store the background color and content size. For more details on the associated content see ScrollAreaDetail.
    • unspecified: corresponds to a layer without any contents and has no associated details.
    See more

    Declaration

    Swift

    public enum LayerContent
  • A struct storing all of the information describing frame-by-frame animatable content.

    See more

    Declaration

    Swift

    public struct ImageSequenceDetail
  • A struct storing all of the information describing text content.

    See more

    Declaration

    Swift

    public struct TextDetail
  • A struct storing all of the information describing rectangle shape content.

    See more

    Declaration

    Swift

    public struct BoxDetail
  • A struct storing all of the information describing shape content. This includes the primitive shapes and polygons from Lightwell and path information from svg assets.

    See more

    Declaration

    Swift

    public struct ShapeDetail
  • A struct storing all of the information describing a scrolling container.

    See more

    Declaration

    Swift

    public struct ScrollAreaDetail