Skip to content

Commit

Permalink
Merge pull request #1 from Yonaba/master
Browse files Browse the repository at this point in the history
Return a local module
  • Loading branch information
sonic2kk committed Aug 13, 2014
2 parents c3a8bf3 + b17c9ea commit 3074070
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions typo.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
typo = {}
local typo = {}

function typo_new(text, delay, width, align, x, y, font, colour)
function typo.new(text, delay, width, align, x, y, font, colour)
local t = {
t = text,
delay = delay,
Expand Down Expand Up @@ -29,7 +29,7 @@ function typo_new(text, delay, width, align, x, y, font, colour)
table.insert(typo, t)
end

function typo_update(dt)
function typo.update(dt)
for i,v in ipairs(typo) do
v.timer = v.timer + dt

Expand All @@ -43,10 +43,12 @@ function typo_update(dt)
end
end

function typo_draw()
function typo.draw()
for i,v in ipairs(typo) do
love.graphics.setColor(v.colour)
love.graphics.setFont(v.font)
love.graphics.printf(v.text, v.x, v.y, v.width, v.align)
end
end
end

return typo

0 comments on commit 3074070

Please sign in to comment.