Tutorial 5.4 (Utilities for objects) - Aerll/rpp GitHub Wiki

util:Rotations

Returns given objects with all non-mirrored rotations: N, R, VH, VHR.

Example:

InsertObject(:2x2).If(
    Object().IsNotOverlapping(util:Rotations(:2x2))
);
// same as
InsertObject(:2x2).If(
    Object().IsNotOverlapping(:2x2.N, :2x2.R, :2x2.VH, :2x2.VHR)
);

util:Mirrors

Returns given objects with all mirrored rotations: V, H, VR, HR.

Example:

InsertObject(:2x2).If(
    Object().IsNotOverlapping(util:Mirrors(:2x2))
);
// same as
InsertObject(:2x2).If(
    Object().IsNotOverlapping(:2x2.V, :2x2.H, :2x2.VR, :2x2.HR)
);

util:All

Returns given objects with all rotations: N, V, H, R, VH, VR, HR, VHR.

Example:

InsertObject(:2x2).If(
    Object().IsNotOverlapping(util:All(:2x2))
);
// same as
InsertObject(:2x2).If(
    Object().IsNotOverlapping(:2x2.N, :2x2.V, :2x2.H, :2x2.R, :2x2.VH, :2x2.VR, :2x2.HR, :2x2.VHR)
);

util:Size

Returns the size of the given object, where x coordinate represents width and y coordinate represents height.

Example:

object :3x2 = Rect(3, 21);
coord size = util:Size(:3x2); // size = [3, 2]

util:RelativePos

Returns the position of the object's index in relation to its anchor.

Example:

object :3x2 = Rect(3, 21);
coord position = util:RelativePos(:3x2.anchor, 21); // position = [2, 1]
⚠️ **GitHub.com Fallback** ⚠️