Shape:testSegment

Shape:testSegment Removed in LÖVE 0.8.0 This function is not supported in that and later versions. Checks whether a line segment intersects a shape. This function will either return the "time" of impact and the surface normal at the point of collision, or nil if the line does not intersect the shape. The "time" is a value between 0.0 and 1.0 and can be used to calculate where the collision occured. Function Synopsis t, xn, yn = Shape:testSegment( x1, y1, x2, y2 ) Arguments number x1 The x

Shape:testPoint

Shape:testPoint This is particularly useful for mouse interaction with the shapes. By looping through all shapes and testing the mouse position with this function, we can find which shapes the mouse touches. There's a bug in 0.8.0 preventing this function from working. Function Available since LÖVE 0.8.0 This variant is not supported in earlier versions. Synopsis hit = Shape:testPoint( tx, ty, tr, x, y ) Arguments number tx Translates the shape along the x-axis. number ty Translates the

Shape:setSensor

Shape:setSensor Removed in LÖVE 0.8.0 This function is not supported in that and later versions. Sets whether this shape should act as a sensor. Set the shape as a sensor if you want to be notified when collision between shapes occur, but don't want a physical response (for instance, maybe you want enemies to appear when the player "touches" a certain point). Function Synopsis Shape:setSensor( sensor ) Arguments boolean sensor True for sensor, false otherwise. Returns Nothing. See Also

Shape:setRestitution

Shape:setRestitution Removed in LÖVE 0.8.0 This function is not supported in that and later versions. Sets the restitution of the shape. Restitution indicates the "bounciness" of the shape. High restitution can be used to model stuff like a rubber ball, while low restitution can be used for "dull" objects, like a bag of sand. Function Synopsis Shape:setRestitution( restitution ) Arguments number restitution The restitution of the shape. Returns Nothing. Notes A shape with a restitution

Shape:setMask

Shape:setMask Removed in LÖVE 0.8.0 Use Fixture:setMask instead. Sets which categories this shape should NOT collide with. With this function, you can exclude certain shape categories from collisions with this shape. The categories passed as parameters will be excluded from collisions - all others included. Function Synopsis Shape:setMask( ... ) Arguments number ... Numbers from 1-16. Returns Nothing. Examples Only collide with category 6 shape:setMask(1, 2, 3, 4, 5, 7, 8, 9, 10, 12, 1

Shape:setFriction

Shape:setFriction Removed in LÖVE 0.8.0 Has been replaced by Fixture:setFriction. Sets the friction of the shape. Friction determines how shapes react when they "slide" along other shapes. Low friction indicates a slippery surface, like ice, while high friction indicates a rough surface, like concrete. Range: 0.0 - 1.0. Function Synopsis Shape:setFriction( friction ) Arguments number friction The friction of the shape. Returns Nothing. See Also Shape

Shape:setFilterData

Shape:setFilterData Removed in LÖVE 0.8.0 This function is not supported in that and later versions. Sets the filter data for a Shape. Info stolen from box2d.org: Collision filtering is a system for preventing collision between shapes. For example, say you make a character that rides a bicycle. You want the bicycle to collide with the terrain and the character to collide with the terrain, but you don't want the character to collide with the bicycle (because they must overlap). Box2D suppor

Shape:setDensity

Shape:setDensity Removed in LÖVE 0.8.0 This function is not supported in that and later versions. Sets the density of a Shape. Do this before calling Body:setMassFromShapes. Function Synopsis Shape:setDensity( density ) Arguments number density The new density of the Shape. Returns Nothing. See Also Shape

Shape:setData

Shape:setData Removed in LÖVE 0.8.0 Use Fixture:setUserData instead. Set data to be passed to the collision callback. When a shape collides, the value set here will be passed to the collision callback as one of the parameters. Typically, you would want to store a table reference here, but any value can be used. Function Synopsis Shape:setData( v ) Arguments any v Any Lua value. Returns Nothing. See Also Shape Shape:getData

Shape:setCategory

Shape:setCategory Removed in LÖVE 0.8.0 Use Fixture:setCategory instead. Sets the categories this shape is a member of. Sets the categories of this shape by specifying numbers from 1-16 as parameters. Categories can be used to prevent certain shapes from colliding. Function Synopsis Shape:setCategory( ... ) Arguments numbers ... Numbers from 1-16 Returns Nothing. See Also Shape