Skip to content

Instantly share code, notes, and snippets.

@superqix
superqix / pixeloutline.lua
Last active April 5, 2024 10:31
Pixel prefect outline shader in Solar2D
--local object = display.newImage("image.png")
--object.fill.effect = "filter.custom.pixeloutline"
--object.fill.effect.intensity = 0.0 to 10.0 -- how thick is it
--object.fill.effect.r, g, b = 4 to 50 -- color
local kernel = {}
kernel.language = "glsl"
kernel.category = "filter"
@superqix
superqix / spineWrapper.lua
Created March 3, 2021 15:19
Spine Wrapper 0.4 for Esoteric Spine for Solar2d / CoronaSDK
-- Project: Spine Wrapper 0.4
--
-- Date: Mar 20, 2015
-- Updated: Apr 18, 2018
local spine = require "com.spine-corona.spine"
local json = require "json"
--local print = function(...) end -- uncomment me to get rid of prints
local M = {}
@superqix
superqix / glint.lua
Last active February 28, 2021 09:32
Pixel-like coin glint shader for Solar2d
-- pixel-like coin glint
-- USAGE:
-- require ("glint')
--local object = display.newImage("image.png")
--object.fill.effect = "filter.custom.glint"
--object.fill.effect.intensity = 1.0 -- how bright the glint is
--object.fill.effect.size = 0.1 -- how wide the glint is as a percent of the object
@superqix
superqix / multiswap.lua
Last active June 14, 2023 14:24
Swap up to 4 colors in a Solar2D image via shader
-- 4 color pixel swapping
-- USAGE:
-- require ("multiswap')
--local object = display.newImage("image.png")
--object.fill.effect = "filter.custom.multiswap"
--object.fill.effect.keys = {
-- 213/255, 95/255, 96/255, 1,
@superqix
superqix / render.lua
Created August 18, 2020 18:51
Full Screen Frame Buffer attempt for Solar2d via Snapshot
-- Frame Buffer attempt via Snapshot
-- USAGE
-- require("render")
-- This module adds everything from the stage to a
-- "render" snapshot that updates at 60FPS, think of
-- it as a fake "frame buffer"
-- Touches don't work. ContentBounds, localToContent are
@superqix
superqix / sfxr.lua
Created June 25, 2020 01:54
A port of LÖVE's SFXR library to Solar2D for generated sound effects
-- sfxr.lua
-- original by Tomas Pettersson, ported to Lua by nucular
-- ported to Solar2D by ponywolf
--[[
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is