Difference between revisions of "love.physics.newWorld"

m
(Updated for 0.7 API change)
Line 2: Line 2:
 
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 ==
 
== Function ==
 +
{{oldin|0.7.0|type=variant}}
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
Line 9: Line 10:
 
{{param|number|w|The width of the World.}}
 
{{param|number|w|The width of the World.}}
 
{{param|number|h|The height of the World.}}
 
{{param|number|h|The height of the World.}}
 +
=== Returns ===
 +
{{param|World|world|A World object.}}
 +
== Function ==
 +
{{newin|0.7.0|type=variant}}
 +
=== Synopsis ===
 +
<source lang="lua">
 +
world = love.physics.newWorld( x1, y1, x2, y2 )
 +
</source>
 +
=== Arguments ===
 +
{{param|number|x1|The smallest x position in the world.}}
 +
{{param|number|y1|The smallest y position in the world.}}
 +
{{param|number|x2|The largest x position in the world.}}
 +
{{param|number|y2|The largest y position in the world.}}
 
=== Returns ===
 
=== Returns ===
 
{{param|World|world|A World object.}}
 
{{param|World|world|A World object.}}

Revision as of 12:05, 6 December 2010

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

Function

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

Synopsis

world = love.physics.newWorld( w, h )

Arguments

number w
The width of the World.
number h
The height of the World.

Returns

World world
A World object.

Function

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

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

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