TiledGlobals

public class TiledGlobals

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

Properties

  • renderer: returns the current SpriteKit renderer (get-only).
  • loggingLevel: global 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 framework 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.debugDisplayOptions.mouseFilters = [.tileCoordinates, .tilesUnderCursor]

// increase the default text object render quality
tiledGlobals.renderQuality.text = 12.0
  • Default TiledGlobals singleton.

    Declaration

    Swift

    public static var `default`: TiledGlobals { get }

Framework Globals

Framework Directories

  • Returns a prefernces path directory in the current user’s home directory (macOS only).

    Declaration

    Swift

    public var exportDirectory: URL? { get }

    Return Value

    url of created directory.

Demo Properties

  • Enable the demo app to load demo content.

    Declaration

    Swift

    public var allowDemoMaps: Bool
  • Enable the demo app to load user content.

    Declaration

    Swift

    public var allowUserMaps: Bool
  • Enable mouse events (macOS).

    Declaration

    Swift

    public var enableMouseEvents: Bool
  • Image types readable by Tiled.

    Declaration

    Swift

    public var validImageTypes: [String]
  • File types readable by Tiled.

    Declaration

    Swift

    public var validFileTypes: [String]
  • The Version structure represents the framework version (semantic version).

    Properties

    • 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
  • The RenderQuality structure represents the render scaling factor used when dealing with higher resolutions & retina screen scale factors.

    Properties

    • default: global render quality.
    • object: object render quality.
    • text: text object render quality
    • override: override value.
    See more

    Declaration

    Swift

    public struct RenderQuality
  • The DebugDisplayOptions structure represents global debugging visualization attributes.

    Properties

    • mouseFilters: mouse interaction options.
    • mousePointerSize: mouse pointer font size.
    • highlightDuration: global highlight duration for selectable objects.
    See more

    Declaration

    Swift

    public struct DebugDisplayOptions
  • Display flag for render statistics.

    Properties

    • milliseconds: show render time in milliseconds.
    • seconds: show render time in seconds.

    Declaration

    Swift

    public enum TimeDisplayMode : Int, CaseIterable
  • Indicates the current renderer (OpenGL or Metal).

    Properties

    • opengl: indicates the current SpriteKit renderer is OpenGL.
    • metal: indicates the current SpriteKit renderer is Metal.
    See more

    Declaration

    Swift

    public enum Renderer

Deprecations

  • Debugging display options.

    Declaration

    Swift

    @available(*, deprecated, renamed: "debugDisplayOptions")
    public var debug: DebugDisplayOptions { get set }
  • Enable callbacks for render performance statistics.

    Declaration

    Swift

    @available(*, deprecated, renamed: "enableRenderPerformanceCallbacks")
    public var enableRenderCallbacks: Bool { get set }