colorSwap - recoloring NES sprites was painful

Share and discuss custom LunaLua code and content packs for SMBX2.

Moderator: Userbase Moderators

Lusho
Tweeter
Tweeter
Posts: 163
Joined: Wed Dec 25, 2019 11:39 pm
Flair: Intention is what matters
Pronouns: he/him

colorSwap - recoloring NES sprites was painful

Postby Lusho » Wed Feb 26, 2025 8:09 pm

This is a small script I wrote to change the color of the outlines on NES sprites, though it works to replace any color with any other
Beware transparency and screen effects of course, Also I don't know how well this will work on multiplayer.

Preview (Flashy Colors Warning?):
Spoiler: show
Image
Image

How to use:
Spoiler: show
on a luna.lua file, put this line:

Code: Select all

local colorSwap = require("scripts/colorSwap")
Then you have these two functions to use, you call them from the function onCameraDraw(camIdx):

Code: Select all

-- To replace a color use:
colorSwap.replaceColor(camIdx, priority, replacedColor, replacingColor)

-- This one is similar, but you provide a table of the color for each section, so it changes automatically.
-- You also provide a default color incase the color of the section isn't found.
colorSwap.replaceColorFromSection(camIdx, priority, replacedColor, replacingColorTable, defaultColor)

Download:
https://drive.google.com/file/d/1JX74P0 ... sp=sharing
(found issue with multiplayer, so I uploaded the hopefully fixed script now)

Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari