FlxSignal

283 views
Skip to first unread message

Samuel Batista

unread,
Mar 30, 2014, 2:44:37 PM3/30/14
to haxef...@googlegroups.com
HaxeFlixel has a new utility class, FlxSignal.

Here's how you use it:
// pass true if you want signal to persist across state changes.
var mySignal= FlxSignal.get(false);


// register to mySignal
mySignal
.add(signalCallback);


// dispatch a signal
mySignal
.dispatch("Hello World");


// signal callbacks are of type FlxSignal->Void
function signalCallback(signal:FlxSignal)
{
 
// data passed into dispatch is stored in signal.userData
 trace
(signal.userData);
}


// don't forget to destroy the signal when your object is destroyed:
mySignal
.destroy();


PS: Currently only available in the development version. Click here to learn how install development version.

SruloArt

unread,
Mar 30, 2014, 5:36:24 PM3/30/14
to
Maybe you can add the basic description to the class itself? I think Gama11 uses "Example Usage:" headline for that...
Also, I bet you can find a way to make it more user friendly, like, the answer to: "What would the average user may use it for on his game?" and write that as the intro for the class...

Samuel Batista

unread,
Mar 30, 2014, 9:08:37 PM3/30/14
to haxef...@googlegroups.com
In the future yes. For now it's there to be used.


On Sun, Mar 30, 2014 at 5:35 PM, SruloArt <srul...@gmail.com> wrote:
Maybe you can add the basic description to the class itself? I think Gama11 uses "Example Usage:" headline for that...
Also, I bet you can find away to make it more user friendly, like, the answer to: what would the average user may use it for on his game? and write that as the intro for the class...


On Sunday, March 30, 2014 9:44:37 PM UTC+3, Samuel Batista wrote:

--
HaxeFlixel Development Community
See our github https://github.com/haxeflixel/ and our documentation http://haxeflixel.com/documentation/
---
You received this message because you are subscribed to a topic in the Google Groups "HaxeFlixel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/haxeflixel/bBHyZz-v-20/unsubscribe.
To unsubscribe from this group and all its topics, send an email to haxeflixel+...@googlegroups.com.
Visit this group at http://groups.google.com/group/haxeflixel.
To view this discussion on the web visit https://groups.google.com/d/msgid/haxeflixel/0d95aa7a-a045-4384-b1b2-4ae605711d59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

SruloArt

unread,
Apr 2, 2014, 7:49:45 AM4/2/14
to haxef...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages