Types/RotatedSprite: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(→‎Example: updated)
(Removed old prototype docs)
Tag: Replaced
 
(17 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Basics ==
<div class="stub"><p>'''The prototype docs have moved to a new website with an improved format.''' This documentation page can now be found here: [https://lua-api.factorio.com/latest/types/RotatedSprite.html https://lua-api.factorio.com/latest/types/RotatedSprite.html]
Specifies series of sprites used to visualise different rotations of the object.


== Properties ==
</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
=== filename ===
'''Type''':[[Types/FileName]]
=== priority ===
'''Type''':[[Types/string]]
 
Possible values:
*extra-high
*high
*medium
*low
*very low
=== frame_width ===
'''Type''': [[Types/uint32]]
 
Width of single frame in pixels.
=== frame_height ===
'''Type''': [[Types/uint32]]
 
Height of single frame in pixels
=== direction_count ===
'''Type''': [[Types/uint32]]
 
Count of direction (frames) specified.
=== line_length ===
'''Type''': [[Types/uint32]]
 
'''Defult''': 0
 
Used to specify the individual images in grid.
0 means that all the picture are in one horizontal line.
=== x ===
'''Type''': [[Types/uint32]]
 
'''Default''': 0
 
Horizontal position of the animation in the source file in pixels.
 
=== y ===
'''Type''': [[Types/uint32]]
 
'''Default''': 0
 
Vertical position of the animation in the source file in pixels.
 
=== shift ===
'''Type''': [[Types/vector]]
 
'''Default''': 0
=== scale ===
'''Type''': [[Types/double]]
 
'''Default''': 1
 
Values different than 1 specify the scale of the picture on default zoom.
Scale 2 means that the picture will be 2 times bigger on screen (and more pixelated).
 
=== axially_symmetrical ===
'''Type''': [[Types/bool]]
 
'''Default''': false
 
When set to true, left the same picture is used for left/right direction, just flipped, this can save half of the space required, but is not usable once the picture contains shadows etc.
=== apply_projection ===
'''Type''': [[Types/bool]]
 
'''Default''': true
 
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).
== Example ==
<syntaxhighlight lang="lua">pictures =
    {
      layers =
      {
        {
          filename = "__base__/graphics/entity/radar/radar.png",
          priority = "low",
          width = 98,
          height = 128,
          apply_projection = false,
          direction_count = 64,
          line_length = 8,
          shift = util.by_pixel(1, -16),
          hr_version =
          {
            filename = "__base__/graphics/entity/radar/hr-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 = 172,
          height = 94,
          apply_projection = false,
          direction_count = 64,
          line_length = 8,
          shift = util.by_pixel(39,3),
          draw_as_shadow = true,
          hr_version =
          {
            filename = "__base__/graphics/entity/radar/hr-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
          }
        }
      }
    },</syntaxhighlight>

Latest revision as of 14:32, 25 October 2024

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/types/RotatedSprite.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.