Difference between revisions of "newton"
(Created page with "Use the tools in this library to export Box2D bodies created using PhysicsEditor and load them into your LÖVE game. == Links == *[https://www.codeandweb.com/physicseditor Phy...") |
m |
||
(7 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
Use the tools in this library to export Box2D bodies created using PhysicsEditor and load them into your LÖVE game. | Use the tools in this library to export Box2D bodies created using PhysicsEditor and load them into your LÖVE game. | ||
+ | |||
+ | '''Usage example:''' | ||
+ | <source lang="lua"> | ||
+ | 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 | ||
+ | </source> | ||
+ | |||
== Links == | == Links == | ||
+ | *[https://bitbucket.org/tcadamson/newton Bitbucket repo] | ||
+ | |||
*[https://www.codeandweb.com/physicseditor PhysicsEditor] | *[https://www.codeandweb.com/physicseditor PhysicsEditor] | ||
− | + | {{#set:Name=newton}} | |
− | + | {{#set:LOVE Version=0.8.0+}} | |
− | {{#set:Name= | + | {{#set:Description=Export and load Box2D bodies made in PhysicsEditor}} |
− | {{#set:LOVE Version=0. | ||
− | {{#set:Description=Export | ||
{{#set:Keyword=Physics}} | {{#set:Keyword=Physics}} | ||
[[Category:Libraries]] | [[Category:Libraries]] | ||
+ | == Other Languages == | ||
+ | {{i18n|newton}} |
Latest revision as of 04:32, 17 December 2019
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
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info