Advertisement
otorp2

user signal

Oct 26th, 2015
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. <MarianoGNU> to create you own signal:
  2. [23:07] <MarianoGNU> add_user_signal("name")
  3. [23:08] <MarianoGNU> to connect a signal:
  4. [23:08] <MarianoGNU> objet_who_emits.connect("signal_name", object_who_owns_callback, "funcation_name")
  5. [23:08] <eska> it's also possible to create a new signal using `signal custom_signal( arg1, arg2 )`
  6. [23:08] <MarianoGNU> to emit a signal:
  7. [23:09] <MarianoGNU> object_who_emits.emit_signal("signal_name", argument_a, arbument_b, ...) #arguments are optional
  8. [23:10] <MarianoGNU> then you will only need the function to call
  9. [23:10] <MarianoGNU> func function_name(arg1, arg2):
  10. [23:10] <MarianoGNU> ....
  11. [23:11] == HER0_01 has changed nick to xkcd_bot
  12. [23:11] == xkcd_bot has changed nick to HER0_01
  13. [23:13] <ugly_cat> otorp2: you're the one who switched for music stuff right?
  14. [23:13] <ugly_cat> Do you like it?
  15. [23:14] <otorp2> still have to buy interface but im running kxstudio now - i dig it yeah
  16. [23:18] <caleb98> have you used FL studio
  17. [23:18] <caleb98> otorp2
  18. [23:18] <otorp2> not in linux
  19. [23:18] <caleb98> i mean in general
  20. [23:19] <otorp2> sure
  21. [23:19] <caleb98> i have it for my android and its awesome
  22. [23:19] <caleb98> so technically it runs on linux
  23. [23:21] <otorp2> ive never run it on anything but win - yes its great
  24. [23:23] <otorp2> MarianoGNU: did you mean for one of those to be object who receives signal?
  25. [23:23] == mfoxdogg|work [~mfoxdogg|@203.213.245.105] has joined #godotengine
  26. [23:24] <MarianoGNU> you have two object, one emits the signal and the oter calls the function
  27. [23:24] <MarianoGNU> so you can make a RidigBody2D to stop all movement when a timer times out
  28. [23:25] <MarianoGNU> if you pass self as function caller, the one calling the function will be the same object emitting the signal
  29. [23:28] <MarianoGNU> i'll call it a day now
  30. [23:29] <otorp2> thanks MarianoGNU ill keep trying
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement