Types/RotatedAnimation: Difference between revisions
(Added frame_sequence (0.17)) |
Muppet9010 (talk | contribs) (→line_length: clarify what the field is actually setting and re-organise existing description to be far more readable.) |
||
(10 intermediate revisions by 4 users not shown) | |||
Line 3: | Line 3: | ||
=== direction_count === | === direction_count === | ||
'''Type''': [[Types/uint32]] | '''Type''': [[Types/uint32]] | ||
The sequential animation instance is loaded equal to the entities direction within the direction_count setting. | |||
Direction count to [[Types/Direction]] (animation sequence number): | |||
*'''1''' - '''North''' (1) | |||
*'''2''' - '''North''' (1), South (2) | |||
*'''4''' - '''North''' (1), '''East''' (2), '''South''' (3), '''West''' (4) | |||
*'''8''' - '''North''' (1), '''Northeast''' (2), '''East''' (3), '''Southeast''' (4), '''South''' (5), '''Southwest''' (6), '''West''' (7), '''Northwest''' (8) | |||
== Optional properties == | == Optional properties == | ||
Line 105: | Line 113: | ||
'''Default''': false | '''Default''': false | ||
Only one of <code>draw_as_shadow</code>, <code>draw_as_glow</code> and <code>draw_as_light</code> can be true. <code>draw_as_shadow</code> takes precedence over <code>draw_as_glow</code> and <code>draw_as_light</code>. | |||
=== draw_as_glow === | |||
'''Type''': [[Types/bool]] | |||
'''Default''': false | |||
Only one of <code>draw_as_shadow</code>, <code>draw_as_glow</code> and <code>draw_as_light</code> can be true. <code>draw_as_glow</code> takes precedence over <code>draw_as_light</code>. | |||
Draws first as a normal sprite, and again as a light layer.<sup>[https://forums.factorio.com/91682]</sup> | |||
=== draw_as_light === | |||
'''Type''': [[Types/bool]] | |||
'''Default''': false | |||
Only one of <code>draw_as_shadow</code>, <code>draw_as_glow</code> and <code>draw_as_light</code> can be true. | |||
=== mipmap_count === | === mipmap_count === | ||
Line 146: | Line 172: | ||
'''Default''': false | '''Default''': false | ||
Unused. | |||
=== run_mode === | === run_mode === | ||
Line 169: | Line 197: | ||
'''Default''': 0 | '''Default''': 0 | ||
Once the specified number of pictures | Specifies how many pictures are on each horizontal line in the image file. 0 means that all the pictures are in one horizontal line. | ||
This is to allow having longer animations in matrix | 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 === | === animation_speed === | ||
Line 190: | Line 218: | ||
'''Default''': 1 | '''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. | |||
Can't be 0. | Can't be 0. | ||
=== dice === | |||
'''Type''': [[Types/uint8]] | |||
=== dice_x === | |||
'''Type''': [[Types/uint8]] | |||
=== dice_y === | |||
'''Type''': [[Types/uint8]] | |||
=== frame_sequence === | === frame_sequence === | ||
Line 231: | Line 270: | ||
=== stripes === | === stripes === | ||
'''Type''': [[Types/table|table]] of [[Types/Stripe|Stripe]] | '''Type''': [[Types/table|table]] (array) of [[Types/Stripe|Stripe]] | ||
{{Prototype property type usage|{{FULLPAGENAME}}}} | {{Prototype property type usage|{{FULLPAGENAME}}}} |
Latest revision as of 23:27, 26 December 2022
Mandatory properties
direction_count
Type: Types/uint32
The sequential animation instance is loaded equal to the entities direction within the direction_count setting.
Direction count to Types/Direction (animation sequence number):
- 1 - North (1)
- 2 - North (1), South (2)
- 4 - North (1), East (2), South (3), West (4)
- 8 - North (1), Northeast (2), East (3), Southeast (4), South (5), Southwest (6), West (7), Northwest (8)
Optional properties
layers
Type: Types/table of Types/RotatedAnimation
If this property is present, all RotatedAnimation definitions have to be placed as entries in the array, and they will all be loaded from there. Each item (RotatedAnimation 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: Types/RotatedAnimation
If this property exists and high resolution sprites are turned on, its contents are used to load the RotatedAnimation.
filename
Type: Types/FileName
Default: ""
Mandatory if stripes
and filenames
is not specified.
filenames
Type: types/table of Types/FileName
Default: ""
Only loaded if stripes
is not present.
slice
Type: Types/uint32
Mandatory if filenames
is present.
lines_per_file
Type: Types/uint32
Mandatory if filenames
is present.
priority
Type: Types/SpritePriority
Default: "medium"
flags
Type: Types/SpriteFlags
size
Type: Types/SpriteSizeType or Types/table of Types/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: Types/SpriteSizeType
Mandatory if size
is not given. Width of one frame in pixels, from 0-8192.
height
Type: Types/SpriteSizeType
Mandatory if size
is not given. Height of one frame in pixels, from 0-8192.
x
Type: Types/SpriteSizeType
Default: 0
Horizontal position of the animation in the source file in pixels.
y
Type: Types/SpriteSizeType
Default: 0
Vertical position of the animation in the source file in pixels.
position
Type: Types/table of Types/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: Types/vector
Default: {0, 0}
scale
Type: Types/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: Types/bool
Default: false
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
.
draw_as_glow
Type: Types/bool
Default: false
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]
draw_as_light
Type: Types/bool
Default: false
Only one of draw_as_shadow
, draw_as_glow
and draw_as_light
can be true.
mipmap_count
Type: Types/uint8
Default: 0
Only loaded if this is an icon (has flag "group=icon" or "group=gui").
apply_runtime_tint
Type: Types/bool
Default: false
tint
Type: Types/Color
Default: {r=1, g=1, b=1, a=1} (white)
blend_mode
Type: Types/BlendMode
Default: "normal"
load_in_minimal_mode
Type: Types/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: Types/bool
Default: true
Whether alpha should be premultiplied.
generate_sdf
Type: Types/bool
Default: false
Unused.
run_mode
Type: Types/string
Default: "forward"
Possible values are:
- forward
- backward
- forward-then-backward
frame_count
Type: Types/uint32
Default: 1
Can't be 0.
line_length
Type: Types/uint32
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
Type: Types/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: Types/float
Default: MAX_FLOAT
repeat_count
Type: Types/uint8
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.
Can't be 0.
dice
Type: Types/uint8
dice_x
Type: Types/uint8
dice_y
Type: Types/uint8
frame_sequence
Type: Types/AnimationFrameSequence
still_frame
Type: Types/uint32
Default: 0
axially_symmetrical
Type: Types/bool
Default: false
If true, direction_count
must be greater than 1.
counterclockwise
Type: Types/bool
Default: false
middle_orientation
Type: Types/RealOrientation
Default: 0.5
orientation_range
Type: Types/float
Default: 1
Automatically clamped to be between 0 and 1.
apply_projection
Type: Types/bool
Default: true
stripes
Prototype properties that use this type
- Prototype/Car : animation
- Prototype/Car : light_animation
- Prototype/Car : turret_animation
- Prototype/CombatRobot : idle
- Prototype/CombatRobot : in_motion
- Prototype/CombatRobot : shadow_idle
- Prototype/CombatRobot : shadow_in_motion
- Prototype/ConstructionRobot : shadow_working
- Prototype/ConstructionRobot : working
- Prototype/Corpse : animation
- Prototype/Corpse : animation_overlay
- Prototype/LogisticRobot : idle_with_cargo
- Prototype/LogisticRobot : in_motion_with_cargo
- Prototype/LogisticRobot : shadow_idle_with_cargo
- Prototype/LogisticRobot : shadow_in_motion_with_cargo
- Prototype/RailSignalBase : animation
- Prototype/RobotWithLogisticInterface : idle
- Prototype/RobotWithLogisticInterface : in_motion
- Prototype/RobotWithLogisticInterface : shadow_idle
- Prototype/RobotWithLogisticInterface : shadow_in_motion
- Prototype/TransportBelt : animations
- Prototype/Turret : attacking_animation
- Prototype/Turret : ending_attack_animation
- Prototype/Turret : energy_glow_animation
- Prototype/Turret : folded_animation
- Prototype/Turret : folding_animation
- Prototype/Turret : prepared_alternative_animation
- Prototype/Turret : prepared_animation
- Prototype/Turret : preparing_animation
- Prototype/Turret : starting_attack_animation
- Prototype/Unit : run_animation