Shumate.VectorSpriteSheet
Description: Reference for Shumate.VectorSpriteSheet

### Class

# ShumateVectorSpriteSheet

since: 1.1

#### Description [src]

    final class Shumate.VectorSpriteSheet : GObject.Object
    {
      /* No available fields */
    }

A collection of `ShumateVectorSprite`s.

Sprites are used as icons in symbols or as the pattern for a fill layer.

Most MapLibre stylesheets provide their spritesheet as a PNG image and a JSON description of the sprites. This spritesheet can be added using `shumate_vector_sprite_sheet_add_page()`. Sprites can also be added individually using `shumate_vector_sprite_sheet_add_sprite()`.

Some map styles rely on application code to provide some or all of their sprites. This is supported using a fallback function, which can be set using `shumate_vector_sprite_sheet_set_fallback()`. This function can generate sprites on demand. For example, it could load a symbolic icon from the `GtkIconTheme` or render a custom highway shield.

## HiDPI support

Map styles should provide a double resolution spritesheet for high DPI displays. That spritesheet can be added as a separate page. The `ShumateVectorSpriteSheet` will pick the best sprites for the display’s scale factor.

If a fallback function is set, it receives the requested scale factor as an argument. It should use this to generate the sprite at the correct size. For example, if the scale factor is 2, the image should be twice as large (but the sprite’s width and height should be the same).

## Thread Safety

`ShumateVectorSpriteSheet` is thread safe.

Available since: 1.1

#### Ancestors

- GObject

#### Constructors

###### shumate_vector_sprite_sheet_new

Creates a new, empty `ShumateVectorSpriteSheet`.

since: 1.1

#### Instance methods

###### shumate_vector_sprite_sheet_add_page

Adds a page to the spritesheet.

since: 1.1

###### shumate_vector_sprite_sheet_add_sprite

Adds a sprite to the spritesheet.

since: 1.1

###### shumate_vector_sprite_sheet_get_sprite

Gets a sprite from the spritesheet.

since: 1.1

###### shumate_vector_sprite_sheet_set_fallback

Sets a fallback function to generate sprites.

since: 1.1

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct ShumateVectorSpriteSheetClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.