place

fun Box.place(item: Box, anchor: Vector3 = Vector3(0.5, 0.5, 0.5), itemAnchor: Vector3 = anchor): Box(source)

Places a given box relative to this box using specified anchor points. This method computes the position of the placed box based on the anchor points of both the current box and the given box. The resulting box maintains the dimensions of the given box and is positioned at the calculated location.

Return

A new Box representing the placed item with adjusted position and the same dimensions as the input item box.

Parameters

item

The box to be placed relative to this box.

anchor

The anchor point on this box, specified as a Vector3 where each component ranges from 0.0 to 1.0. The default is the center of this box (0.5, 0.5, 0.5).

itemAnchor

The anchor point on the item being placed, specified as a Vector3 where each component ranges from 0.0 to 1.0. The default is the same as the anchor parameter.


fun Rectangle.place(item: Rectangle, anchor: Vector2 = Vector2(0.5, 0.5), itemAnchor: Vector2 = anchor): Rectangle(source)

Places a given rectangle (item) within the bounds of the current rectangle (this), positioning it based on the specified anchor point.

Return

A new rectangle representing the positioned item within the current rectangle.

Parameters

item

The rectangle to be placed within the current rectangle.

anchor

The relative position of the anchor point within the bounds of the current rectangle. Defaults to (0.5, 0.5) which centers the item within the current rectangle.