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

# Factorio Prototype Docs Version 2.0.77

# RotatedSprite - Prototype Docs

## RotatedSprite :: struct Example code

Specifies series of sprites used to visualize different rotations of the object.

Inherits from SpriteParameters « SpriteSource

## Properties

- default
- sorted

layers optional | :: array[RotatedSprite] | If this property is present, all RotatedSprite definitions have to be placed as entries in the array, and they will all be loaded from there. [...]
If this property is present, all RotatedSprite definitions have to be placed as entries in the array, and they will all be loaded from there. [...]
direction_count optional | :: uint16 | Only loaded, and mandatory if `layers` is not defined. [...]
Only loaded, and mandatory if `layers` is not defined. [...]
filenames optional | :: array[FileName] | Only loaded, and mandatory if both `layers` and `filename` are not defined.
Only loaded, and mandatory if both `layers` and `filename` are not defined.
lines_per_file optional | :: uint64 | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
dice optional | :: SpriteSizeType | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
dice_x optional | :: SpriteSizeType | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
dice_y optional | :: SpriteSizeType | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
back_equals_front optional | :: boolean | Only loaded if `layers` is not defined.
Only loaded if `layers` is not defined.
apply_projection optional | :: boolean | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
counterclockwise optional | :: boolean | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
line_length optional | :: uint32 | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
allow_low_quality_rotation optional | :: boolean | Only loaded if `layers` is not defined.
Only loaded if `layers` is not defined.
frames optional | :: array[RotatedSpriteFrame] | A list of overrides and customizations for each specific frame within the rotated sprite. [...]
A list of overrides and customizations for each specific frame within the rotated sprite. [...]

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 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 | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
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[overridden] optional | :: FileName | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
size optional | :: SpriteSizeType or {SpriteSizeType, SpriteSizeType} | The width and height of the sprite. [...]
The width and height of the sprite. [...]
width optional | :: SpriteSizeType | Mandatory if `size` is not defined. [...]
Mandatory if `size` is not defined. [...]
height 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'. [...]

allow_low_quality_rotation optional | :: boolean | Only loaded if `layers` is not defined.
Only loaded if `layers` is not defined.
apply_projection optional | :: boolean | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
back_equals_front optional | :: boolean | Only loaded if `layers` is not defined.
Only loaded if `layers` is not defined.
counterclockwise optional | :: boolean | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
dice optional | :: SpriteSizeType | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
dice_x optional | :: SpriteSizeType | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
dice_y optional | :: SpriteSizeType | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
direction_count optional | :: uint16 | Only loaded, and mandatory if `layers` is not defined. [...]
Only loaded, and mandatory if `layers` is not defined. [...]
filenames optional | :: array[FileName] | Only loaded, and mandatory if both `layers` and `filename` are not defined.
Only loaded, and mandatory if both `layers` and `filename` are not defined.
frames optional | :: array[RotatedSpriteFrame] | A list of overrides and customizations for each specific frame within the rotated sprite. [...]
A list of overrides and customizations for each specific frame within the rotated sprite. [...]
layers optional | :: array[RotatedSprite] | If this property is present, all RotatedSprite definitions have to be placed as entries in the array, and they will all be loaded from there. [...]
If this property is present, all RotatedSprite definitions have to be placed as entries in the array, and they will all be loaded from there. [...]
line_length optional | :: uint32 | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
lines_per_file optional | :: uint64 | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]

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 | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
invert_colors optional | :: boolean |
mipmap_count 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[overridden] optional | :: FileName | Only loaded if `layers` is not defined. [...]
Only loaded if `layers` is not defined. [...]
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 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 optional | :: SpriteSizeType or {SpriteSizeType, SpriteSizeType} | The width and height of the sprite. [...]
The width and height of the sprite. [...]
width 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

### layers :: array[RotatedSprite] optional

If this property is present, all RotatedSprite definitions have to be placed as entries in the array, and they will all be loaded from there. `layers` may not be an empty table. Each definition in the array may also have the `layers` property.

If this property is present, all other properties, including those inherited from SpriteParameters, are ignored.

### direction_count :: uint16 optional

Only loaded, and mandatory if `layers` is not defined.

Count of direction (frames) specified.

### filenames :: array[FileName] optional

Only loaded, and mandatory if both `layers` and `filename` are not defined.

### lines_per_file :: uint64 optional

Default: `0`

Only loaded if `layers` is not defined. Mandatory if `filenames` is defined.

### dice :: SpriteSizeType optional

Only loaded if `layers` is not defined.

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 4x4 grid.

### dice_x :: SpriteSizeType optional

Only loaded if `layers` is not defined.

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

### dice_y :: SpriteSizeType optional

Only loaded if `layers` is not defined.

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

### back_equals_front :: boolean optional

Default: `false`

Only loaded if `layers` is not defined.

### apply_projection :: boolean optional

Default: `true`

Only loaded if `layers` is not defined.

Used to fix the inconsistency of direction of the entity in 3d when rendered and direction on the screen (where the 45 degree angle for projection is used).

### counterclockwise :: boolean optional

Default: `false`

Only loaded if `layers` is not defined.

Set to `true` to indicate sprites in the spritesheet are in counterclockwise order.

### line_length :: uint32 optional

Default: `0`

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 more sprites 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.

### allow_low_quality_rotation :: boolean optional

Default: `false`

Only loaded if `layers` is not defined.

### frames :: array[RotatedSpriteFrame] optional

A list of overrides and customizations for each specific frame within the rotated sprite. This can be used to adjust each individual frame's width, height, and other properties. If this property is present, then it must contain at least as many `RotatedSpriteFrame` as there are sprites in this RotatedSprite.

## Overridden Properties

### filename :: FileName optional

Only loaded if `layers` is not defined.

The path to the sprite file to use.

### generate_sdf :: boolean optional

Default: `false`

Only loaded if `layers` is not defined.

Unused.

## Example

    pictures =
    {
      layers =
      {
        {
          filename = "__base__/graphics/entity/radar/radar.png",
          priority = "low",
          width = 196,
          height = 254,
          apply_projection = false,
          direction_count = 64,
          line_length = 8,
          shift = util.by_pixel(1, -16),
          scale = 0.5
        },
        {
          filename = "__base__/graphics/entity/radar/radar-shadow.png",
          priority = "low",
          width = 343,
          height = 186,
          apply_projection = false,
          direction_count = 64,
          line_length = 8,
          shift = util.by_pixel(39.25,3),
          draw_as_shadow = true,
          scale = 0.5
        }
      }
    }

Type used in

- ArtilleryTurretPrototype::cannon_base_pictures
- ArtilleryTurretPrototype::cannon_barrel_pictures
- AsteroidCollectorGraphicsSet::status_lamp_picture_on
- AsteroidCollectorGraphicsSet::status_lamp_picture_full
- AsteroidCollectorGraphicsSet::status_lamp_picture_off
- AsteroidCollectorGraphicsSet::below_arm_pictures
- AsteroidCollectorGraphicsSet::below_ground_pictures
- AsteroidCollectorGraphicsSet::arm_link
- CorpsePrototype::underwater_patch
- CranePart::rotated_sprite
- CranePart::rotated_sprite_shadow
- CranePart::rotated_sprite_reflection
- ElectricPolePrototype::pictures
- RadarPrototype::pictures
- RailSupportGraphicsSet::underwater_structure
- RailSupportGraphicsSet::structure
- RollingStockRotatedSlopedGraphics::rotated
- RollingStockRotatedSlopedGraphics::sloped
- RotatedSprite::layers
- SpiderLegGraphicsSet::joint
- SpiderLegGraphicsSet::joint_shadow
- SpiderLegGraphicsSet::foot
- SpiderLegGraphicsSet::foot_shadow
- SpiderLegPart::top_end
- SpiderLegPart::middle
- SpiderLegPart::bottom_end
- TransportBeltAnimationSet::frozen_patch