STUDIO: How to get event data from StateDefiner.listen

Hello, I want to know if it’s possible to get TouchEvent data, or any other data for that matter from the StateDefiner.listen callback. It passes in a ‘QueuedEvent’, but I haven’t been able to figure out if I can get the TouchEvent data from it.

I tried casting the QueuedEvent and the Data to a TouchEvent to no avail.

.listen(eid, ecs.input.SCREEN_TOUCH_START, (e) => { // How to access TouchEvent data? }

Hi, welcome to the forums!

If you console.log(e) you’ll see all the properties the event dispatches.

Ah excellent. I did try this but I was getting [Object: object] output or something rather.

Apologies, I am a typescript/js rookie!

No worries! I find it easier to use the Browser’s console rather than the 8th Wall console as it provides more information.

1 Like