Difference between revisions of "love.physics.newWorld"

m
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
Creates a new World.
 
Creates a new World.
 +
 +
== Function ==
 +
{{newin|[[0.8.0]]|080|type=variant}}
 +
=== Synopsis ===
 +
<source lang="lua">
 +
world = love.physics.newWorld( xg, yg, sleep )
 +
</source>
 +
=== Arguments ===
 +
{{param|number|xg (0)|The x component of gravity.}}
 +
{{param|number|yg (0)|The y component of gravity.}}
 +
{{param|boolean|sleep (true)|Whether the bodies in this world are allowed to sleep.}}
 +
=== Returns ===
 +
{{param|World|world|A brave new World.}}
 +
 +
== Function ==
 +
{{oldin|[[0.8.0]]|080|type=variant}}
 
This function creates a new World with the given size, no gravity and sleeping turned on.
 
This function creates a new World with the given size, no gravity and sleeping turned on.
== Function ==
 
{{newin|[[0.7.0]]|type=variant}}
 
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
Line 15: Line 29:
 
{{param|World|world|A World object.}}
 
{{param|World|world|A World object.}}
 
== Function ==
 
== Function ==
 +
{{oldin|[[0.8.0]]|080|type=variant}}
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
Line 29: Line 44:
 
=== Returns ===
 
=== Returns ===
 
{{param|World|world|A brave new World.}}
 
{{param|World|world|A brave new World.}}
== Function ==
+
 
{{oldin|[[0.7.0]]|type=variant}}
 
=== Synopsis ===
 
<source lang="lua">
 
world = love.physics.newWorld( w, h )
 
</source>
 
=== Arguments ===
 
{{param|number|w|The width of the World.}}
 
{{param|number|h|The height of the World.}}
 
=== Returns ===
 
{{param|World|world|A World object.}}
 
 
== See Also ==
 
== See Also ==
 
* [[parent::love.physics]]
 
* [[parent::love.physics]]

Latest revision as of 01:25, 30 January 2016

Creates a new World.

Function

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

Synopsis

world = love.physics.newWorld( xg, yg, sleep )

Arguments

number xg (0)
The x component of gravity.
number yg (0)
The y component of gravity.
boolean sleep (true)
Whether the bodies in this world are allowed to sleep.

Returns

World world
A brave new World.

Function

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

This function creates a new World with the given size, no gravity and sleeping turned on.

Synopsis

world = love.physics.newWorld( x1, y1, x2, y2 )

Arguments

number x1
The smallest x position in the world.
number y1
The smallest y position in the world.
number x2
The largest x position in the world.
number y2
The largest y position in the world.

Returns

World world
A World object.

Function

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

Synopsis

world = love.physics.newWorld( x1, y1, x2, y2, xg, yg, sleep )

Arguments

number x1
The smallest x position in the world.
number y1
The smallest y position in the world.
number x2
The largest x position in the world.
number y2
The largest y position in the world.
number xg
The x component of gravity.
number yg
The y component of gravity.
boolean sleep (true)
Whether sleep is possible in the world.

Returns

World world
A brave new World.

See Also


Other Languages