Last active
August 29, 2015 14:06
-
-
Save tonetheman/9d47c000337d98346382 to your computer and use it in GitHub Desktop.
tween test
This file contains hidden or 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 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