12local function
color(c)
13 local DIV = love.wiimote and 1 or 255
14 local R = bit.band(bit.rshift(c, 24), 0xFF)/DIV
15 local G = bit.band(bit.rshift(c, 16), 0xFF)/DIV
16 local B = bit.band(bit.rshift(c, 8), 0xFF)/DIV
17 local A = bit.band(bit.rshift(c, 0), 0xFF)/DIV
18 love.graphics.setColor(R, G, B, A)
21local function
rect(a,b,c,d,e,f)
22 love.graphics.rectangle(modes[love.wiimote ~= nil][a], b, c, d, e)
27 if love.wiimote then
return 32 end
28 local
font = love.graphics.getFont()
29 local t =
text and tostring(
text) or tostring(x)
30 local n = select(2, t:gsub(
'\n',
'')) + 1
31 local w =
font:getWidth(t)
32 local h = (
font:getHeight(
'A') * n) + (
font:getLineHeight() * n)
34 love.graphics.print(t, x, y)
39local function
line(x1, y1, x2, y2)
40 love.graphics.line(x1, y1, x2, y2)
43local function triangle(mode, x1, y1, x2, y2, x3, y3)
44 love.graphics.line(x1, y1, x2, y2)
45 love.graphics.line(x2, y2, x3, y3)
47 love.graphics.line(x1, y1, x3, y3)
51local function
font(name, size)
52 if type(name) ==
'number' and not size then
56 local index =
'font_'..tostring(name)..tostring(size)
58 _G[index] = love.graphics.newFont(size)
60 love.graphics.setFont(_G[index])
74 love.graphics.rectangle(modes[love.wiimote ~= nil][0], 0, 0,
game.width,
game.height)
77 local event_draw = function()
82 event={
draw=event_draw},
local function draw(std, game)
local function install(std, lgame, application, ginga)
local function line(x1, y1, x2, y2)
local function font(name, size)
local function rect(mode, x, y, width, height)
local function text(x, y, text)