VectorSprite#
Added in version 1.1.
Superclasses: Object
Implemented Interfaces: Paintable
, SymbolicPaintable
A sprite used to draw textures or icons.
Symbolic icons#
If a sprite is created from a SymbolicPaintable
source, such
as a symbolic icon, then when the sprite is part of a symbol layer it
will be drawn using the icon-color property (or the text color, if the
sprite is part of a formatted string).
Constructors#
- class VectorSprite
- classmethod new(source_paintable: Paintable) VectorSprite #
Creates a new
VectorSprite
using the paintable’s intrinsic size.Added in version 1.1.
- Parameters:
source_paintable – a
Paintable
- classmethod new_full(source_paintable: Paintable, width: int, height: int, scale_factor: float, source_rect: Rectangle | None = None) VectorSprite #
Creates a new
VectorSprite
with the given size, scale factor, and area of the source paintable.Added in version 1.1.
- Parameters:
source_paintable – a
Paintable
width – the width of the sprite in pixels
height – the height of the sprite in pixels
scale_factor – the intended scale factor of the sprite
source_rect – the source rectangle of the sprite, or
None
to use the entire paintable
Methods#
- class VectorSprite
-
- get_source_paintable() Paintable #
Gets the source
Paintable
used to draw the sprite.Note that
VectorSprite
also implementsPaintable
. In most cases, you should draw the sprite rather than the original paintable.Added in version 1.1.
Properties#
- class VectorSprite