Skip to content

Instantly share code, notes, and snippets.

@tonetheman
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save tonetheman/9d47c000337d98346382 to your computer and use it in GitHub Desktop.

Select an option

Save tonetheman/9d47c000337d98346382 to your computer and use it in GitHub Desktop.
tween test
local tween = require("tween")
local t={}
local tw = {}
function love.load()
end
function love.draw()
for k,v in pairs(t) do
-- this shows opacity too
love.graphics.setColor(255,0,0,v.op)
love.graphics.print(v.val, v.x, v.y)
end
end
function love.update(dt)
for k,v in pairs(tw) do
v:update(dt)
end
end
function love.mousereleased(x,y,button)
local txt = {x=x,y=y,val="hey",op=255}
table.insert(t, txt)
local tmp = tween.new(3,txt, {x=0,y=0,op=0} )
table.insert(tw, tmp)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment