Options
All
  • Public
  • Public/Protected
  • All
Menu

Tracer enables and tracks line drawing

Hierarchy

  • Tracer

Index

Constructors

constructor

  • new Tracer(parent: DisplayObjectContainer, rectOrPreset: Rectangle | { bitmap: BitmapData; x: number; y: number }, markerSize?: number, markerColor?: string): Tracer
  • Parameters

    • parent: DisplayObjectContainer
    • rectOrPreset: Rectangle | { bitmap: BitmapData; x: number; y: number }
    • Default value markerSize: number = 1
    • Optional markerColor: string

    Returns Tracer

Properties

onComplete

onComplete: Signal = new Phaser.Signal()

Signal that fires when the tracing is completed (i.e. all trace targets are hit)

Accessors

eraserMode

  • get eraserMode(): boolean
  • set eraserMode(on: boolean): void
  • Eraser mode clears pixels instead of filling with marker color

    Returns boolean

  • Eraser mode clears pixels instead of filling with marker color

    Parameters

    • on: boolean

    Returns void

isPaused

  • get isPaused(): boolean
  • Returns boolean

isTracing

  • get isTracing(): boolean
  • Returns true if currently tracing/drawing

    Returns boolean

markerColor

  • get markerColor(): string
  • set markerColor(color: string): void
  • The color of the marker in hex string

    Returns string

  • The color of the marker in hex string

    Parameters

    • color: string

    Returns void

markerSize

  • get markerSize(): number
  • set markerSize(size: number): void
  • The width of the marker in pixels

    Returns number

  • The width of the marker in pixels

    Parameters

    • size: number

    Returns void

mask

  • get mask(): Sprite
  • set mask(sprite: Sprite): void
  • A mask for the drawn tracing

    Returns Sprite

  • A mask for the drawn tracing

    Parameters

    • sprite: Sprite

    Returns void

nativeTracer

  • get nativeTracer(): any
  • The native tracer. This should only be used internally by the framework.

    Returns any

tracedAsBmp

  • get tracedAsBmp(): BitmapData
  • Returns the bitmap that collects the trace lines. Use with care.

    Returns BitmapData

tracedAsSprite

  • get tracedAsSprite(): Sprite
  • Returns the sprite that collects the trace lines. Use with care.

    Returns Sprite

Methods

clear

  • clear(): void
  • Erase all drawn tracing

    Returns void

destroy

  • destroy(): void
  • Returns void

pause

  • pause(): void
  • Pause the tracer from accepting any input

    Returns void

restart

  • restart(): void
  • Restart the tracer with the same target points and clearing existing trace/drawing

    Returns void

resume

  • resume(): void
  • Pause the tracer from accepting any input

    Returns void

setSoundEffect

  • setSoundEffect(_group: string, _sprite: string): void
  • Parameters

    • _group: string
    • _sprite: string

    Returns void

start

  • Sets new target points and starts/unpauses

    Parameters

    • points: Array<Array<Point>>

      Array of arrays of Phaser.Points defining the required targets

    • type: TraceType

      Type of trace being started

    • targetType: TraceTargetType

      Type of targets and when/if to show them

    Returns void