Ticker

Creates a PIXI.Ticker

Children of this component can use onTick to hook into the update loop.

Usage

<script>
  import { Ticker, Text } from 'svelte-pixi'

  let delta = 0
</script>

<Ticker
  on:tick={(ev) => {
    delta = ev.detail
  }}>
  <Text
    x={200}
    y={200}
    text={`Delta: ${delta.toFixed(10)}`}
    style={{ fill: 'white' }}
    anchor={0.5}
  />
</Ticker>
  

Component API

Props

Name Type Default Description
autoStart boolean true Whether or not this ticker starts automatically
instance PIXI.Ticker The PIXI.Ticker instance. Can be set or bound to.
maxFPS number 0 Manages the minimum amount of milliseconds required to elapse between invoking PIXI.Ticker#update.
This will effect the measured value of PIXI.Ticker#FPS.
If it is set to 0, then there is no limit; PixiJS will render as many frames as it can.
Otherwise it will be at least minFPS
minFPS number 10 Manages the maximum amount of milliseconds allowed to elapse between invoking PIXI.Ticker#update.
This value is used to cap PIXI.Ticker#deltaTime, but does not effect the measured value of PIXI.Ticker#FPS.
When setting this property it is clamped to a value between 0 and PIXI.settings.TARGET_FPMS * 1000.
priority PIXI.UPDATE_PRIORITY Priority of the ticker for on:tick event. Defaults to LOW
speed number 1 Factor of current PIXI.Ticker#deltaTime.

Slots

Name Props Fallback
default

Events

Name Type Detail
tick dispatched