summaryrefslogtreecommitdiffhomepage
path: root/menu.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-08-25 16:44:13 +0200
committerAki <nthirtyone@gmail.com>2016-08-25 16:44:13 +0200
commitac6d4307fc9f7713b996eb8d36a8d0d3756efc00 (patch)
tree1a08c4d36b0f5538b66301a04b527ea3be11fd1d /menu.lua
parent65e2f701a6c0cfbf53506678771839f7f6d12cbf (diff)
downloadroflnauts-ac6d4307fc9f7713b996eb8d36a8d0d3756efc00.zip
roflnauts-ac6d4307fc9f7713b996eb8d36a8d0d3756efc00.tar.gz
roflnauts-ac6d4307fc9f7713b996eb8d36a8d0d3756efc00.tar.bz2
THIS NEED REAL CLEANUP
Diffstat (limited to 'menu.lua')
-rw-r--r--menu.lua25
1 files changed, 24 insertions, 1 deletions
diff --git a/menu.lua b/menu.lua
index 206c45e..29f5b2a 100644
--- a/menu.lua
+++ b/menu.lua
@@ -9,12 +9,30 @@ Menu = {
scale = getScale(),
elements, --table
active = 1,
- music
+ music,
+ sprite,
+ quads = {
+ button = {
+ normal = love.graphics.newQuad(0, 0, 58,15, 80,130),
+ active = love.graphics.newQuad(0, 0, 58,15, 80,130)
+ },
+ portrait = {
+ normal = love.graphics.newQuad( 0, 15, 32,32, 80,130),
+ active = love.graphics.newQuad(32, 15, 32,32, 80,130)
+ },
+ panorama = {
+ normal = love.graphics.newQuad(0,47, 80,42, 80,130),
+ active = love.graphics.newQuad(0,88, 80,42, 80,130)
+ },
+ arrow_l = love.graphics.newQuad(68, 0, 6, 6, 80,130),
+ arrow_r = love.graphics.newQuad(74, 0, 6, 6, 80,130),
+ }
}
function Menu:new(name)
local o = {}
setmetatable(o, self)
self.__index = self
+ self.sprite = love.graphics.newImage("assets/menu.png")
o.elements = {}
o:load(name)
o.music = Music:new("menu.ogg")
@@ -31,6 +49,11 @@ function Menu:load(name)
self.elements[self.active]:focus()
end
+-- Return reference to quads table and menu sprite
+function Menu:getSheet()
+ return self.sprite, self.quads
+end
+
-- Cycle elements
function Menu:next()
self.elements[self.active]:blur()