Prototype/Animation: Difference between revisions
(Added frame_sequence (0.17)) |
(Added dicing) |
||
Line 98: | Line 98: | ||
{{Prototype property|repeat_count|[[Types/uint8|uint8]]|1|optional=true}} | {{Prototype property|repeat_count|[[Types/uint8|uint8]]|1|optional=true}} | ||
Can't be 0. | Can't be 0. | ||
{{Prototype property|dice|[[Types/uint8|uint8]]|optional=true}} | |||
{{Prototype property|dice_x|[[Types/uint8|uint8]]|optional=true}} | |||
{{Prototype property|dice_y|[[Types/uint8|uint8]]|optional=true}} | |||
{{Prototype property|frame_sequence|[[Types/AnimationFrameSequence|AnimationFrameSequence]]|optional=true}} | {{Prototype property|frame_sequence|[[Types/AnimationFrameSequence|AnimationFrameSequence]]|optional=true}} | ||
{{Prototype property|stripes|[[Types/table|table]] of [[Types/Stripe|Stripe]]|optional=true}} | {{Prototype property|stripes|[[Types/table|table]] of [[Types/Stripe|Stripe]]|optional=true}} |
Revision as of 12:50, 8 September 2020
Prototype definitions ยป Prototype/Animation
Specifies a animation that can be used by https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation during runtime.
Mandatory properties
type
Type: string
Must be "animation".
name
Type: string
Name of the animation. Must be unique. Used in https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation.
Optional properties
layers
Type: table of Animation
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.
hr_version
Type: Animation
If this property exists and high resolution sprites are turned on, its contents are used to load the Animation.
filename
Type: FileName
Default: ""
Mandatory if stripes
is not specified.
priority
Type: SpritePriority
Default: "medium"
flags
Type: SpriteFlags
size
Type: SpriteSizeType or table of SpriteSizeType
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.
width
Type: SpriteSizeType
Mandatory if size
is not given. Width of one frame in pixels, from 0-8192.
height
Type: SpriteSizeType
Mandatory if size
is not given. Height of one frame in pixels, from 0-8192.
x
Type: SpriteSizeType
Default: 0
Horizontal position of the animation in the source file in pixels.
y
Type: SpriteSizeType
Default: 0
Vertical position of the animation in the source file in pixels.
position
Type: table of SpriteSizeType
Loaded only when x
and y
are both 0. The first member of the array is x and the second is y.
shift
Type: vector
Default: {0, 0}
scale
Type: double
Default: 1
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).
draw_as_shadow
Type: bool
Default: false
mipmap_count
Type: uint8
Default: 0
Only loaded if this is an icon (has flag "group=icon" or "group=gui").
apply_runtime_tint
Type: bool
Default: false
tint
Type: Color
Default: {r=1, g=1, b=1, a=1} (white)
blend_mode
Type: BlendMode
Default: "normal"
load_in_minimal_mode
Type: bool
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). If you are a modder, you can just ignore this property.
premul_alpha
Type: bool
Default: true
Whether alpha should be premultiplied.
generate_sdf
Type: bool
Default: false
run_mode
Type: string
Default: "forward"
Possible values are:
- forward
- backward
- forward-then-backward
frame_count
Type: uint32
Default: 1
Can't be 0.
line_length
Type: uint32
Default: 0
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 avoid pictures with too big width.
The game engine limits the width of any input picture to 2048px, so it is compatible with most graphics cards.
animation_speed
Type: float
Default: 1
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.
max_advance
Type: float
Default: MAX_FLOAT
repeat_count
Type: uint8
Default: 1
Can't be 0.
dice
Type: uint8
dice_x
Type: uint8
dice_y
Type: uint8
frame_sequence
Type: AnimationFrameSequence