SMODS.Atlas - Breezebuilder/Steamodded-Wiki GitHub Wiki
SMODS.Atlas
API Documentation: This class allows you to use custom spritesheets ("Atlases") or replace existing ones. Your mod must be located in its own subdirectory of the Mods
folder. Due to Balatro's pixel smoothing setting, it is required to provide both a single and double resolution image file. The file structure should look something like this:
Mods
βββNegateTexturePack
βββ NegateTexturePack.lua
βββ assets
βββ 1x
β βββ BlindChips-negate.png
β βββ Jokers-negate.png
β βββ boosters-negate.png
βββ 2x
βββ BlindChips-negate.png
βββ Jokers-negate.png
βββ boosters-negate.png
- Required parameters:
key
px
: the width of each individual sprite at single resolution, in pixels.py
: the height of each individual sprite at single resolution, in pixels.path
: the image file's name, including the extension (e.g.'Jokers-negate.png'
).- If you want to use different sprites depending on the selected language, you can also provide a table:
path = { ['default'] = 'Jokers.png', -- use this for any languages not specified ['zh_CN'] = 'Jokers-zh-CN.png', ['ja'] = 'Jokers-ja.png', }
- Optional parameters (defaults):
atlas_table = 'ASSET_ATLAS'
- Use
ASSET_ATLAS
for non-animated sprites - Use
ANIMATION_ATLAS
for animated sprites - Use
ASSET_IMAGES
for other images
- Use
frames
: for animated sprites, you must provide the number of frames of the animation. Each row should contain one animation, with each column showing one frame.raw_key
: Set this totrue
to prevent the loader from adding your mod prefix to thekey
. Useful for replacing sprites from the base game or other mods.language
: Restrict your atlas to a specific locale. Useful for introducing localized sprites while leaving other languages intact.disable_mipmap
: Disable mipmap being applied to this texture. Might remove artifacts on smaller textures.
Applying textures to cards
For objects of any class that have a visual representation in-game, you can assign a sprite from your atlas by setting atlas
to the key of your atlas and pos
to the position of the sprite on this atlas ({ x = 0, y = 0 }
refers to the top-left corner). Example:
SMODS.Joker {
key = 'my_joker',
atlas = 'my_atlas',
pos = { x = 1, y = 1 } -- second row, second colum
}