1
TradeView = Subview:extend {
2
drawParent = true, --default?
3
onNew = function (self)
4
-- create all the interface bits from the planet
5
-- and add them to the view
7
local boxL = the.app.width / 2 - 200
8
local boxT = the.app.height / 2 - 200
9
local boxR = boxL + 400
11
local lh = 17 -- line height
29
for i, good in ipairs(self.planet.goods) do
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{
76
activate = function (self)
77
the.cursor.visible = false
78
love.mouse.setVisible(true)
79
love.mouse.setGrab(false)
81
Subview.activate(self)
b'\\ No newline at end of file'