view.entity-module.TextureBasedEntity.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of module-entities Show documentation
Show all versions of module-entities Show documentation
Entity Manager module for the CodinGame engine toolkit. Simplify the management of shapes and drawings.
import { Entity } from './Entity.js'
/* global PIXI */
export class TextureBasedEntity extends Entity {
static defaultAnchor () {
return 0
}
constructor () {
super()
Object.assign(this.defaultState, {
anchorX: TextureBasedEntity.defaultAnchor(),
anchorY: TextureBasedEntity.defaultAnchor(),
blendMode: PIXI.BLEND_MODES.NORMAL,
tint: 0xFFFFFF
})
}
initDisplay () {
super.initDisplay()
}
updateDisplay (state, changed, globalData) {
super.updateDisplay(state, changed, globalData)
this.graphics.anchor.set(state.anchorX, state.anchorY)
this.graphics.blendMode = state.blendMode
this.graphics.tint = state.tint
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy