when calling love.physics.setMeter(5) when drawing objects.player.shape = love.physics.newRectangleShape(0, 0, 3, 5) the drawn size is always 3x5 px not mattering what i input as parameter in love.physics.setMeter().
Is this the intended behaviour or am i missing something
Is this correct?
love.physics.setMeter(meters)
love.physics.newRectangleShape(meters, meters, meters,meters)
Should i be using love.graphics.scale()?
love.physics.setMeter() changes behaviour but not the size of drawn bodies
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: love.physics.setMeter() changes behaviour but not the size of drawn bodies
s = love.physics.newRectangleShape( body, x, y, width, height, angle )
you are not attaching it to any body, and this is how i use meter:
meter = 10
love.physics.setMeter(meter)
world = love.physics.newWorld(0,100*meter,true)
you are not attaching it to any body, and this is how i use meter:
meter = 10
love.physics.setMeter(meter)
world = love.physics.newWorld(0,100*meter,true)
Re: love.physics.setMeter() changes behaviour but not the size of drawn bodies
This is for Löve 0.7.2 and earlier. It doesn't work in any recent version.
Re: love.physics.setMeter() changes behaviour but not the size of drawn bodies
setMeter tells the physics of löve2d how much pixels are a meter. So value 20 means each 20pixels is one meter.
The shape functions are based in pixels.
The shape functions are based in pixels.
Code: Select all
body = love.physics.newBody(world, 300, 300, "dynamic") -- place the body at pixel coordinates (300,300) or in meter coordinates (10,10)
love.physics.setMeter(10) -- set 10 pixels/meter
body:getPosition() -- returns pixel coordinates (100,100)
Who is online
Users browsing this forum: Google [Bot] and 0 guests