Shape

Methods
4
Fields
None

Getting one

scene:tileAt(…):getWallObject():getConvexHull()
scene:tileAt(…):getWallObject():getConvexHull2()
scene:tileAt(…):getDecorativeObject():getConvexHull()

Methods

MethodReturnsDescription
contains(number, number)boolean(Shape, number, number) -> boolean: Whether the point is inside, by the shape's winding rule (a Rectangle with whole coordinates tests…
contains(Point)boolean
contains(Rectangle)boolean
intersects(number, number, number, number)boolean(Shape, number, number, number, number) -> boolean: Whether the shape's interior meets the rectangle's.
intersects(Rectangle2D)boolean
getBounds()RectangleThe integer bounding rectangle: the exact bounds with their edges rounded outward to whole pixels.
getBounds2D()Rectangle2DThe exact bounding rectangle.

Returned by

MethodReturnsDescription
Actor.getConvexHullShape?The outline of the actor's model on the canvas this frame: the convex hull of the model the client builds for it, at its local location and…
DecorativeObject.getConvexHullShape?The outline of its first model on the canvas, at its offsets; nil when it does not project, has no readable model or is gone.
DecorativeObject.getConvexHull2Shape?The outline of its second model, at the second offsets.
GameObject.getConvexHullShape?The outline of its model on the canvas (the convex hull of its projected vertices, at its local position, model orientation and height; an…
Graphics.getClipShape?The clip in user space, or nil with none.
GroundObject.getConvexHullShape?The outline of its model on the canvas, nil when it does not project, has no readable model or is gone.
TileObject.getClickboxShape?The shape a click on it lands in, on the canvas: its model's clickbox (Perspective.getClickbox over the loc's model; a wall's two models…
WallObject.getConvexHullShape?The outline of its first model on the canvas, nil when it does not project, has no readable model or is gone.
WallObject.getConvexHull2Shape?The outline of its second model (a corner wall's other side), as getConvexHull().

Method details

contains

contains: ((Shape, number, number) -> boolean) & ((Shape, Point) -> boolean) & ((Shape, Rectangle) -> boolean)

(Shape, number, number) -> boolean: Whether the point is inside, by the shape's winding rule (a Rectangle with whole coordinates tests as its contains(int, int)).

(Shape, Point) -> boolean: Whether p is inside.

(Shape, Rectangle) -> boolean: Whether r is entirely inside.

intersects

intersects: ((Shape, number, number, number, number) -> boolean) & ((Shape, Rectangle2D) -> boolean)

(Shape, number, number, number, number) -> boolean: Whether the shape's interior meets the rectangle's.

(Shape, Rectangle) -> boolean: Whether the shape meets r.

(Shape, Rectangle2D) -> boolean: Whether the shape meets r.

getBounds

getBounds: (Shape) -> Rectangle

The integer bounding rectangle: the exact bounds with their edges rounded outward to whole pixels.