TiledGlobals

public class TiledGlobals

Overview

The TiledGlobals object provides information about the framework, as well as allowing you to set default SKTiled attributes.

Properties

Property Description
renderer Returns the current SpriteKit renderer (get-only).
loggingLevel Logging verbosity.
updateMode Default tile update mode.
enableRenderCallbacks Enable callbacks from the tilemap on rendering statistics.
enableCameraCallbacks Enable callbacks from camera to camera delegates.
renderQuality Global render quality values.
contentScale Returns the device retina display scale factor.
version Returns the current framework version.

Usage

SKTiled object default values are set in the TiledGlobals object.

// access the default singleton instance
let tiledGlobals = TiledGlobals.default

// disable camera callbacks
tiledGlobals.enableCameraCallbacks = false

// set debugging mouse filters (macOS)
tiledGlobals.debug.mouseFilters = [.tileCoordinates, .tilesUnderCursor]

// increase the default text object render quality
tiledGlobals.renderQuality.text = 12.0
  • ▶︎default

    Default singleton instance.

    Declaration

    Swift

    public static let `default`: TiledGlobals
  • ▶︎renderer

    Current SpriteKit renderer.

    Declaration

    Swift

    public private(set) var renderer: Renderer { get }
  • ▶︎loggingLevel

    Default logging verbosity.

    Declaration

    Swift

    public var loggingLevel: LoggingLevel
  • ▶︎updateMode

    Default tile update mode.

    Declaration

    Swift

    public var updateMode: TileUpdateMode
  • Enable callbacks for render performance statistics.

    Declaration

    Swift

    public var enableRenderCallbacks: Bool
  • Enable callbacks from camera to camera delegates.

    Declaration

    Swift

    public var enableCameraCallbacks: Bool
  • Default tile/object render quality attributes.

    Declaration

    Swift

    public var renderQuality: RenderQuality
  • ▶︎debug

    Debugging display options.

    Declaration

    Swift

    public var debug: DebugDisplayOptions
  • Render statistics display.

    Declaration

    Swift

    public var timeDisplayMode: TimeDisplayMode
  • ▶︎contentScale

    Returns the current device backing scale.

    Declaration

    Swift

    public var contentScale: CGFloat { get }
  • ▶︎version

    Returns current framework version.

    Declaration

    Swift

    public lazy var version: Version { get set }
  • ▶︎identifier

    Returns current bundle identifier name.

    Declaration

    Swift

    public lazy var identifier: String { get set }
  • ▶︎Version

    Overview

    Structure representing the framework version (semantic version).

    Properties

    Property Description
    major Framework major version.
    minor Framework minor version.
    patch Framework patch version
    build Framework build versions.
    suffix Version suffix.
    See more

    Declaration

    Swift

    public struct Version
    extension TiledGlobals.Version: CustomStringConvertible, CustomDebugStringConvertible
  • Overview

    Represents object’s render quality when dealing with higher resolutions.

    Properties

    Property Description
    default Global render quality.
    object Object render quality.
    text Text object render quality
    override Override value.

    Declaration

    Swift

    public struct RenderQuality
  • Overview

    Global debug display properties.

    See more

    Declaration

    Swift

    public struct DebugDisplayOptions
  • Overview

    Display flag for render statistics.

    Properties

    Property Description
    milliseconds Show render time in milliseconds.
    seconds Show render time in seconds.

    Declaration

    Swift

    public enum TimeDisplayMode : Int
  • ▶︎Renderer

    Overview

    Indicates the current renderer (OpenGL or Metal).

    Properties

    Property Description
    opengl Indicates the current SpriteKit renderer is OpenGL.
    metal Indicates the current SpriteKit renderer is Metal.

    Declaration

    Swift

    public enum Renderer