30
27
local t = Text:new{
33
y = boxT + 10 + (i-1) * lh,
42
y = boxT + 10 + (i-1) * lh,
50
y = boxT + 10 + (i-1) * lh - 1,
51
label = Text:new{ text = 'BUY', x = 1 },
53
local tw, th = b.label:getSize()
54
b.background = Fill:new{
63
y = boxT + 10 + (i-1) * lh - 1,
64
label = Text:new{ text = 'SELL', x = 1 },
66
local tw, th = b.label:getSize()
67
b.background = Fill:new{
33
local tw, th = t:getSize()
34
t.y = boxT + 10 + (i-1) * th -- (th + 2) -- for padding?
77
label = Text:new{ text = 'Close', x = 3, y = 2 },
78
onMouseDown = function()
83
local tw, th = b.label:getSize()
84
b.background = Fill:new{
89
b.x = boxR - b.background.width - 10
90
b.y = boxT + 400 - b.background.height - 10
94
self.playerMoney = Text:new{
95
text = 'Your money: ',
98
y = boxT + 400 - th - 10
100
self:add(self.playerMoney)
102
-- give the buttons a cycle to get out of the T/L corner
105
39
activate = function (self)
106
40
the.cursor.visible = false
110
44
Subview.activate(self)
112
close = function (self)
113
the.cursor.visible = true
114
love.mouse.setVisible(false)
115
love.mouse.setGrab(true)
119
onUpdate = function (self)
120
if the.keys:justPressed('escape') then
124
self.playerMoney.text = 'Your money: ' .. the.player.money
b'\\ No newline at end of file'