Skip to content

Instantly share code, notes, and snippets.

View ggcrunchy's full-sized avatar

Steven Johnson ggcrunchy

View GitHub Profile
@ggcrunchy
ggcrunchy / layout.lua
Created January 10, 2015 03:10
A couple of mostly self-contained layout utility modules for Corona SDK
--- Utilities for layout handling.
--
-- These are designed to allow layout decisions and queries, without worrying about the
-- anchor points of the objects in question. In many cases, positions may be substituted
-- for objects, as well.
--
-- With respect to this module, a **Number** may be any of the following:
--
-- * A number, or a string that @{tonumber} is able to convert. These values are used as is.
-- * A string of the form **"AMOUNT%"**, e.g. `"20%"` or `"-4.2%"`, which resolves to the
@ggcrunchy
ggcrunchy / kernel_generator_custom_simplex2.lua
Last active August 29, 2015 14:17
Simplex noise-based shader
--- An example shader that uses simplex noise.
--
-- 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 furnished to do so, subject to
-- the following conditions:
@ggcrunchy
ggcrunchy / kernel_filter_custom_heat.lua
Last active November 19, 2015 21:18
Heat haze example
--- Heat haze shader.
--
-- 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 furnished to do so, subject to
-- the following conditions:
@ggcrunchy
ggcrunchy / main.lua
Last active August 29, 2015 14:24
Glass-filling shader example
--- Shader-based example for filling a glass X percent.
--
-- 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 furnished to do so, subject to
-- the following conditions:
@ggcrunchy
ggcrunchy / Text.png
Last active August 29, 2015 14:24
Wavy text shader example
Text.png
@ggcrunchy
ggcrunchy / Image.jpg
Last active August 29, 2015 14:24
Multi-pass blur shader example
Image.jpg
@ggcrunchy
ggcrunchy / main.lua
Created July 26, 2015 04:53
Demonstrates an issue with removeSelf as a validity test
local widget = require("widget") -- Not used in this Gist, but seems to be necessary
local composer = require("composer")
composer.gotoScene("test_scene")
@ggcrunchy
ggcrunchy / glowy_ball.lua
Last active May 8, 2016 18:31
Glowy noise-based ball, camping it here until I give it a proper home (it's been lingering in a random main.lua)
--
-- 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 furnished to do so, subject to
-- the following conditions:
--
-- The above copyright notice and this permission notice shall be
@ggcrunchy
ggcrunchy / circles.lua
Last active May 8, 2016 18:28
Circumcircle and incircle code + test from article
--
-- 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 furnished to do so, subject to
-- the following conditions:
--
-- The above copyright notice and this permission notice shall be