spine-module/modifiers/test_modifier.wren
2021-07-10 19:43:40 +02:00

51 lines
1.2 KiB
Text

import "luxe: io" for IO
import "luxe: world" for World, Entity, Modifiers, ModifierSystem
//User facing API
//This is what the user of your modifier will interact with
class Slot {
static create(entity) { Modifiers.create(This, entity) }
static destroy(entity) { Modifiers.destroy(This, entity) }
static has(entity) { Modifiers.has(This, entity) }
} //Slot
//Your modifier system implementation.
//This speaks to the engine and your user facing API
//to do the actual work. You'll get notified when things change
//in the world and respond to them here.
class SlotSystem is ModifierSystem {
construct new() {
//called when your system is first created.
}
init(world) {
_world = world
//called when your modifier is created in a world
}
destroy() {
//called when your modifier is removed from a world
}
attach(entity, data) {
//called when attached to an entity
}
detach(entity, data) {
//called when detached from an entity, like on destroy
}
tick(delta) {
//called usually once every frame.
//called when the world that this modifier lives in, is ticked
each {|entity, data|
//use data.*
}
} //tick
} //SlotSystem
var Modifier = SlotSystem //required