Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gdevelop5:events:functions:replace-external-events [2018/10/18 01:24]
4ian [Example with a function]
gdevelop5:events:functions:replace-external-events [2019/05/22 00:15] (current)
4ian [Example with a function]
Line 1: Line 1:
 # Example of replacing external events by a function # Example of replacing external events by a function
  
-External events can be a good way of sharing/​reusing events in your game. Functions are going one step further as they are able to receive parameters, for example objects.+External events can be a good way of sharing/​reusing events in your game. [[gdevelop5:​events:​functions|Functions]] are going one step further as they are able to receive parameters, for example objects.
  
 ## Example using external events ## Example using external events
Line 28: Line 28:
  
 The advantage is that you can now use this new action to snap any object to the grid. You could even extract it and reuse it in another game! The advantage is that you can now use this new action to snap any object to the grid. You could even extract it and reuse it in another game!
 +
 +<note tip>​Turns out that this was already done, there is a [[gdevelop5:​extensions:​search|useful extension]] "Snap Objects to a virtual grid" providing a similar action.</​note>​
  
 [[gdevelop5:​events:​functions|Learn more about functions here]]. [[gdevelop5:​events:​functions|Learn more about functions here]].