Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How check for Events?
Started by kilopop May 18 2014 12:40 PM

7 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

kilopop

[GLOBAL: userInfoPane.html]
kilopop
  • Contributor

  • 258 posts
  • Corona SDK

Made events in the editor, they are showing up in the exported .json all fine. But how do you check for them?

Tried the following within the enterFrame runtime function. Example here trying to find "titleIn" event name.

-- Check for events
if skeleton.state.Event == "titleIn" then
print("titleIn"); end

This doesn't work because the field 'state' is nil but I can't find anywhere in the user guide which describes how to do this more accurately..



[TOPIC: post.html]
#2

paulscottrobson

[GLOBAL: userInfoPane.html]
paulscottrobson
  • Contributor

  • 456 posts
  • Corona SDK

You have different event listeners for different events. enterFrame events occur every frame (hence the name). If you are doing events which are (say) collisions, or transition points in composer you have to listen for them explicitly.



[TOPIC: post.html]
#3

kilopop

[GLOBAL: userInfoPane.html]
kilopop
  • Contributor

  • 258 posts
  • Corona SDK

Oh cool, thanks for the help Paul. So another runtime, enterFrame eventListener (already have one updating skeleton and delta)?

 

What would be the kind of function to listen for Spine events? Your help here would be great as it's been really difficult to get a response out there on matters Spine/Corona.



[TOPIC: post.html]
#4

paulscottrobson

[GLOBAL: userInfoPane.html]
paulscottrobson
  • Contributor

  • 456 posts
  • Corona SDK

Would depend on spine :) But they are basically the same idea - there are generic system ones - runtime event listeners (like enterFrame) that anyone can listen for, and the ones specific to individual things - like say tap and touch, which send a message only to the thing that has been tapped or touch.

 

It's the same basic idea - there is a function/method called whenever some event happens, and you tell the message source that you want to be told about events.

 

Spine is a bit of a mess I think ; the library is v1 only ?



[TOPIC: post.html]
#5

kilopop

[GLOBAL: userInfoPane.html]
kilopop
  • Contributor

  • 258 posts
  • Corona SDK

Oh ok yeah, I get the runtime event aspect, in fact I already have one updating state and delta. I'm looking specifically for the method to obtain the event information in the .json file exported from the Spine editor. Any ideas there?



[TOPIC: post.html]
#6

paulscottrobson

[GLOBAL: userInfoPane.html]
paulscottrobson
  • Contributor

  • 456 posts
  • Corona SDK

No idea, sorry, you'll have to ask the Spine people. As their lib is o/s it should be possible to find it :)



[TOPIC: post.html]
#7

kilopop

[GLOBAL: userInfoPane.html]
kilopop
  • Contributor

  • 258 posts
  • Corona SDK

I have posted on the Esoteric Spine forum. This is also a Spine thread so if anyone on here knows how to check for Events in Corona, it would be great to hear how it's done?



[TOPIC: post.html]
#8

kilopop

[GLOBAL: userInfoPane.html]
kilopop
  • Contributor

  • 258 posts
  • Corona SDK

Just in case anyone is following, the answer is here:

 

http://esotericsoftware.com/forum/viewtopic.php?f=7&t=2663




[topic_controls]
[/topic_controls]