Difference between revisions of "World:getCallbacks"

(Added 0.8.0 version.)
Line 1: Line 1:
Get functions to be called when two shapes collide.
+
Returns functions for the callbacks during the world update.
 +
 
 
== Function ==
 
== Function ==
 +
{{newin|[[0.8.0]]|type=variant}}
 +
=== Synopsis ===
 +
<source lang="lua">
 +
beginContact, endContact, preSolve, postSolve = World:getCallbacks( )
 +
</source>
 +
=== Arguments ===
 +
None.
 +
=== Returns ===
 +
{{param|function|beginContact|Gets called when two fixtures begin to overlap.}}
 +
{{param|function|endContact|Gets called when two fixtures cease to overlap.}}
 +
{{param|function|preSolve|Gets called before a collision gets resolved.}}
 +
{{param|function|postSolve|Gets called after the collision has been resolved.}}
 +
 +
== Function ==
 +
{{oldin|[[0.8.0]]|type=variant}}
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
Line 12: Line 28:
 
{{param|function|remove|Called when two shapes finish colliding.}}
 
{{param|function|remove|Called when two shapes finish colliding.}}
 
{{param|function|result|No idea. Never seems to be called...}}
 
{{param|function|result|No idea. Never seems to be called...}}
 +
 
== See Also ==
 
== See Also ==
 
* [[parent::World]]
 
* [[parent::World]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=Get functions to be called when two shapes collide.}}
+
{{#set:Description=Returns functions for the callbacks during the world update.}}
 
{{#set:Since=000}}
 
{{#set:Since=000}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|World:getCallbacks}}
 
{{i18n|World:getCallbacks}}

Revision as of 07:07, 17 April 2012

Returns functions for the callbacks during the world update.

Function

Available since LÖVE 0.8.0
This variant is not supported in earlier versions.

Synopsis

beginContact, endContact, preSolve, postSolve = World:getCallbacks( )

Arguments

None.

Returns

function beginContact
Gets called when two fixtures begin to overlap.
function endContact
Gets called when two fixtures cease to overlap.
function preSolve
Gets called before a collision gets resolved.
function postSolve
Gets called after the collision has been resolved.

Function

Removed in LÖVE 0.8.0
This variant is not supported in that and later versions.

Synopsis

add, persist, remove, result = World:getCallbacks( )

Arguments

None.

Returns

function add
Called when two shapes first collide.
function persist
Called each frame, if collision lasts more than 1 frame.
function remove
Called when two shapes finish colliding.
function result
No idea. Never seems to be called...

See Also


Other Languages