Basics
Guides
API Reference
Basics
Guides
API Reference
[12:14] static extends: object
Generated struct layout helper for GIR record Box2D.
layout ()
Returns the Panama struct layout for
Box2D.
[28:7] extends: object
A 2D box, described as the axis-aligned area between a minimum and a maximum vertices lying on the same plane.
GrapheneBox2D (Handle = null)
Allocates a new #graphene_box2d_t. The contents of the returned structure are undefined.
Handle is an optional native handle or wrapper whose handle to adopt; when the native constructor is called.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.contains_box (object b)
Checks whether the #graphene_box2d_t @a contains the given #graphene_box2d_t @b.
b is a #graphene_box2d_t.true if the box is contained in the given box.contains_point (object point)
Checks whether @box contains the given @point.
point is the coordinates to check.true if the point is contained in the given box.contains_rect (object rect)
Checks whether @box contains the given @rect.
rect is the rectangle to check.true if the rectangle is contained in the given box.equal (object b)
Checks whether the two given boxes are equal.
b is a #graphene_box2d_t.true if the boxes are equal.expand (object point)
Expands the dimensions of @box to include the coordinates at @point.
point is the coordinates of the point to include.res is return location for the expanded box.None.expand_scalar (double scalar)
Expands the dimensions of @box by the given @scalar value. If @scalar is positive, the #graphene_box2d_t will grow; if @scalar is negative, the #graphene_box2d_t will shrink.
scalar is a scalar value.res is return location for the expanded box.None.expand_vec2 (object vec)
Expands the dimensions of @box to include the coordinates of the given vector.
vec is the coordinates of the point to include, as a #graphene_vec2_t.res is return location for the expanded box.None.free ()
Frees the resources allocated by graphene_box2d_alloc().
None.get_center ()
Retrieves the coordinates of the center of a #graphene_box2d_t.
center is return location for the coordinates of the center.None.get_height ()
Retrieves the size of the @box on the Y axis.
the height of the box.get_max ()
Retrieves the coordinates of the maximum point of the given #graphene_box2d_t.
max is return location for the maximum point.None.get_min ()
Retrieves the coordinates of the minimum point of the given #graphene_box2d_t.
min is return location for the minimum point.None.get_minmax ()
Retrieves the coordinates of the minimum and maximum points of the given #graphene_box2d_t.
min is return location for the minimum point.max is return location for the maximum point.None.get_size ()
Retrieves the size of the box on all three axes, and stores it into the given @size vector.
size is return location for the size.None.get_vertices ()
Computes the vertices of the given #graphene_box2d_t.
vertices is return location for an array of 4 #graphene_vec2_t.None.get_width ()
Retrieves the size of the @box on the X axis.
the width of the box.init (object min, object max)
Initializes the given #graphene_box2d_t with two vertices.
min is the coordinates of the minimum vertex.max is the coordinates of the maximum vertex.the initialized #graphene_box2d_t.init_from_box (object src)
Initializes the given #graphene_box2d_t with the vertices of another #graphene_box2d_t.
src is a #graphene_box2d_t.the initialized #graphene_box2d_t.init_from_points (list points)
Initializes the given #graphene_box2d_t with the given array of vertices. If @n_points is 0, the returned box is initialized with graphene_box2d_empty().
n_points is the number #graphene_point_t in the @points array.points is an array of #graphene_point_t.the initialized #graphene_box2d_t.init_from_rect (object src)
Initializes the given #graphene_box2d_t with the origin and size of a #graphene_rect_t.
src is a #graphene_rect_t.the initialized #graphene_box2d_t.init_from_vec2 (object min, object max)
Initializes the given #graphene_box2d_t with two vertices stored inside #graphene_vec2_t.
min is the coordinates of the minimum vertex.max is the coordinates of the maximum vertex.the initialized #graphene_box2d_t.init_from_vectors (list vectors)
Initializes the given #graphene_box2d_t with the given array of vertices. If @n_vectors is 0, the returned box is initialized with graphene_box2d_empty().
n_vectors is the number #graphene_vec2_t in the @vectors array.vectors is an array of #graphene_vec2_t.the initialized #graphene_box2d_t.intersection (object b)
Intersects the two given #graphene_box2d_t. If the two boxes do not intersect, @res will contain a degenerate box initialized with graphene_box2d_empty().
b is a #graphene_box2d_t.res is return location for the result.true if the two boxes intersect.intersects (object b)
Checks whether two boxes intersect. See also: graphene_box2d_intersection()
b is a #graphene_box2d_t.true if the boxes intersect, and false otherwise.scale_offset (object scale, object offset)
Applies a scale and an offset to the vertices of the given box. If @scale is %NULL, the box will be scaled by (1.0, 1.0). If @offset is %NULL, the box will be offset by (0.0, 0.0).
scale is a vector with two scaling factors to be applied to the box.offset is the offset to apply to the box.res is the transformed box.None.to_float ()
Stores the minimum and maximum vertices of the given #graphene_box2d_t into an array. The array layout is: - min_x - min_y - max_x - max_y
v is return location for an array of floating point values with at least 4 elements.None.to_rect ()
Stores the minimum and maximum vertices of the given #graphene_box2d_t into a rectangle of equivalent origin and size.
rect is the rectangle to initialize.None.union (object b)
Unions the two given #graphene_box2d_t.
b is the box to union to @a.res is return location for the result.None.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.