Texture Transforms#

class arcade.texture.transforms.FlipLeftRightTransform[source]#

Bases: Transform

Flip texture horizontally / left to right.

static transform_hit_box_points(points: Sequence[Tuple[float, float]]) Sequence[Tuple[float, float]][source]#
order = (1, 0, 3, 2)#

How texture coordinates order should be changed for this transform. upper_left, upper_right, lower_left, lower_right

class arcade.texture.transforms.FlipTopBottomTransform[source]#

Bases: Transform

Flip texture vertically / top to bottom.

static transform_hit_box_points(points: Sequence[Tuple[float, float]]) Sequence[Tuple[float, float]][source]#
order = (2, 3, 0, 1)#

How texture coordinates order should be changed for this transform. upper_left, upper_right, lower_left, lower_right

class arcade.texture.transforms.Rotate180Transform[source]#

Bases: Transform

Rotate 180 degrees clockwise.

static transform_hit_box_points(points: Sequence[Tuple[float, float]]) Sequence[Tuple[float, float]][source]#
order = (3, 2, 1, 0)#

How texture coordinates order should be changed for this transform. upper_left, upper_right, lower_left, lower_right

class arcade.texture.transforms.Rotate270Transform[source]#

Bases: Transform

Rotate 270 degrees clockwise.

static transform_hit_box_points(points: Sequence[Tuple[float, float]]) Sequence[Tuple[float, float]][source]#
order = (1, 3, 0, 2)#

How texture coordinates order should be changed for this transform. upper_left, upper_right, lower_left, lower_right

class arcade.texture.transforms.Rotate90Transform[source]#

Bases: Transform

Rotate 90 degrees clockwise.

static transform_hit_box_points(points: Sequence[Tuple[float, float]]) Sequence[Tuple[float, float]][source]#
order = (2, 0, 3, 1)#

How texture coordinates order should be changed for this transform. upper_left, upper_right, lower_left, lower_right

class arcade.texture.transforms.Transform[source]#

Bases:

Base class for all texture transforms.

Transforms are responsible for transforming the texture coordinates and hit box points.

static transform_hit_box_points(points: Sequence[Tuple[float, float]]) Sequence[Tuple[float, float]][source]#

Transforms hit box points.

classmethod transform_texture_coordinates_order(texture_coordinates: Tuple[float, float, float, float, float, float, float, float], order: Tuple[int, int, int, int]) Tuple[float, float, float, float, float, float, float, float][source]#

Change texture coordinates order.

Parameters:
  • texture_coordinates – Texture coordinates to transform

  • order – The new order

classmethod transform_vertex_order(order: Tuple[int, int, int, int]) Tuple[int, int, int, int][source]#

Transforms and exiting vertex order with this transform. This gives us important metadata on how to quickly transform the texture coordinates without iterating all applied transforms.

order = (0, 1, 2, 3)#

How texture coordinates order should be changed for this transform. upper_left, upper_right, lower_left, lower_right

class arcade.texture.transforms.TransposeTransform[source]#

Bases: Transform

Transpose texture.

static transform_hit_box_points(points: Sequence[Tuple[float, float]]) Sequence[Tuple[float, float]][source]#
order = (0, 2, 1, 3)#

How texture coordinates order should be changed for this transform. upper_left, upper_right, lower_left, lower_right

class arcade.texture.transforms.TransverseTransform[source]#

Bases: Transform

Transverse texture.

static transform_hit_box_points(points: Sequence[Tuple[float, float]]) Sequence[Tuple[float, float]][source]#
order = (3, 1, 2, 0)#

How texture coordinates order should be changed for this transform. upper_left, upper_right, lower_left, lower_right

class arcade.texture.transforms.VertexOrder(value)[source]#

Bases: Enum

Order for texture coordinates.

LOWER_LEFT = 2#
LOWER_RIGHT = 3#
UPPER_LEFT = 0#
UPPER_RIGHT = 1#
arcade.texture.transforms.get_orientation(order: Tuple[int, int, int, int]) int[source]#

Get orientation info from the vertex order