Factorio Prototype DocsVersion 1.1.107

SpriteParameters :: struct - abstract

Children

Properties

filename :: FileName

The path to the sprite file to use.

The path to the sprite file to use.

priority optional :: SpritePriority
flags optional :: SpriteFlags
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. [...]

shift optional :: Vector

The shift in tiles. [...]

The shift in tiles. [...]

scale optional :: double

Values other than 1 specify the scale of the sprite on default zoom. [...]

Values other than 1 specify the scale of the sprite on default zoom. [...]

draw_as_shadow optional :: bool

Only one of draw_as_shadow, draw_as_glow and draw_as_light can be true. [...]

Only one of draw_as_shadow, draw_as_glow and draw_as_light can be true. [...]

draw_as_glow optional :: bool

Only one of draw_as_shadow, draw_as_glow and draw_as_light can be true. [...]

Only one of draw_as_shadow, draw_as_glow and draw_as_light can be true. [...]

draw_as_light optional :: bool

Only one of draw_as_shadow, draw_as_glow and draw_as_light can be true.

Only one of draw_as_shadow, draw_as_glow and draw_as_light can be true.

mipmap_count optional :: uint8

Only loaded if this is an icon, that is it has the flag "group=icon" or "group=gui".

Only loaded if this is an icon, that is it has the flag "group=icon" or "group=gui".

apply_runtime_tint optional :: bool
tint optional :: Color
blend_mode optional :: BlendMode
load_in_minimal_mode optional :: bool

Minimal mode is entered when mod loading fails. [...]

Minimal mode is entered when mod loading fails. [...]

premul_alpha optional :: bool

Whether alpha should be pre-multiplied.

Whether alpha should be pre-multiplied.

generate_sdf optional :: bool

This property is only used by sprites used in UtilitySprites that have the "icon" flag set. [...]

This property is only used by sprites used in UtilitySprites that have the "icon" flag set. [...]

Properties

filename :: FileName

The path to the sprite file to use.

priority :: SpritePriority optional

Default: "medium"

flags :: SpriteFlags optional

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-8192.

width :: SpriteSizeType optional

Mandatory if size is not defined.

Width of the picture in pixels, from 0-8192.

height :: SpriteSizeType optional

Mandatory if size is not defined.

Height of the picture in pixels, from 0-8192.

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.

shift :: Vector optional

Default: {0, 0}

The shift in tiles. util.by_pixel() can be used to divide the shift by 32 which is the usual pixel height/width of 1 tile in normal resolution. Note that 32 pixel tile height/width is not enforced anywhere - any other tile height or width is also possible.

scale :: double optional

Default: 1

Values other than 1 specify the scale of the sprite on default zoom. A scale of 2 means that the picture will be two times bigger on screen (and thus more pixelated).

draw_as_shadow :: bool optional

Default: false

Only one of draw_as_shadow, draw_as_glow and draw_as_light can be true. This takes precedence over draw_as_glow and draw_as_light.

draw_as_glow :: bool optional

Default: false

Only one of draw_as_shadow, draw_as_glow and draw_as_light can be true. This takes precedence over draw_as_light.

Draws first as a normal sprite, then again as a light layer. See https://forums.factorio.com/91682.

draw_as_light :: bool optional

Default: false

Only one of draw_as_shadow, draw_as_glow and draw_as_light can be true.

mipmap_count :: uint8 optional

Default: 0

Only loaded if this is an icon, that is it has the flag "group=icon" or "group=gui".

apply_runtime_tint :: bool optional

Default: false

tint :: Color optional

Default: {r=1, g=1, b=1, a=1}

blend_mode :: BlendMode optional

Default: "normal"

load_in_minimal_mode :: bool 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 (Example). Modders can ignore this property.

premul_alpha :: bool optional

Default: true

Whether alpha should be pre-multiplied.

generate_sdf :: bool optional

Example of the icon shadow in the character modifier icon used by the steel axe researchExample of the icon shadow in the character modifier icon used by the steel axe research

Default: false

This property is only used by sprites used in UtilitySprites that have the "icon" flag set.

If this is set to true, the game will generate an icon shadow (using signed distance fields) for the sprite.

Prototypes

Types