Clutter.ActorBox

Fields

Name

Type

Access

Description

x1

float

r/w

X coordinate of the top left corner

x2

float

r/w

X coordinate of the bottom right corner

y1

float

r/w

Y coordinate of the top left corner

y2

float

r/w

Y coordinate of the bottom right corner

Methods

class

alloc ()

class

new (x_1, y_1, x_2, y_2)

clamp_to_pixel ()

contains (x, y)

copy ()

equal (box_b)

free ()

from_vertices (verts)

get_area ()

get_height ()

get_origin ()

get_size ()

get_width ()

get_x ()

get_y ()

init (x_1, y_1, x_2, y_2)

init_rect (x, y, width, height)

interpolate (final, progress)

set_origin (x, y)

set_size (width, height)

union (b)

Details

class Clutter.ActorBox

Bounding box of an actor. The coordinates of the top left and right bottom corners of an actor. The coordinates of the two points are expressed in pixels with sub-pixel precision

classmethod alloc()
Returns:

the newly allocated Clutter.ActorBox. Use Clutter.ActorBox.free() to free its resources

Return type:

Clutter.ActorBox

Allocates a new Clutter.ActorBox.

New in version 1.12.

classmethod new(x_1, y_1, x_2, y_2)
Parameters:
  • x_1 (float) – X coordinate of the top left point

  • y_1 (float) – Y coordinate of the top left point

  • x_2 (float) – X coordinate of the bottom right point

  • y_2 (float) – Y coordinate of the bottom right point

Returns:

the newly allocated Clutter.ActorBox. Use Clutter.ActorBox.free() to free the resources

Return type:

Clutter.ActorBox

Allocates a new Clutter.ActorBox using the passed coordinates for the top left and bottom right points.

This function is the logical equivalent of:

clutter_actor_box_init (clutter_actor_box_alloc (),
x_1, y_1,
x_2, y_2);

New in version 1.0.

clamp_to_pixel()

Clamps the components of self to the nearest integer

New in version 1.2.

contains(x, y)
Parameters:
  • x (float) – X coordinate of the point

  • y (float) – Y coordinate of the point

Returns:

True if the point is contained by the Clutter.ActorBox

Return type:

bool

Checks whether a point with x, y coordinates is contained withing self

New in version 1.0.

copy()
Returns:

a newly allocated copy of Clutter.ActorBox. Use Clutter.ActorBox.free() to free the allocated resources

Return type:

Clutter.ActorBox

Copies self

New in version 1.0.

equal(box_b)
Parameters:

box_b (Clutter.ActorBox) – a Clutter.ActorBox

Returns:

True if the passed Clutter.ActorBox are equal

Return type:

bool

Checks self and box_b for equality

New in version 1.0.

free()

Frees a Clutter.ActorBox allocated using Clutter.ActorBox.new() or Clutter.ActorBox.copy()

New in version 1.0.

from_vertices(verts)
Parameters:

verts ([Clutter.Vertex]) – array of four Clutter.Vertex

Calculates the bounding box represented by the four vertices; for details of the vertex array see Clutter.Actor.get_abs_allocation_vertices().

New in version 1.0.

get_area()
Returns:

the area of a Clutter.ActorBox, in pixels

Return type:

float

Retrieves the area of self

New in version 1.0.

get_height()
Returns:

the height of the box

Return type:

float

Retrieves the height of the self

New in version 1.0.

get_origin()
Returns:

x:

return location for the X coordinate, or None

y:

return location for the Y coordinate, or None

Return type:

(x: float, y: float)

Retrieves the origin of self

New in version 1.0.

get_size()
Returns:

width:

return location for the width, or None

height:

return location for the height, or None

Return type:

(width: float, height: float)

Retrieves the size of self

New in version 1.0.

get_width()
Returns:

the width of the box

Return type:

float

Retrieves the width of the self

New in version 1.0.

get_x()
Returns:

the X coordinate of the origin

Return type:

float

Retrieves the X coordinate of the origin of self

New in version 1.0.

get_y()
Returns:

the Y coordinate of the origin

Return type:

float

Retrieves the Y coordinate of the origin of self

New in version 1.0.

init(x_1, y_1, x_2, y_2)
Parameters:
  • x_1 (float) – X coordinate of the top left point

  • y_1 (float) – Y coordinate of the top left point

  • x_2 (float) – X coordinate of the bottom right point

  • y_2 (float) – Y coordinate of the bottom right point

Returns:

the initialized Clutter.ActorBox

Return type:

Clutter.ActorBox

Initializes self with the given coordinates.

New in version 1.10.

init_rect(x, y, width, height)
Parameters:
  • x (float) – X coordinate of the origin

  • y (float) – Y coordinate of the origin

  • width (float) – width of the box

  • height (float) – height of the box

Initializes self with the given origin and size.

New in version 1.10.

interpolate(final, progress)
Parameters:
Returns:

return location for the interpolation

Return type:

result: Clutter.ActorBox

Interpolates between self and final Clutter.ActorBox es using progress

New in version 1.2.

set_origin(x, y)
Parameters:
  • x (float) – the X coordinate of the new origin

  • y (float) – the Y coordinate of the new origin

Changes the origin of self, maintaining the size of the Clutter.ActorBox.

New in version 1.6.

set_size(width, height)
Parameters:
  • width (float) – the new width

  • height (float) – the new height

Sets the size of self, maintaining the origin of the Clutter.ActorBox.

New in version 1.6.

union(b)
Parameters:

b (Clutter.ActorBox) – the second Clutter.ActorBox

Returns:

the Clutter.ActorBox representing a union of self and b

Return type:

result: Clutter.ActorBox

Unions the two boxes self and b and stores the result in result.

New in version 1.4.