-
Notifications
You must be signed in to change notification settings - Fork 129
SMODS.Gradient
Casimir Eisenach edited this page Mar 6, 2025
·
2 revisions
This class helps create colours that change over time between two or more specified endpoint colours. A gradient can be used at any point where a colour is expected.
-
Required parameters:
key
-
colours
: An array of two or more colours for the gradient to interpolate between.- Each element must be provided as an array of four numerical values between 0 and 1, representing the red, green, blue and opacity values. Beside specifying such a table directly, you can also use a colour present in
G.C
(e.g.G.C.RED
) or generate a colour from a hex code (e.g.HEX('ABCDEF')
).
- Each element must be provided as an array of four numerical values between 0 and 1, representing the red, green, blue and opacity values. Beside specifying such a table directly, you can also use a colour present in
-
Optional parameters (defaults):
-
cycle = 10
: Amount of time (in seconds) for the gradient to cycle through all colours. -
interpolation = 'trig'
: Determines how to interpolate between colours.-
'trig'
: Interpolate using a sine wave. -
'linear'
: Interpolate linearly, at a constant rate.
-
-
-
update(self, dt)
- The default implementation of this function fulfills the above specifications. If your use case requires more control than this implementation provides, you can use a modified
update
function to add your functionality.
- The default implementation of this function fulfills the above specifications. If your use case requires more control than this implementation provides, you can use a modified
Game Objects
- API Documentation
- SMODS.Achievement
- SMODS.Atlas
- SMODS.Blind
- SMODS.Center
- SMODS.Challenge
- SMODS.DeckSkin
- SMODS.DrawStep
- SMODS.Gradient
- SMODS.https
- SMODS.Keybind
- SMODS.Language
- SMODS.ObjectType
- SMODS.PokerHand
- SMODS.Rank and SMODS.Suit
- SMODS.Rarity
- SMODS.Seal
- SMODS.Sound
- SMODS.Stake
- SMODS.Sticker
- SMODS.Tag
Guides
- Your First Mod
- Mod Metadata
- Calculate Functions
- Perma-bonuses
- Logging
- Event Manager
- Localization
- Text Styling
- Mod functions
- UI Structure
- Utility Functions
Found an issue, or want to add something? Submit a PR to the Wiki repo.