Differences

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

Link to this comparison view

Next revision
Previous revision
gdevelop5:events:functions:replace-external-events [2018/10/18 01:23]
4ian created
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 27: Line 27:
 {{ :​gdevelop5:​events:​functions:​call-function-snap-grid.png?​nolink |}} {{ :​gdevelop5:​events:​functions:​call-function-snap-grid.png?​nolink |}}
  
-[[gdevelop5:​events:​functions|Learn more about functions here]]!+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]].