Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Prototype Docs Version 2.0.77

# SpriteSource - Prototype Docs

## SpriteSource :: struct - abstract

Children EffectTexture SpriteParameters AnimationParameters Animation AnimationSheet RotatedAnimation RotatedSprite Sprite LayeredSprite SpriteNWaySheet SpriteSheet

## Properties

- default
- sorted

filename | :: FileName | The path to the sprite file to use.
The path to the sprite file to use.
size optional | :: SpriteSizeType or {SpriteSizeType, SpriteSizeType} | The width and height of the sprite. [...]
The width and height of the sprite. [...]
width optional | :: SpriteSizeType | Mandatory if `size` is not defined. [...]
Mandatory if `size` is not defined. [...]
height optional | :: SpriteSizeType | Mandatory if `size` is not defined. [...]
Mandatory if `size` is not defined. [...]
x optional | :: SpriteSizeType | Horizontal position of the sprite in the source file in pixels.
Horizontal position of the sprite in the source file in pixels.
y optional | :: SpriteSizeType | Vertical position of the sprite in the source file in pixels.
Vertical position of the sprite in the source file in pixels.
position optional | :: {SpriteSizeType, SpriteSizeType} | Loaded only when `x` and `y` are both `0`. [...]
Loaded only when `x` and `y` are both `0`. [...]
load_in_minimal_mode optional | :: boolean | Minimal mode is entered when mod loading fails. [...]
Minimal mode is entered when mod loading fails. [...]
premul_alpha optional | :: boolean | Whether alpha should be pre-multiplied.
Whether alpha should be pre-multiplied.
allow_forced_downscale optional | :: boolean | If `true`, the sprite may be downsampled to half its size on load even when 'Sprite quality' graphics setting is set to 'High'. [...]
If `true`, the sprite may be downsampled to half its size on load even when 'Sprite quality' graphics setting is set to 'High'. [...]

filename | :: FileName | The path to the sprite file to use.
The path to the sprite file to use.
allow_forced_downscale optional | :: boolean | If `true`, the sprite may be downsampled to half its size on load even when 'Sprite quality' graphics setting is set to 'High'. [...]
If `true`, the sprite may be downsampled to half its size on load even when 'Sprite quality' graphics setting is set to 'High'. [...]
height optional | :: SpriteSizeType | Mandatory if `size` is not defined. [...]
Mandatory if `size` is not defined. [...]
load_in_minimal_mode optional | :: boolean | Minimal mode is entered when mod loading fails. [...]
Minimal mode is entered when mod loading fails. [...]
position optional | :: {SpriteSizeType, SpriteSizeType} | Loaded only when `x` and `y` are both `0`. [...]
Loaded only when `x` and `y` are both `0`. [...]
premul_alpha optional | :: boolean | Whether alpha should be pre-multiplied.
Whether alpha should be pre-multiplied.
size optional | :: SpriteSizeType or {SpriteSizeType, SpriteSizeType} | The width and height of the sprite. [...]
The width and height of the sprite. [...]
width optional | :: SpriteSizeType | Mandatory if `size` is not defined. [...]
Mandatory if `size` is not defined. [...]
x optional | :: SpriteSizeType | Horizontal position of the sprite in the source file in pixels.
Horizontal position of the sprite in the source file in pixels.
y optional | :: SpriteSizeType | Vertical position of the sprite in the source file in pixels.
Vertical position of the sprite in the source file in pixels.

## Properties

### filename :: FileName

The path to the sprite file to use.

### size :: SpriteSizeType or {SpriteSizeType, SpriteSizeType} optional

The width and height of the sprite. If this is a tuple, the first member of the tuple is the width and the second is the height. Otherwise the size is both width and height. Width and height may only be in the range of 0-4096.

### width :: SpriteSizeType optional

Mandatory if `size` is not defined.

Width of the sprite in pixels, from 0-4096.

### height :: SpriteSizeType optional

Mandatory if `size` is not defined.

Height of the sprite in pixels, from 0-4096.

### x :: SpriteSizeType optional

Default: `0`

Horizontal position of the sprite in the source file in pixels.

### y :: SpriteSizeType optional

Default: `0`

Vertical position of the sprite in the source file in pixels.

### position :: {SpriteSizeType, SpriteSizeType} optional

Loaded only when `x` and `y` are both `0`. The first member of the tuple is `x` and the second is `y`.

### load_in_minimal_mode :: boolean optional

Default: `false`

Minimal mode is entered when mod loading fails. You are in it when you see the gray box after (part of) the loading screen that tells you a mod error. Modders can ignore this property.

### premul_alpha :: boolean optional

Default: `true`

Whether alpha should be pre-multiplied.

### allow_forced_downscale :: boolean optional

Default: `false`

If `true`, the sprite may be downsampled to half its size on load even when 'Sprite quality' graphics setting is set to 'High'. Whether downsampling happens depends on detected hardware and other graphics settings.