Difference between revisions of "newton"

m (Tadamson moved page Love2D PhysicsEditor Library to newton)
Line 29: Line 29:
 
{{#set:Name=newton}}
 
{{#set:Name=newton}}
 
{{#set:LOVE Version=0.8.0+}}
 
{{#set:LOVE Version=0.8.0+}}
{{#set:Description=Export & load Box2D bodies made in PhysicsEditor}}
+
{{#set:Description=Export and load Box2D bodies made in PhysicsEditor}}
 
{{#set:Keyword=Physics}}
 
{{#set:Keyword=Physics}}
 
[[Category:Libraries]]
 
[[Category:Libraries]]

Revision as of 08:21, 21 May 2018

Use the tools in this library to export Box2D bodies created using PhysicsEditor and load them into your LÖVE game.

Usage example:

local loader = require "loader"
local wdraw = require "wdraw"
local world = love.physics.newWorld()
local body
local x, y = 100, 100

function love.load()
    body = loader(world, "physics/exportedFile", "bodyName", x, y)
end

function love.update(dt)
    world:update(dt)
end

function love.draw()
    wdraw(world)
end

Links