Logo


search API (or start typing anywhere)


Shape

differ.shapes.Shape

A base collision shape


class
meta: @:keep


   

Members


active
active : Bool
The state of this shape, if inactive can be ignored in results
data
data : Dynamic
A generic data object where you can store anything you want, for later use
name
name : String
The name of this shape, to help in debugging
tags
tags : Map<String, String>
A list of tags to use for marking shapes with data for later use, by key/value

Properties


position
position : differ.math.Vector
The position of this shape rotation
rotation : Float
The rotation of this shape, in degrees scaleX
scaleX : Float
The scale in the x direction of this shape scaleY
scaleY : Float
The scale in the y direction of this shape x
x : Float
The x position of this shape y
y : Float
The y position of this shape

Methods


destroy
destroy() : Void
clean up and destroy this shape

new

new(_x:Float, _y:Float) : Void
Create a new shape at give position x,y

test

test(shape:differ.shapes.Shape, into:differ.data.ShapeCollision) : differ.data.ShapeCollision
Test this shape against another shape.

testCircle

testCircle(circle:differ.shapes.Circle, into:differ.data.ShapeCollision, flip:Bool) : differ.data.ShapeCollision
Test this shape against a circle.

testPolygon

testPolygon(polygon:differ.shapes.Polygon, into:differ.data.ShapeCollision, flip:Bool) : differ.data.ShapeCollision
Test this shape against a polygon.

testRay

testRay(ray:differ.shapes.Ray, into:differ.data.RayCollision) : differ.data.RayCollision
Test this shape against a ray.