This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- desktop coordinate related functions | |
-- by zorg @ 2015-2016 | |
-- license: ISC | |
-- This library implements a somewhat robust method of allowing the usage of desktop mouse coordinates in Löve. | |
-- Main usage would be the implementation of borderless dragging (in windows at least, where it's not possible otherwise) | |
-- This may not yet be perfect, since window dimensions and position and the inner canvas/frame/viewport dimensions and positioning | |
-- may be offset differently by different OS-es, so testing needed still. Also doesn't have that much use on android or ios. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local w,h | |
local quad | |
local time, value | |
local mask_shader | |
function love.load() | |
w,h = love.graphics.getDimensions() | |
time = 0.0 | |
value = math.sin(time) | |
quad = love.graphics.newQuad(0,0,w,h,w,h) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local t = {} | |
local toString = function(t) | |
local original = getmetatable(t) | |
local modified = {}; for k,v in pairs(original) do modified[k] = v end; modified.__tostring = nil | |
setmetatable(t, modified) | |
local address = tostring(t):sub(8) | |
setmetatable(t, original) | |
return string.format("Identifying table:\n%s\nYep, it's a table.", address) | |
end |