Shumate.VectorSprite

g GObject.GInterface GObject.GInterface Gdk.Paintable Gdk.Paintable GObject.GInterface->Gdk.Paintable Gtk.SymbolicPaintable Gtk.SymbolicPaintable GObject.GInterface->Gtk.SymbolicPaintable GObject.Object GObject.Object Shumate.VectorSprite Shumate.VectorSprite GObject.Object->Shumate.VectorSprite Gdk.Paintable->Shumate.VectorSprite Gtk.SymbolicPaintable->Shumate.VectorSprite

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gdk.Paintable (10), Gtk.SymbolicPaintable (1)

Structs:

GObject.ObjectClass (5)

class

new (source_paintable)

class

new_full (source_paintable, width, height, scale_factor, source_rect)

get_height ()

get_scale_factor ()

get_source_paintable ()

get_source_rect ()

get_width ()

Virtual Methods

Inherited:

GObject.Object (7), Gdk.Paintable (6), Gtk.SymbolicPaintable (1)

Properties

Name

Type

Flags

Short Description

height

int

r/w/co

height

scale-factor

float

r/w/co

scale-factor

source-paintable

Gdk.Paintable

r/w/co

source-paintable

source-rect

Gdk.Rectangle

r/w/co

source-rect

width

int

r/w/co

width

Signals

Inherited:

GObject.Object (1), Gdk.Paintable (2)

Fields

Inherited:

GObject.Object (1), Gdk.Paintable (2)

Class Details

class Shumate.VectorSprite(**kwargs)
Bases:

GObject.Object, Gdk.Paintable, Gtk.SymbolicPaintable

Abstract:

No

Structure:

Shumate.VectorSpriteClass

A sprite used to draw textures or icons.

Symbolic icons

If a sprite is created from a [iface`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).

New in version 1.1.

classmethod new(source_paintable)
Parameters:

source_paintable (Gdk.Paintable) – a [iface`Gdk`.Paintable]

Return type:

Shumate.VectorSprite

Creates a new [class`VectorSprite`] using the paintable’s intrinsic size.

New in version 1.1.

classmethod new_full(source_paintable, width, height, scale_factor, source_rect)
Parameters:
  • source_paintable (Gdk.Paintable) – a [iface`Gdk`.Paintable]

  • width (int) – the width of the sprite in pixels

  • height (int) – the height of the sprite in pixels

  • scale_factor (float) – the intended scale factor of the sprite

  • source_rect (Gdk.Rectangle or None) – the source rectangle of the sprite, or None to use the entire paintable

Return type:

Shumate.VectorSprite

Creates a new [class`VectorSprite`] with the given size, scale factor, and area of the source paintable.

New in version 1.1.

get_height()
Returns:

the sprite’s height in pixels

Return type:

int

Gets the height at which the sprite should be drawn.

New in version 1.1.

get_scale_factor()
Returns:

the sprite’s scale factor

Return type:

float

Gets the intended scale factor of the sprite.

New in version 1.1.

get_source_paintable()
Returns:

the source paintable

Return type:

Gdk.Paintable

Gets the source [iface`Gdk`.Paintable] used to draw the sprite.

Note that [class`VectorSprite`] also implements [iface`Gdk`.Paintable]. In most cases, you should draw the sprite rather than the original paintable.

New in version 1.1.

get_source_rect()
Returns:

the sprite’s source rectangle, or None if the entire paintable is used

Return type:

Gdk.Rectangle or None

Gets the source rectangle of the sprite.

New in version 1.1.

get_width()
Returns:

the sprite’s width in pixels

Return type:

int

Gets the width at which the sprite should be drawn.

New in version 1.1.

Property Details

Shumate.VectorSprite.props.height
Name:

height

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The height at which the sprite should be drawn, in pixels.

New in version 1.1.

Shumate.VectorSprite.props.scale_factor
Name:

scale-factor

Type:

float

Default Value:

1.0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The intended scale factor of the sprite.

New in version 1.1.

Shumate.VectorSprite.props.source_paintable
Name:

source-paintable

Type:

Gdk.Paintable

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The [iface`Gdk`.Paintable] used to draw the sprite.

New in version 1.1.

Shumate.VectorSprite.props.source_rect
Name:

source-rect

Type:

Gdk.Rectangle

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The area of the source rectangle to draw, or None to use the entire paintable.

New in version 1.1.

Shumate.VectorSprite.props.width
Name:

width

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The width at which the sprite should be drawn, in pixels.

New in version 1.1.