pub struct Animation {Show 26 fields
pub name: &'static str,
pub allow_forced_downscale: Option<bool>,
pub animation_speed: Option<f64>,
pub apply_runtime_tint: Option<bool>,
pub apply_special_effect: Option<bool>,
pub blend_mode: Option<&'static str>,
pub dice: Option<i64>,
pub dice_x: Option<i64>,
pub dice_y: Option<i64>,
pub draw_as_glow: Option<bool>,
pub draw_as_light: Option<bool>,
pub draw_as_shadow: Option<bool>,
pub filename: Option<&'static str>,
pub filenames: Option<&'static [&'static str]>,
pub frame_count: Option<i64>,
pub generate_sdf: Option<bool>,
pub invert_colors: Option<bool>,
pub line_length: Option<i64>,
pub lines_per_file: Option<i64>,
pub load_in_minimal_mode: Option<bool>,
pub max_advance: Option<f64>,
pub mipmap_count: Option<i64>,
pub premul_alpha: Option<bool>,
pub repeat_count: Option<i64>,
pub rotate_shift: Option<bool>,
pub scale: Option<f64>,
}Expand description
Minimal AnimationPrototype for data.extend.
Specifies an animation that can be used with LuaRendering::draw_animation at runtime.
type = "animation" is injected by the Lua generator.
Fields§
§name: &'static strName of the animation. Can be used with LuaRendering::draw_animation at runtime.
allow_forced_downscale: Option<bool>Only loaded if layers is not defined.
If true, the sprite may be downsampled to half its size on load even when ‘Sprite quality’ graphics setting is set to ‘High’. Whether downsampling happens depends on detected hardware and other graphics settings.
animation_speed: Option<f64>Only loaded if layers is not defined.
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.
If layers are used, the animation_speed only has to be defined in one layer. All layers will run at the same speed.
apply_runtime_tint: Option<bool>Only loaded if layers is not defined.
apply_special_effect: Option<bool>Only loaded if layers is not defined.
blend_mode: Option<&'static str>Only loaded if layers is not defined.
dice: Option<i64>Only loaded if layers is not defined.
dice_x: Option<i64>Only loaded if layers is not defined.
dice_y: Option<i64>Only loaded if layers is not defined.
draw_as_glow: Option<bool>Only loaded if layers is not defined.
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: Option<bool>Only loaded if layers is not defined.
Only one of draw_as_shadow, draw_as_glow and draw_as_light can be true.
draw_as_shadow: Option<bool>Only loaded if layers is not defined.
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.
filename: Option<&'static str>Only loaded if layers is not defined. Mandatory if neither stripes nor filenames are defined.
The path to the sprite file to use.
filenames: Option<&'static [&'static str]>Only loaded if neither layers nor stripes are defined.
frame_count: Option<i64>Only loaded if layers is not defined.
Can’t be 0.
generate_sdf: Option<bool>Only loaded if layers is not defined.
Unused.
invert_colors: Option<bool>Only loaded if layers is not defined.
line_length: Option<i64>Only loaded if layers is not defined.
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.
lines_per_file: Option<i64>Only loaded if layers is not defined. Mandatory if filenames is defined.
load_in_minimal_mode: Option<bool>Only loaded if layers is not defined.
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. Modders can ignore this property.
max_advance: Option<f64>Only loaded if layers is not defined.
If layers are used, max_advance of the first layer is used for all layers.
Maximum amount of frames the animation can move forward in one update.
mipmap_count: Option<i64>Only loaded if layers is not defined.
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.
premul_alpha: Option<bool>Only loaded if layers is not defined.
Whether alpha should be pre-multiplied.
repeat_count: Option<i64>Only loaded if layers is not defined.
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.
rotate_shift: Option<bool>Only loaded if layers is not defined.
scale: Option<f64>Only loaded if layers is not defined.
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).