Sprite - originalfoo/Prison-Architect-API GitHub Wiki
This page relates to the
.spritebank-related setting.If you were looking for
sprites.png-related setting, see [Sprite(sprites.png)](Sprite (sprites.png)).
##Overview
The Sprite setting is used to define what something will look like on the map (and also in menus, depending on the type of thing being defined).
##Syntax
This setting is optional, but almost always used in materials.txt and must be within a definition block. It can be used only once per definition block.
Sprite <id>
Where <id> is the Name of a sprite defined in the relevant .spritebank file.
##Example
Sprite Janitor
##Notes
The .spritebank format is notoriously troublesome to work with, because you have to duplicate the whole file from the base game in to your mod, and then make the desired changes. This means that only one mod at a time can update the .spritebank (if multiple mods try, only the last one will succeed as it will overwrite the previous one, and so on). It also means that if a new release of the game comes out, with an updated .spritebank, your mod will not incorporate those changes without a manual update from you.
For detailed information, see:
-
.spritebank- the old way of doing things -
sprites.png- the new way, which is better but still has some issues
You can get and set the currently active Sprite index for an object using the .SubType property.
You can get and set the current rotation of your object using the .Or property. This interacts with RotateType sub-setting to choose which part of the Sprite is being rendered.
You can access the slots on your object with the .Slot0..7 properties, their positions on screen are determined by an interaction of Marker and RotateType sub-settings.
##See Also
- [Sprite (sprites.png)](Sprite (sprites.png))
MarkerRotateTypeSpriteVariantsToolbarSprite.Or.slot0..7.SubType