Removed in LÖVE 0.8.0
This function is not supported in that and later versions.
Gets the bounding box of the shape. This function can be used in a nested fashion with love.graphics.polygon.
A bounding box is the smallest rectangle that encapsulates the entire polygon.
x1, y1, x2, y2, x3, y3, x4, y4 = Shape:getBoundingBox( )
Vertexes are returned starting from the bottom-left in a clockwise fashion (bottom-left, top-left, top-right, bottom-right).
None.
number x1
number y1
number x2
number y2
number x3
number y3
number x4
number y4
function love.load() world = love.physics.newWorld(650, 650) world:setGravity(0,700) world:setMeter(64) body = love.physics.newBody(world, 650/2, 650/2, 0, 0) shape = love.physics.newRectangleShape(body, 0, 0, 300, 300, 0) love.graphics.setFont(18) love.graphics.setBackgroundColor(255, 255, 255, 255) love.graphics.setMode(650, 650, false, true, 0) end function love.draw() X1, Y1, X2, Y2, X3, Y3, X4, Y4 = shape:getBoundingBox() love.graphics.setColor(0,0,0,255) love.graphics.print("X1, Y1", X1, Y1) love.graphics.print("X2, Y2", X2, Y2) love.graphics.print("X3, Y3", X3, Y3) love.graphics.print("X4, Y4", X4, Y4) end
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/Shape:getBoundingBox