Page 1 of 1

newton [PhysicsEditor exporter + loader]

Posted: Tue Feb 21, 2017 4:16 am
by tadamson
Library that includes tools to export physics bodies made in CodeAndWeb's PhysicsEditor (https://www.codeandweb.com/physicseditor), then load them into a LÖVE game. I only found one other library of this sort and it didn't suit my use case very well. This library exports to .lua files for easy parsing, and takes a minimal approach by only loading the physics body. Comes with a basic "wdraw" utility for rendering all of the physics bodies in a given physics world.

Usage example:

Code: Select all

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
Bitbucket repo:
https://bitbucket.org/tcadamson/newton

Re: Love2D PhysicsEditor Library - Export & Load

Posted: Tue Mar 07, 2017 12:14 am
by AntonioModer
Ty!