Types/Sprite: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Undo revision 151289 by Bilka (talk))
(Removed old prototype docs)
Tag: Replaced
 
(34 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Languages}}
<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/Sprite.html https://lua-api.factorio.com/latest/types/Sprite.html]
== Basics ==
Specifies one picture that can be used in the game.


When there is more than one sprite or [[Types/Animation|animation]] frame with the same source file and dimensions/position in the game, they all share the same memory.
</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>
== Properties ==
=== filename ===
'''Type''':[[Types/FileName]]
=== priority ===
'''Type''':[[Types/string]]
 
Possible values:
* extra-high
* high
* medium
* low
* very-low
 
=== width ===
'''Type''': [[Types/unsigned]]
 
Width of the picture in pixels.
=== height ===
'''Type''': [[Types/unsigned]]
 
Height of the picture in pixels
=== x ===
'''Type''': [[Types/unsigned]]
 
'''Default''': 0
 
Horizontal position of the picture in the source file in pixels.
 
=== y ===
'''Type''': [[Types/unsigned]]
 
'''Default''': 0
 
Vertical position of the picture in the source file in pixels.
 
=== shift ===
'''Type''': [[Types/vector]]
 
'''Default''': {0, 0}
 
Used to offset the sprite in-game from its bounding box.
 
=== 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).
== Example ==
    picture =
    {
      filename = "__base__/graphics/entity/basic-accumulator/basic-accumulator.png",
      priority = "extra-high",
      width = 124,
      height = 103,
      shift = {0.7, -0.2}
    }

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/Sprite.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.