Texture

A 2D texture that can be rendered to the screen.

  • Texture(file_path: str)
  • Texture(pixel_array: PixelArray)

Properties


NameDescriptionType
flipWhether the texture is flipped horizontally and/or verticallyFlip
angleThe rotation angle of the texture in radiansfloat
sizeThe original width and height of the textureVec2
alphaThe alpha modulation of the texture (0.0 to 1.0)float
tintThe color tint applied to the texture during renderingColor

Methods


Get Rect

get_rect() Rect

Get the rectangle of the texture.

Returns Rect : The dimensions of the texture as a Rect.

Make Additive

make_additive() None

Set the texture's blending mode to additive.

Make Multiply

make_multiply() None

Set the texture's blending mode to multiply.

Make Normal

make_normal() None

Set the texture's blending mode to normal.