-
Notifications
You must be signed in to change notification settings - Fork 84
SMODS.Atlas
Casimir Eisenach edited this page Jan 22, 2025
·
3 revisions
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.
-
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
}
Game Objects
- API Documentation
- SMODS.Achievement
- SMODS.Atlas
- SMODS.Blind
- SMODS.Center
- SMODS.Challenge
- SMODS.DeckSkin
- SMODS.Keybind
- SMODS.Language
- SMODS.ObjectType
- SMODS.PokerHand
- SMODS.Rarity
- SMODS.Seal
- SMODS.Sound
- SMODS.Stake
- SMODS.Sticker
- SMODS.Suit and SMODS.Rank
- SMODS.Tag
Guides
- Your First Mod
- Mod Metadata
- Calculate Functions
- Logging
- Event Manager
- Localization
- Mod functions
- UI Structure
- Utility Functions
Found an issue, or want to add something? Submit a PR to the Wiki repo.