Prototype/Animation: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(updated line_length description)
(repeat_count desc copied from Types/Animation)
Line 109: Line 109:


{{Prototype property|repeat_count|[[Types/uint8|uint8]]|1|optional=true}}
{{Prototype property|repeat_count|[[Types/uint8|uint8]]|1|optional=true}}
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.
Can't be 0.
Can't be 0.



Revision as of 10:19, 21 September 2022

Template:Prototype parent Specifies a animation that can be used by https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation during runtime.

Template:Prototype TOC

Mandatory properties

Template:Prototype property Must be "animation".

Template:Prototype property Name of the animation. Must be unique. Used in https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation.

Optional properties

Template:Prototype property If this property is present, all Animation definitions have to be placed as entries in the array, and they will all be loaded from there. Each item (Animation definition) in the array may also have the layers property.

If this property is present, all other properties are ignored and the mandatory properties do not have to be defined.

Layers may not be an empty table.

Template:Prototype property If this property exists and high resolution sprites are turned on, its contents are used to load the Animation.

Template:Prototype property Mandatory if stripes is not specified.

Template:Prototype property

Template:Prototype property

Template:Prototype property The width and height of the one frame. If this is an array, the first member of the array 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.

Template:Prototype property Mandatory if size is not given. Width of one frame in pixels, from 0-8192.

Template:Prototype property Mandatory if size is not given. Height of one frame in pixels, from 0-8192.

Template:Prototype property Horizontal position of the animation in the source file in pixels.

Template:Prototype property Vertical position of the animation in the source file in pixels.

Template:Prototype property Loaded only when x and y are both 0. The first member of the array is x and the second is y.

Template:Prototype property

Template:Prototype property Values different than 1 specify the scale of the animation on default zoom. Scale 2 means that the picture will be 2 times bigger on screen (and more pixelated).

Template:Prototype property Only one of draw_as_shadow, draw_as_glow and draw_as_light can be true. draw_as_shadow takes precedence over draw_as_glow and draw_as_light.

Template:Prototype property Only one of draw_as_shadow, draw_as_glow and draw_as_light can be true. draw_as_glow takes precedence over draw_as_light.

Draws first as a normal sprite, and again as a light layer.[1]

Template:Prototype property Only one of draw_as_shadow, draw_as_glow and draw_as_light can be true.

Template:Prototype property Only loaded if this is an icon (has flag "group=icon" or "group=gui").
Note: mipmap_count doesn't make sense in animation, as it is not possible to layout mipmaps in a way, that would load correctly both the animation and the mipmaps (besides animations with just one frame).[2]

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property 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). If you are a modder, you can just ignore this property.

Template:Prototype property Whether alpha should be premultiplied.

Template:Prototype property Unused.

Template:Prototype property Possible values are:

  • forward
  • backward
  • forward-then-backward

Template:Prototype property Can't be 0.

Template:Prototype property Once the specified number of pictures is loaded, other pictures are loaded on other line. This is to allow having longer animations in matrix, to input files with too high width. The game engine limits the width of any input files to 8192px, so it is compatible with most graphics cards. 0 means that all the pictures are in one horizontal line.

Template:Prototype property Modifier of the animation playing speed, the default is 1, which 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.

Template:Prototype property

Template:Prototype property 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.

Can't be 0.

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property