Texture
Represents a hardware-accelerated image that can be efficiently rendered.
Constructor
-
Texture(
file_path: str,
scale_mode: TextureScaleMode = TextureScaleMode.DEFAULT,
access: TextureAccess = TextureAccess.STATIC
) → Texture -
Texture(
pixel_array: PixelArray,
scale_mode: TextureScaleMode = TextureScaleMode.DEFAULT,
access: TextureAccess = TextureAccess.STATIC
) → Texture -
Texture(
size: Vec2,
scale_mode: TextureScaleMode = TextureScaleMode.DEFAULT
) → Texture
Represents a hardware-accelerated image that can be efficiently rendered.
Properties
| Name | Description | Type |
|---|---|---|
alpha | Get or set the alpha modulation of the texture as a float between 0.0 and 1.0. | float |
clip_area | Get or set the clip area (atlas region) of the texture. | Rect |
flip | The flip settings for horizontal and vertical mirroring. | Texture.Flip |
Methods
Make Additive
make_additive() → NoneSet the texture to use additive blending mode.
In additive mode, the texture's colors are added to the destination, creating bright, glowing effects.
Make Multiply
make_multiply() → NoneSet the texture to use multiply blending mode.
In multiply mode, the texture's colors are multiplied with the destination, creating darkening and shadow effects.
Make Normal
make_normal() → NoneSet the texture to use normal (alpha) blending mode.
This is the default blending mode for standard transparency effects.