Types/SpriteNWaySheet: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Created page with "Used in Types/Sprite4Way and Types/Sprite8Way == Mandatory properties == === filename === '''Type''': Types/FileName '''Default''': "" Technically optional, bu...")
 
(Removed old prototype docs)
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Used in [[Types/Sprite4Way]] and [[Types/Sprite8Way]]
<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/SpriteNWaySheet.html https://lua-api.factorio.com/latest/types/SpriteNWaySheet.html]


== Mandatory 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]]
 
'''Default''': ""
 
Technically optional, but path to sprite cannot be empty.
 
=== width ===
'''Type''': [[Types/SpriteSizeType]]
 
Width of the picture in pixels, from 0-8192.
 
=== height ===
'''Type''': [[Types/SpriteSizeType]]
 
Height of the picture in pixels, from 0-8192.
 
== Optional properties ==
 
=== frames ===
'''Type''': [[Types/uint32]]
 
'''Default''': 4 if this is used in [[Types/Sprite4Way]], 8 if used in [[Types/Sprite8Way]]
 
Specifies how many of the directions of the SpriteNWay are filled up with this sheet.
 
=== hr_version ===
'''Type''': [[Types/SpriteNWaySheet]]
 
If this property exists and high resolution sprites are turned on, its contents are used to load the SpriteNWaySheet.
 
=== priority ===
'''Type''': [[Types/string]]
 
'''Default''': "medium"
 
Possible values:
* "extra-high-no-scale"
* "extra-high"
* "high"
* "medium"
* "low"
* "very-low"
 
=== flags ===
'''Type''': [[Types/SpriteFlags]]
 
=== x ===
'''Type''': [[Types/SpriteSizeType]]
 
'''Default''': 0
 
Horizontal position of the sprite in the source file in pixels.
 
=== y ===
'''Type''': [[Types/SpriteSizeType]]
 
'''Default''': 0
 
Vertical position of the sprite in the source file in pixels.
 
=== shift ===
'''Type''': [[Types/vector]]
 
'''Default''': {0, 0}
 
In tiles. util.by_pixel() can be used to divide the shift by 32 which is the usual pixel height/width of 1 tile in normal resolution. Note that 32 pixel tile height/width is not enforced anywhere - any other tile height or width is also possible.
 
=== scale ===
'''Type''': [[Types/double]]
 
'''Default''': 1
 
Values different than 1 specify the scale of the sprite 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
 
=== 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/string]]
 
'''Default''': "normal"
 
Possible values:
* "normal"
* "additive"
* "additive-soft"
* "multiplicative"
* "overwrite"
 
=== 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 ([https://cdn.discordapp.com/attachments/340530709712076801/532315796626472972/unknown.png Example]). If you are a modder, you can just ignore this property.
 
=== premul_alpha ===
'''Type''': [[Types/bool]]
 
'''Default''': true
 
Whether alpha should be premultiplied.
 
== Example ==
<syntaxhighlight lang="lua">sheet =
{
  filename = "__base__/graphics/entity/burner-inserter/burner-inserter-platform.png",
  priority = "extra-high",
  width = 46,
  height = 46,
  shift = {0.09375, 0},
  hr_version =
  {
    filename = "__base__/graphics/entity/burner-inserter/hr-burner-inserter-platform.png",
    priority = "extra-high",
    width = 105,
    height = 79,
    shift = util.by_pixel(1.5, 7.5-1),
    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/SpriteNWaySheet.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.