fix menu bug, integer bitmap coordinates
This commit is contained in:
parent
03e45194cf
commit
e39e772589
47
button.lua
47
button.lua
|
@ -3,7 +3,7 @@ local lg = love.graphics
|
||||||
local t = {
|
local t = {
|
||||||
name = "",
|
name = "",
|
||||||
tooltip = "button",
|
tooltip = "button",
|
||||||
icon = lg.newImage( "icons/eye.bmp" ),
|
icon = false,
|
||||||
x = 8,
|
x = 8,
|
||||||
y = 250,
|
y = 250,
|
||||||
w = 176,
|
w = 176,
|
||||||
|
@ -19,12 +19,35 @@ function t.contains( button, x, y )
|
||||||
and y < button.y + button.h and y > button.y
|
and y < button.y + button.h and y > button.y
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function debugLoop()
|
||||||
|
local i = 0
|
||||||
|
local j = 0
|
||||||
|
local a = t
|
||||||
|
repeat
|
||||||
|
i = i + 1
|
||||||
|
--print( "BUTTON", i, tostring( a ) )
|
||||||
|
a = a.next
|
||||||
|
until a == t or i > 100
|
||||||
|
a = t
|
||||||
|
repeat
|
||||||
|
j = j + 1
|
||||||
|
--print( "BUTTON", i, tostring( a ) )
|
||||||
|
a = a.prev
|
||||||
|
until a == t or j > 100
|
||||||
|
print( i, j, "BUTTONS" )
|
||||||
|
end
|
||||||
|
|
||||||
|
local k = 1
|
||||||
function t.new( b )
|
function t.new( b )
|
||||||
b = setmetatable( b or {}, t )
|
b = setmetatable( b or {}, t )
|
||||||
b.next = t
|
b.next = t
|
||||||
t.prev.next = b
|
t.prev.next = b
|
||||||
b.prev = t.prev
|
b.prev = t.prev
|
||||||
t.prev = b
|
t.prev = b
|
||||||
|
--nonsense
|
||||||
|
k = k + 1
|
||||||
|
print( "ADD BUTTON", k, tostring( b ) )
|
||||||
|
debugLoop()
|
||||||
return b
|
return b
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -38,12 +61,14 @@ function t.draw( b )
|
||||||
lg.printf( b.name,
|
lg.printf( b.name,
|
||||||
b.x,
|
b.x,
|
||||||
b.y + 0.5 * ( b.h- lg.getFont():getHeight() ),
|
b.y + 0.5 * ( b.h- lg.getFont():getHeight() ),
|
||||||
b.w - 5,
|
b.w,
|
||||||
"right" )
|
"center" )
|
||||||
if b.icon then lg.draw( b.icon,
|
if b.icon then
|
||||||
b.x, b.y + 0.5 * (b.h - b.icon:getHeight()),
|
local h = b.icon:getHeight()
|
||||||
|
lg.draw( b.icon,
|
||||||
|
b.x, b.y,
|
||||||
0,
|
0,
|
||||||
0.5, 0.5 )
|
b.h / h )
|
||||||
end
|
end
|
||||||
if t.selected == b then
|
if t.selected == b then
|
||||||
lg.rectangle( "fill", b.x, b.y, b.w, b.h, 6 )
|
lg.rectangle( "fill", b.x, b.y, b.w, b.h, 6 )
|
||||||
|
@ -57,11 +82,11 @@ function t.select( b )
|
||||||
end
|
end
|
||||||
|
|
||||||
function t.selectNext()
|
function t.selectNext()
|
||||||
repeat t.selected = t.selected.next until t.selected.visible
|
repeat t.selected = t.selected.next until (t.selected == t) or t.selected.visible
|
||||||
end
|
end
|
||||||
|
|
||||||
function t.selectPrev()
|
function t.selectPrev()
|
||||||
repeat t.selected = t.selected.prev until t.selected.visible
|
repeat t.selected = t.selected.prev until (t.selected == t) or t.selected.visible
|
||||||
end
|
end
|
||||||
|
|
||||||
function t.selectIn( x, y )
|
function t.selectIn( x, y )
|
||||||
|
@ -70,13 +95,15 @@ function t.selectIn( x, y )
|
||||||
end
|
end
|
||||||
|
|
||||||
function t.selectNextInGroup()
|
function t.selectNextInGroup()
|
||||||
local group = t.selected and t.selected.group
|
--make sure our group is visible, otherwise the loop doesn't end
|
||||||
|
local group = t.selected and t.selected.visible and t.selected.group
|
||||||
if not group then return t.selectNext() end
|
if not group then return t.selectNext() end
|
||||||
repeat t.selectNext() until group == t.selected.group
|
repeat t.selectNext() until group == t.selected.group
|
||||||
end
|
end
|
||||||
|
|
||||||
function t.selectPrevInGroup()
|
function t.selectPrevInGroup()
|
||||||
local group = t.selected and t.selected.group
|
--make sure our group is visible, otherwise the loop doesn't end
|
||||||
|
local group = t.selected and t.selected.visible and t.selected.group
|
||||||
if not group then return t.selectPrev() end
|
if not group then return t.selectPrev() end
|
||||||
repeat t.selectPrev() until group == t.selected.group
|
repeat t.selectPrev() until group == t.selected.group
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ local tfTerritory = love.math.newTransform()
|
||||||
local tfNodes = love.math.newTransform()
|
local tfNodes = love.math.newTransform()
|
||||||
local lg = assert( love.graphics )
|
local lg = assert( love.graphics )
|
||||||
local Camera = {
|
local Camera = {
|
||||||
x = 0, y = 0,
|
x = -90, y = 45,
|
||||||
w = 360, h = 200,
|
w = 360, h = 200,
|
||||||
zoom = 1, tf = tf,
|
zoom = 1, tf = tf,
|
||||||
tfTerritory = tfTerritory, tfNodes = tfNodes }
|
tfTerritory = tfTerritory, tfNodes = tfNodes }
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
154
main.lua
154
main.lua
|
@ -1,20 +1,14 @@
|
||||||
local love = assert( love, "This tool requires LOVE: love2d.org" )
|
local love = assert( love, "This tool requires LOVE: love2d.org" )
|
||||||
--assert( require('mobdebug') ).start() --remote debugger
|
--assert( require('mobdebug') ).start() --remote debugger
|
||||||
local map = require 'map'
|
local map = require 'map'
|
||||||
local savemodal = require 'savemodal'
|
|
||||||
local button = require 'button'
|
local button = require 'button'
|
||||||
local SAVEDIRECTORY = "out/"
|
require 'mainmenu'
|
||||||
local Camera = require 'camera'
|
local Camera = require 'camera'
|
||||||
|
|
||||||
function love.load()
|
function love.load()
|
||||||
|
love.filesystem.setIdentity( "dcearth", false )
|
||||||
local lfs = assert( love.filesystem )
|
|
||||||
lfs.setIdentity( "dcearth", false )
|
|
||||||
assert( lfs.createDirectory( SAVEDIRECTORY.."data/earth" ))
|
|
||||||
assert( lfs.createDirectory( SAVEDIRECTORY.."data/graphics" ))
|
|
||||||
|
|
||||||
love.keyboard.setKeyRepeat( true )
|
love.keyboard.setKeyRepeat( true )
|
||||||
love.graphics.setNewFont( 14 )--, "mono" )
|
love.graphics.setNewFont( 14 )
|
||||||
end
|
end
|
||||||
|
|
||||||
function love.directorydropped( path )
|
function love.directorydropped( path )
|
||||||
|
@ -61,7 +55,7 @@ function love.draw()
|
||||||
love.graphics.print(([[
|
love.graphics.print(([[
|
||||||
SCREEN %-12d %-12d
|
SCREEN %-12d %-12d
|
||||||
WORLD %-12.2f%-12.2f
|
WORLD %-12.2f%-12.2f
|
||||||
BITMAP %-12.2f%-12.2f
|
BITMAP %-12d %-12d
|
||||||
%s]]):format(x, y, wx, wy, bx, by, map.editLayer and map.editLayer.filename or ""), 0, 0)
|
%s]]):format(x, y, wx, wy, bx, by, map.editLayer and map.editLayer.filename or ""), 0, 0)
|
||||||
|
|
||||||
if map.selected then love.graphics.print( map.selected:formatDisplayInfo(), 0, 80 ) end
|
if map.selected then love.graphics.print( map.selected:formatDisplayInfo(), 0, 80 ) end
|
||||||
|
@ -84,6 +78,7 @@ function love.mousepressed( x, y, mouseButton, istouch, presses )
|
||||||
|
|
||||||
if button.selected and button.selected:contains( x, y ) then
|
if button.selected and button.selected:contains( x, y ) then
|
||||||
print( ("MOUSE\tx %f\ty %f\twx %f\twy %f"):format(x, y, wx, wy) )
|
print( ("MOUSE\tx %f\ty %f\twx %f\twy %f"):format(x, y, wx, wy) )
|
||||||
|
button.callback( button.selected )
|
||||||
return button.selected:callback()
|
return button.selected:callback()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -117,144 +112,5 @@ end
|
||||||
|
|
||||||
do
|
do
|
||||||
|
|
||||||
local function toolCallback( self )
|
|
||||||
local f = (map.layers[self.layer])[self.name]
|
|
||||||
if f then return f(self) end
|
|
||||||
end
|
|
||||||
|
|
||||||
local tools = {
|
|
||||||
button.new{ name = "SELECT"},
|
|
||||||
button.new{ name = "ERASE",},
|
|
||||||
button.new{ name = "MOVE", },
|
|
||||||
button.new{ name = "ADD", },
|
|
||||||
button.new{ name = "EDIT", },
|
|
||||||
button.new{ name = "DRAW", },
|
|
||||||
}
|
|
||||||
for i, v in ipairs( tools ) do
|
|
||||||
v.callback = toolCallback
|
|
||||||
v.y = 250 + (v.h + 4) * ( i + 1 )
|
|
||||||
v.visible = false
|
|
||||||
end
|
|
||||||
|
|
||||||
local layerButtons = {}
|
|
||||||
|
|
||||||
local layers = {
|
|
||||||
{ name = "AF", layer = "africa" },
|
|
||||||
{ name = "EU", layer = "europe" },
|
|
||||||
{ name = "NA", layer = "northamerica" },
|
|
||||||
{ name = "SA", layer = "southamerica" },
|
|
||||||
{ name = "AS", layer = "southasia" },
|
|
||||||
{ name = "RU", layer = "russia" },
|
|
||||||
{ name = "PATH", layer = "travelnodes" },
|
|
||||||
{ name = "AI", layer = "ainodes" },
|
|
||||||
{ name = "CITY", layer = "cities" },
|
|
||||||
{ name = "COAST", layer = "coastlines" },
|
|
||||||
{ name = "LOW", layer = "coastlinesLow"},
|
|
||||||
{ name = "SAIL", layer = "sailable" },
|
|
||||||
}
|
|
||||||
|
|
||||||
local visibilityIcon = love.graphics.newImage( "icons/eye.bmp" )
|
|
||||||
local function toggleVisibleLayer( self )
|
|
||||||
if not (self and self.layer) then return end
|
|
||||||
local ml = map.layers[ self.layer ]
|
|
||||||
ml.visible = not( ml.visible )
|
|
||||||
self.icon = ml.visible and visibilityIcon
|
|
||||||
end
|
|
||||||
|
|
||||||
local soloIcon = love.graphics.newImage( "icons/eye.bmp" )
|
|
||||||
local function soloVisibleLayer( self )
|
|
||||||
--hide icons for disabled invisible layers
|
|
||||||
print( "===SOLO LAYER===", self.layer )
|
|
||||||
for i, button in ipairs( layerButtons ) do
|
|
||||||
if button.layer ~= self.layer then
|
|
||||||
button.icon = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
self.icon = soloIcon
|
|
||||||
|
|
||||||
for k, layer in pairs( map.layers ) do
|
|
||||||
print( "invisible layer, map:", k, layer)
|
|
||||||
layer.visible = false
|
|
||||||
end
|
|
||||||
map.layers[ self.layer ].visible = true
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
local backButton
|
|
||||||
local function editLayer( self )
|
|
||||||
map.editLayer = map.layers[ self.layer ]
|
|
||||||
for k, button in pairs( layerButtons ) do button.visible = false end
|
|
||||||
for k, button in pairs( tools ) do
|
|
||||||
button.visible = true
|
|
||||||
button.layer = self.layer
|
|
||||||
end
|
|
||||||
backButton.visible = true
|
|
||||||
return soloVisibleLayer( self )
|
|
||||||
end
|
|
||||||
|
|
||||||
local function copy( i, target )
|
|
||||||
for k, v in pairs( layers[i] ) do
|
|
||||||
target[k] = target[k] or v
|
|
||||||
end
|
|
||||||
return target
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local y = 250
|
|
||||||
local soloButtons = {}
|
|
||||||
local showButtons = {}
|
|
||||||
local editButtons = {}
|
|
||||||
for i = 1, #layers do
|
|
||||||
editButtons[i] = button.new( copy( i, {
|
|
||||||
x = 8,
|
|
||||||
y = y + (button.h + 4) * i,
|
|
||||||
w = 112,
|
|
||||||
callback = editLayer,
|
|
||||||
group = "edit",
|
|
||||||
}))
|
|
||||||
layerButtons[ 3 * i - 2 ] = editButtons[i]
|
|
||||||
|
|
||||||
showButtons[i] = button.new( copy( i, {
|
|
||||||
x = 128,
|
|
||||||
y = y + (button.h + 4) * i,
|
|
||||||
w = 24,
|
|
||||||
name = "V",
|
|
||||||
callback = toggleVisibleLayer,
|
|
||||||
icon = visibilityIcon,
|
|
||||||
group = "show",
|
|
||||||
}))
|
|
||||||
layerButtons[ 3 * i - 1 ] = showButtons[i]
|
|
||||||
|
|
||||||
soloButtons[i] = button.new( copy( i, {
|
|
||||||
x = 160,
|
|
||||||
y = y + (button.h + 4) * i,
|
|
||||||
w = 24,
|
|
||||||
name = "S",
|
|
||||||
callback = soloVisibleLayer,
|
|
||||||
icon = soloIcon,
|
|
||||||
group = "solo",
|
|
||||||
}))
|
|
||||||
layerButtons[ 3 * i ] = soloButtons[i]
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function back( self )
|
|
||||||
for k, button in pairs( tools ) do button.visible = false end
|
|
||||||
for k, button in pairs( layerButtons ) do button.visible = true end
|
|
||||||
self.visible = false
|
|
||||||
map.editLayer = false
|
|
||||||
end
|
|
||||||
|
|
||||||
backButton = button.new{
|
|
||||||
name = "UP",
|
|
||||||
visible = false,
|
|
||||||
y = 250 + button.h + 4,
|
|
||||||
icon = love.graphics.newImage( "icons/up.bmp" ),
|
|
||||||
callback = back,
|
|
||||||
}
|
|
||||||
|
|
||||||
button.new{ name = "UNDO", y = 250, callback = map.undo, icon = love.graphics.newImage( "icons/undo.bmp" ) }
|
|
||||||
button.new{ name = "SAVE", y = 222, callback = savemodal.start, icon = false }
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
143
mainmenu.lua
143
mainmenu.lua
|
@ -0,0 +1,143 @@
|
||||||
|
|
||||||
|
local love = assert( love )
|
||||||
|
local button = require 'button'
|
||||||
|
local savemodal = require 'savemodal'
|
||||||
|
local map = require 'map'
|
||||||
|
|
||||||
|
button.new{ name = "SAVE", y = 222, callback = savemodal.start, icon = love.graphics.newImage( "icons/save.png" )}
|
||||||
|
button.new{ name = "UNDO", y = 250, callback = map.undo, icon = love.graphics.newImage( "icons/undo.bmp" ) }
|
||||||
|
|
||||||
|
local tools
|
||||||
|
local layerButtons = {}
|
||||||
|
local function back( self )
|
||||||
|
for k, button in pairs( tools ) do button.visible = false end
|
||||||
|
for k, button in pairs( layerButtons ) do button.visible = true end
|
||||||
|
self.visible = false
|
||||||
|
map.editLayer = false
|
||||||
|
end
|
||||||
|
|
||||||
|
backButton = button.new{
|
||||||
|
name = "UP",
|
||||||
|
visible = false,
|
||||||
|
y = 250 + button.h + 4,
|
||||||
|
icon = love.graphics.newImage( "icons/up.bmp" ),
|
||||||
|
callback = back,
|
||||||
|
}
|
||||||
|
|
||||||
|
local function toolCallback( self )
|
||||||
|
local f = (map.layers[self.layer])[self.name]
|
||||||
|
if f then return f(self) end
|
||||||
|
end
|
||||||
|
|
||||||
|
tools = {
|
||||||
|
button.new{ name = "SELECT"},
|
||||||
|
button.new{ name = "ERASE",},
|
||||||
|
button.new{ name = "MOVE", },
|
||||||
|
button.new{ name = "ADD", },
|
||||||
|
button.new{ name = "EDIT", },
|
||||||
|
button.new{ name = "DRAW", },
|
||||||
|
}
|
||||||
|
for i, v in ipairs( tools ) do
|
||||||
|
v.callback = toolCallback
|
||||||
|
v.y = 250 + (v.h + 4) * ( i + 1 )
|
||||||
|
v.visible = false
|
||||||
|
end
|
||||||
|
|
||||||
|
local layers = {
|
||||||
|
{ name = "AF", layer = "africa" },
|
||||||
|
{ name = "EU", layer = "europe" },
|
||||||
|
{ name = "NA", layer = "northamerica" },
|
||||||
|
{ name = "SA", layer = "southamerica" },
|
||||||
|
{ name = "AS", layer = "southasia" },
|
||||||
|
{ name = "RU", layer = "russia" },
|
||||||
|
{ name = "PATH", layer = "travelnodes" },
|
||||||
|
{ name = "AI", layer = "ainodes" },
|
||||||
|
{ name = "CITY", layer = "cities" },
|
||||||
|
{ name = "COAST", layer = "coastlines" },
|
||||||
|
{ name = "LOW", layer = "coastlinesLow"},
|
||||||
|
{ name = "INT", layer = "international"},
|
||||||
|
{ name = "SAIL", layer = "sailable" },
|
||||||
|
}
|
||||||
|
|
||||||
|
local showButtons = {}
|
||||||
|
local visibilityIcon = love.graphics.newImage( "icons/eye.bmp" )
|
||||||
|
local function updateVisibilityIcons()
|
||||||
|
for i = 1, #showButtons do
|
||||||
|
showButtons[i].icon = map.layers[ showButtons[i].layer ].visible and visibilityIcon
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function toggleVisibleLayer( self )
|
||||||
|
if not (self and self.layer) then return end
|
||||||
|
local ml = map.layers[ self.layer ]
|
||||||
|
ml.visible = not( ml.visible )
|
||||||
|
return updateVisibilityIcons()
|
||||||
|
end
|
||||||
|
|
||||||
|
local soloIcon = false--love.graphics.newImage( "icons/eye.bmp" )
|
||||||
|
local function soloVisibleLayer( self )
|
||||||
|
for k, layer in pairs( map.layers ) do
|
||||||
|
print( "invisible layer, map:", k, layer)
|
||||||
|
layer.visible = false
|
||||||
|
end
|
||||||
|
map.layers[ self.layer ].visible = true
|
||||||
|
return updateVisibilityIcons()
|
||||||
|
end
|
||||||
|
|
||||||
|
local backButton
|
||||||
|
local function editLayer( self )
|
||||||
|
map.editLayer = map.layers[ self.layer ]
|
||||||
|
map.editLayer.visible = true
|
||||||
|
for k, button in pairs( layerButtons ) do button.visible = false end
|
||||||
|
for k, button in pairs( tools ) do
|
||||||
|
button.visible = true
|
||||||
|
button.layer = self.layer
|
||||||
|
end
|
||||||
|
backButton.visible = true
|
||||||
|
print( "EDITING LAYER", self.layer )
|
||||||
|
return updateVisibilityIcons()
|
||||||
|
end
|
||||||
|
|
||||||
|
local function copy( i, target )
|
||||||
|
for k, v in pairs( layers[i] ) do
|
||||||
|
target[k] = target[k] or v
|
||||||
|
end
|
||||||
|
return target
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local y = 250
|
||||||
|
local soloButtons = {}
|
||||||
|
local editButtons = {}
|
||||||
|
for i = 1, #layers do
|
||||||
|
editButtons[i] = button.new( copy( i, {
|
||||||
|
x = 8,
|
||||||
|
y = y + (button.h + 4) * i,
|
||||||
|
w = 112,
|
||||||
|
callback = editLayer,
|
||||||
|
group = "edit",
|
||||||
|
}))
|
||||||
|
layerButtons[ 3 * i - 2 ] = editButtons[i]
|
||||||
|
|
||||||
|
showButtons[i] = button.new( copy( i, {
|
||||||
|
x = 128,
|
||||||
|
y = y + (button.h + 4) * i,
|
||||||
|
w = 24,
|
||||||
|
name = "",
|
||||||
|
callback = toggleVisibleLayer,
|
||||||
|
icon = visibilityIcon,
|
||||||
|
group = "show",
|
||||||
|
}))
|
||||||
|
layerButtons[ 3 * i - 1 ] = showButtons[i]
|
||||||
|
|
||||||
|
soloButtons[i] = button.new( copy( i, {
|
||||||
|
x = 160,
|
||||||
|
y = y + (button.h + 4) * i,
|
||||||
|
w = 24,
|
||||||
|
name = "S",
|
||||||
|
callback = soloVisibleLayer,
|
||||||
|
icon = soloIcon,
|
||||||
|
group = "solo",
|
||||||
|
}))
|
||||||
|
layerButtons[ 3 * i ] = soloButtons[i]
|
||||||
|
end
|
|
@ -34,6 +34,7 @@ function t.stop( self )
|
||||||
|
|
||||||
--restore menus
|
--restore menus
|
||||||
local b = button
|
local b = button
|
||||||
|
button.selected = button
|
||||||
repeat
|
repeat
|
||||||
b = b.next
|
b = b.next
|
||||||
b.visible = t[i][b]
|
b.visible = t[i][b]
|
||||||
|
|
|
@ -5,24 +5,30 @@ local map = require( "map" )
|
||||||
local t = {}
|
local t = {}
|
||||||
|
|
||||||
local saveLocation = map.path
|
local saveLocation = map.path
|
||||||
|
local floppy = love.graphics.newImage( "icons/save.png" )
|
||||||
|
floppy:setFilter( "nearest", "nearest" )
|
||||||
local saveButton = button.new{
|
local saveButton = button.new{
|
||||||
group = "saveModal",
|
group = "saveModal",
|
||||||
name = "save",
|
name = "save",
|
||||||
callback = function() map.save(); return t:stop() end,
|
callback = function() map.save(); return t:stop() end,
|
||||||
visible = false,
|
visible = false,
|
||||||
x = 20,
|
icon = floppy,
|
||||||
y = 20,
|
x = love.graphics.getWidth() / 2 - 200,
|
||||||
|
y = love.graphics.getHeight() / 2 - 150,
|
||||||
w = 400,
|
w = 400,
|
||||||
h = 100,
|
h = 100,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local xIcon = love.graphics.newImage( "icons/x.png" )
|
||||||
|
xIcon:setFilter( "nearest", "nearest" )
|
||||||
local cancelButton = button.new{
|
local cancelButton = button.new{
|
||||||
group = "saveModal",
|
group = "saveModal",
|
||||||
name = "cancel",
|
name = "cancel",
|
||||||
visible = false,
|
visible = false,
|
||||||
|
icon = xIcon,
|
||||||
callback = function() return t:stop() end,
|
callback = function() return t:stop() end,
|
||||||
x = 20,
|
x = love.graphics.getWidth() / 2 - 200,
|
||||||
y = 150,
|
y = love.graphics.getHeight() / 2,
|
||||||
w = 400,
|
w = 400,
|
||||||
h = 100
|
h = 100
|
||||||
}
|
}
|
||||||
|
@ -36,7 +42,7 @@ end
|
||||||
|
|
||||||
function t.draw()
|
function t.draw()
|
||||||
love.graphics.clear( 0,0,0,1 )
|
love.graphics.clear( 0,0,0,1 )
|
||||||
love.graphics.setColor( 1, 1, 1, 0.5 )
|
love.graphics.setColor( 1, 0, 0, 0.4 )
|
||||||
button:draw()
|
button:draw()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue