: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` A sprite used to draw textures or icons. Symbolic icons -------------------------------------------------------------------------------- If a sprite is created from a :obj:`~gi.repository.Gtk.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 ------------ .. 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 type of the None singleton. .. versionadded:: 1.1 .. attribute:: props.scale_factor :type: float The type of the None singleton. .. versionadded:: 1.1 .. attribute:: props.source_paintable :type: ~gi.repository.Gdk.Paintable The type of the None singleton. .. versionadded:: 1.1 .. attribute:: props.source_rect :type: ~gi.repository.Gdk.Rectangle The type of the None singleton. .. versionadded:: 1.1 .. attribute:: props.width :type: int The type of the None singleton. .. versionadded:: 1.1