love.physics.newWorld

Creates a new World.

Available since LÖVE 0.7.0
These variants are not supported in earlier versions.
Removed in LÖVE 0.8.0
These variants are not supported in that and later versions.

Function

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

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.

Available since LÖVE 0.8.0
These variants are not supported in earlier versions.

Function

This function creates a new World with no gravity and sleeping turned on.

Synopsis

world = love.physics.newWorld( )

Arguments

None.

Returns

World world
A brave new World.

Function

Synopsis

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

Arguments

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.

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

Function

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.

See Also


Other Languages