-
Notifications
You must be signed in to change notification settings - Fork 192
SMODS.DynaTextEffect
N edited this page Mar 24, 2026
·
2 revisions
This class is used to add effects to text descriptions and other DynaText objects
-
Required parameters:
key
-
Optional parameters:
-
prefix_config, dependencies(reference)
-
-
func(dynatext, index, letter)- Used to modify each letter, where
indexis the position of the letter in the string anddynatextis the DynaText object
- Used to modify each letter, where
-
draw_letter(dynatext, index, letter)- Runs when the letter is being drawn to the screen, where
indexis the position of the letter in the string anddynatextis the DynaText object
- Runs when the letter is being drawn to the screen, where
-
draw_shadow(dynatext, index, letter)- Runs when the letter's shadow is being drawn to the screen, where
indexis the position of the letter in the string anddynatextis the DynaText object
- Runs when the letter's shadow is being drawn to the screen, where
-
draw_override(dynatext)- Replaces the
drawfunction of thedynatextobject entirely
- Replaces the
Each DynaText letter is a table that has the following properties
-
letter(love.graphics.Text) - A replaceable text object that will get drawn -
char(string) - The string character this letter represents -
pop_in(number) - Determines how the letter gradually pops in -
r(number) - Rotation of the letter in radians, defaults to 0 -
scale(number) - Scale of the letter with the normal size being 1 -
dims({x: integer, y: integer}) - A table with x and y as letter's dimension. in this case it does NOT modify the size that it is drawn. it instead modifies how far apart each letter are -
offset({x: integer, y: integer}) - A table with x and y to specify the letter's offset from the main dynatext alignment -
colour(table) - The letter's colour. Ignored ifprefixorsuffixare set -
prefix(table) - The letter's colour if it's part of the DynaText'sprefix. -
suffix(table) - The letter's colour if it's part of the DynaText'ssuffix. Ignored ifprefixis set
For your effect to show up in game, you can assign it to formatted text using the style modifier code E: Example:
-- Effect code
-- Rotates letters a different amount based on position
SMODS.DynaTextEffect {
key = "rotating",
func = function (self, index, letter)
letter.r = math.sin((G.TIMERS.REAL + index)*1.9443) * math.pi / 7
end
}-- In your localization file:
j_modprefix_example = {
name = "{E:modprefix_rotating}Example",
text = {
{
"{C:chips,E:modprefix_rotating}+#1#{} Chips",
},
},
},Game Objects
- API Documentation
- SMODS.Achievement
- SMODS.Atlas
- SMODS.Attribute
- SMODS.Blind
- SMODS.CanvasSprite
- SMODS.Center
- SMODS.Challenge
- SMODS.DeckSkin
- SMODS.DrawStep
- SMODS.DynaTextEffect
- SMODS.Font
- SMODS.Gradient
- SMODS.https
- SMODS.JimboQuip
- SMODS.Keybind
- SMODS.Language
- SMODS.ObjectType and SMODS.ConsumableType
- SMODS.PokerHand
- SMODS.Rank and SMODS.Suit
- SMODS.Rarity
- SMODS.Scoring_Parameter and SMODS.Scoring_Calculation
- SMODS.Seal
- SMODS.Shader and SMODS.ScreenShader
- SMODS.Sound
- SMODS.Stake
- SMODS.Sticker
- SMODS.Tag
Guides
- Your First Mod
- Mod Metadata
- The Mod Object
- Calculate Functions
- Perma-bonuses
- Object Weights
- Logging
- Event Manager
- Localization
- Text Styling
- UI Structure
- Utility Functions
- All About
G - Internal Documentation
Release Notes
Found an issue, or want to add something? Submit a PR to the Wiki repo.