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

# Factorio Prototype Docs Version 2.0.77

# AnimationParameters - Prototype Docs

## AnimationParameters :: struct - abstract

Inherits from SpriteParameters « SpriteSource
Children Animation AnimationSheet RotatedAnimation

## Properties

- default
- sorted

run_mode optional | :: AnimationRunMode |
frame_count optional | :: uint32 | Can't be `0`.
Can't be `0`.
line_length optional | :: uint32 | Specifies how many pictures are on each horizontal line in the image file. [...]
Specifies how many pictures are on each horizontal line in the image file. [...]
animation_speed optional | :: float | Modifier of the animation playing speed, the default of `1` means one animation frame per tick (60 fps). [...]
Modifier of the animation playing speed, the default of `1` means one animation frame per tick (60 fps). [...]
max_advance optional | :: float | Maximum amount of frames the animation can move forward in one update. [...]
Maximum amount of frames the animation can move forward in one update. [...]
repeat_count optional | :: uint8 | How many times to repeat the animation to complete an animation cycle. [...]
How many times to repeat the animation to complete an animation cycle. [...]
dice optional | :: uint8 | Number of slices this is sliced into when using the "optimized atlas packing" option. [...]
Number of slices this is sliced into when using the "optimized atlas packing" option. [...]
dice_x optional | :: uint8 | Same as `dice` above, but this specifies only how many slices there are on the x axis.
Same as `dice` above, but this specifies only how many slices there are on the x axis.
dice_y optional | :: uint8 | Same as `dice` above, but this specifies only how many slices there are on the y axis.
Same as `dice` above, but this specifies only how many slices there are on the y axis.
frame_sequence optional | :: AnimationFrameSequence |

Inherited from SpriteParameters

priority optional | :: SpritePriority |
flags optional | :: SpriteFlags |
shift optional | :: Vector | The shift in tiles. [...]
The shift in tiles. [...]
rotate_shift optional | :: boolean | Whether to rotate the `shift` alongside the sprite's rotation. [...]
Whether to rotate the `shift` alongside the sprite's rotation. [...]
apply_special_effect optional | :: boolean |
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 | :: boolean | 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 | :: boolean | 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 | :: boolean | 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.
occludes_light optional | :: boolean | Loaded only if `draw_as_shadow`, `draw_as_glow` and `draw_as_light` are `false`, and only by sprites used by tile renderer (decals and underwater patches). [...]
Loaded only if `draw_as_shadow`, `draw_as_glow` and `draw_as_light` are `false`, and only by sprites used by tile renderer (decals and underwater patches). [...]
mipmap_count[overridden] 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 | :: boolean |
tint_as_overlay optional | :: boolean |
invert_colors optional | :: boolean |
tint optional | :: Color |
blend_mode optional | :: BlendMode |
generate_sdf[overridden] optional | :: boolean | Unused.
Unused.
surface optional | :: SpriteUsageSurfaceHint | Provides hint to sprite atlas system, so it can try to put sprites that are intended to be used at the same locations to the same sprite atlas.
Provides hint to sprite atlas system, so it can try to put sprites that are intended to be used at the same locations to the same sprite atlas.
usage optional | :: SpriteUsageHint | Provides hint to sprite atlas system, so it can pack sprites that are related to each other to the same sprite atlas.
Provides hint to sprite atlas system, so it can pack sprites that are related to each other to the same sprite atlas.

Inherited from SpriteSource

filename | :: FileName | The path to the sprite file to use.
The path to the sprite file to use.
size[overridden] optional | :: SpriteSizeType or {SpriteSizeType, SpriteSizeType} | The width and height of one frame. [...]
The width and height of one frame. [...]
width[overridden] optional | :: SpriteSizeType | Mandatory if `size` is not defined. [...]
Mandatory if `size` is not defined. [...]
height[overridden] 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'. [...]

animation_speed optional | :: float | Modifier of the animation playing speed, the default of `1` means one animation frame per tick (60 fps). [...]
Modifier of the animation playing speed, the default of `1` means one animation frame per tick (60 fps). [...]
dice optional | :: uint8 | Number of slices this is sliced into when using the "optimized atlas packing" option. [...]
Number of slices this is sliced into when using the "optimized atlas packing" option. [...]
dice_x optional | :: uint8 | Same as `dice` above, but this specifies only how many slices there are on the x axis.
Same as `dice` above, but this specifies only how many slices there are on the x axis.
dice_y optional | :: uint8 | Same as `dice` above, but this specifies only how many slices there are on the y axis.
Same as `dice` above, but this specifies only how many slices there are on the y axis.
frame_count optional | :: uint32 | Can't be `0`.
Can't be `0`.
frame_sequence optional | :: AnimationFrameSequence |
line_length optional | :: uint32 | Specifies how many pictures are on each horizontal line in the image file. [...]
Specifies how many pictures are on each horizontal line in the image file. [...]
max_advance optional | :: float | Maximum amount of frames the animation can move forward in one update. [...]
Maximum amount of frames the animation can move forward in one update. [...]
repeat_count optional | :: uint8 | How many times to repeat the animation to complete an animation cycle. [...]
How many times to repeat the animation to complete an animation cycle. [...]
run_mode optional | :: AnimationRunMode |

Inherited from SpriteParameters

apply_runtime_tint optional | :: boolean |
apply_special_effect optional | :: boolean |
blend_mode optional | :: BlendMode |
draw_as_glow optional | :: boolean | 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 | :: boolean | 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_shadow optional | :: boolean | 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. [...]
flags optional | :: SpriteFlags |
generate_sdf[overridden] optional | :: boolean | Unused.
Unused.
invert_colors optional | :: boolean |
mipmap_count[overridden] 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"`. [...]
occludes_light optional | :: boolean | Loaded only if `draw_as_shadow`, `draw_as_glow` and `draw_as_light` are `false`, and only by sprites used by tile renderer (decals and underwater patches). [...]
Loaded only if `draw_as_shadow`, `draw_as_glow` and `draw_as_light` are `false`, and only by sprites used by tile renderer (decals and underwater patches). [...]
priority optional | :: SpritePriority |
rotate_shift optional | :: boolean | Whether to rotate the `shift` alongside the sprite's rotation. [...]
Whether to rotate the `shift` alongside the sprite's rotation. [...]
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. [...]
shift optional | :: Vector | The shift in tiles. [...]
The shift in tiles. [...]
surface optional | :: SpriteUsageSurfaceHint | Provides hint to sprite atlas system, so it can try to put sprites that are intended to be used at the same locations to the same sprite atlas.
Provides hint to sprite atlas system, so it can try to put sprites that are intended to be used at the same locations to the same sprite atlas.
tint optional | :: Color |
tint_as_overlay optional | :: boolean |
usage optional | :: SpriteUsageHint | Provides hint to sprite atlas system, so it can pack sprites that are related to each other to the same sprite atlas.
Provides hint to sprite atlas system, so it can pack sprites that are related to each other to the same sprite atlas.

Inherited from SpriteSource

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[overridden] 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[overridden] optional | :: SpriteSizeType or {SpriteSizeType, SpriteSizeType} | The width and height of one frame. [...]
The width and height of one frame. [...]
width[overridden] 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

### run_mode :: AnimationRunMode optional

Default: `"forward"`

### frame_count :: uint32 optional

Default: `1`

Can't be `0`.

### line_length :: uint32 optional

Default: `0`

Specifies how many pictures are on each horizontal line in the image file. `0` means that all the pictures are in one horizontal line. Once the specified number of pictures are loaded from a line, the pictures from the next line are loaded. This is to allow having longer animations loaded in to Factorio's graphics matrix than the game engine's width limit of 8192px per input file. The restriction on input files is to be compatible with most graphics cards.

### animation_speed :: float optional

Default: `1`

Modifier of the animation playing speed, the default of `1` means one animation frame per tick (60 fps). The speed of playing can often vary depending on the usage (output of steam engine for example). Has to be greater than `0`.

### max_advance :: float optional

Default: MAX_FLOAT

Maximum amount of frames the animation can move forward in one update. Useful to cap the animation speed on entities where it is variable, such as car animations.

### repeat_count :: uint8 optional

Default: `1`

How many times to repeat the animation to complete an animation cycle. E.g. if one layer is 10 frames, a second layer of 1 frame would need `repeat_count = 10` to match the complete cycle.

### dice :: uint8 optional

Number of slices this is sliced into when using the "optimized atlas packing" option. If you are a modder, you can just ignore this property. Example: If this is 4, the sprite will be sliced into a 4×4 grid.

### dice_x :: uint8 optional

Same as `dice` above, but this specifies only how many slices there are on the x axis.

### dice_y :: uint8 optional

Same as `dice` above, but this specifies only how many slices there are on the y axis.

### frame_sequence :: AnimationFrameSequence optional

## Overridden Properties

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

The width and height of one frame. 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 one frame in pixels, from 0-4096.

### height :: SpriteSizeType optional

Mandatory if `size` is not defined.

Height of one frame in pixels, from 0-4096.

### mipmap_count :: uint8 optional

Default: `0`

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

Note that `mipmap_count` doesn't make sense in an animation, as it is not possible to layout mipmaps in a way that would load both the animation and the mipmaps correctly (besides animations with just one frame). See here.

### generate_sdf :: boolean optional

Default: `false`

Unused.