:right-sidebar: True VectorSprite =================================================================== .. currentmodule:: gi.repository.Shumate .. versionadded:: 1.1 .. class:: VectorSprite(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gdk.Paintable`, :class:`~gi.repository.Gtk.SymbolicPaintable` :Constructors: :: VectorSprite(**properties) new(source_paintable:Gdk.Paintable) -> Shumate.VectorSprite new_full(source_paintable:Gdk.Paintable, width:int, height:int, scale_factor:float, source_rect:Gdk.Rectangle=None) -> Shumate.VectorSprite Constructors ------------ .. rst-class:: interim-class .. class:: VectorSprite :no-index: .. classmethod:: new(source_paintable: ~gi.repository.Gdk.Paintable) -> ~gi.repository.Shumate.VectorSprite Creates a new :obj:`~gi.repository.Shumate.VectorSprite` using the paintable's intrinsic size. .. versionadded:: 1.1 :param source_paintable: a :obj:`~gi.repository.Gdk.Paintable` .. classmethod:: new_full(source_paintable: ~gi.repository.Gdk.Paintable, width: int, height: int, scale_factor: float, source_rect: ~gi.repository.Gdk.Rectangle | None = None) -> ~gi.repository.Shumate.VectorSprite Creates a new :obj:`~gi.repository.Shumate.VectorSprite` with the given size, scale factor, and area of the source paintable. .. versionadded:: 1.1 :param source_paintable: a :obj:`~gi.repository.Gdk.Paintable` :param width: the width of the sprite in pixels :param height: the height of the sprite in pixels :param scale_factor: the intended scale factor of the sprite :param source_rect: the source rectangle of the sprite, or :const:`None` to use the entire paintable Methods ------- .. rst-class:: interim-class .. class:: VectorSprite :no-index: .. method:: get_height() -> int Gets the height at which the sprite should be drawn. .. versionadded:: 1.1 .. method:: get_scale_factor() -> float Gets the intended scale factor of the sprite. .. versionadded:: 1.1 .. method:: get_source_paintable() -> ~gi.repository.Gdk.Paintable Gets the source :obj:`~gi.repository.Gdk.Paintable` used to draw the sprite. Note that :obj:`~gi.repository.Shumate.VectorSprite` also implements :obj:`~gi.repository.Gdk.Paintable`. In most cases, you should draw the sprite rather than the original paintable. .. versionadded:: 1.1 .. method:: get_source_rect() -> ~gi.repository.Gdk.Rectangle | None Gets the source rectangle of the sprite. .. versionadded:: 1.1 .. method:: get_width() -> int Gets the width at which the sprite should be drawn. .. versionadded:: 1.1 Properties ---------- .. rst-class:: interim-class .. class:: VectorSprite :no-index: .. attribute:: props.height :type: int The height at which the sprite should be drawn, in pixels. .. versionadded:: 1.1 .. attribute:: props.scale_factor :type: float The intended scale factor of the sprite. .. versionadded:: 1.1 .. attribute:: props.source_paintable :type: ~gi.repository.Gdk.Paintable The :obj:`~gi.repository.Gdk.Paintable` used to draw the sprite. .. versionadded:: 1.1 .. attribute:: props.source_rect :type: ~gi.repository.Gdk.Rectangle The area of the source rectangle to draw, or :const:`None` to use the entire paintable. .. versionadded:: 1.1 .. attribute:: props.width :type: int The width at which the sprite should be drawn, in pixels. .. versionadded:: 1.1