Skip to content

Palette Swapper Constructor - #145

Open
Kamsted wants to merge 2 commits into
UltraRing:devfrom
Kamsted:Palette-Swapper-Constructor
Open

Palette Swapper Constructor#145
Kamsted wants to merge 2 commits into
UltraRing:devfrom
Kamsted:Palette-Swapper-Constructor

Conversation

@Kamsted

@Kamsted Kamsted commented Jul 24, 2026

Copy link
Copy Markdown

This PR adds the ability to create Palette Swappers as constructors not unlike the Animators that already exist in the Framework. THIS DOES NOT OVERWRITE THE ABILITY TO SIMPLY USE THE palette_swap function but adds an option to create and use them as constructors for more control over the process. How the Palette Swapper is set-up is not too different than the Animator:

  • The Palette Swappers can have multiple palettes assigned to them like the Animators. You can create a Palette Swapper by using new palette_swapper_create(), and add any number of palettes with palette_add() and giving them unique IDs.

    • You can set a palette's speed, starting index, and looping index while adding it. You can also get/set each of these values with their dedicated getters and setters later on.
  • A palette can start playing by using palette_start() and the desired palette's ID.

    • For palettes that update/loop, use the palette_swapper_update() function in any step event to update the index values of your palette. You can also check for a palette's progress by using palette_is_playing() or palette_has_finished().
  • Palettes can now be used by calling palette_swapper_draw() in any Draw event right before whatever needs to be palette swapped is drawn inside the event.

The previous simple palette_swap() function STILL EXISTS and is perfectly usable, but the constructor helps with more complex palette related algorithms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant