All Downloads are FREE. Search and download functionalities are using the official Maven repository.

view.entity-module.Sprite.js Maven / Gradle / Ivy

Go to download

Entity Manager module for the CodinGame engine toolkit. Simplify the management of shapes and drawings.

There is a newer version: 4.5.0
Show newest version
import { SpriteBasedEntity } from './SpriteBasedEntity.js'

/* global PIXI */

export class Sprite extends SpriteBasedEntity {
  initDisplay () {
    super.initDisplay()
    if (this.defaultState.image === null) {
      this.graphics = new PIXI.Sprite(PIXI.Texture.EMPTY)
    } else {
      this.graphics = PIXI.Sprite.fromFrame(this.defaultState.image)
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy