Code is really basic so far. Just drawing some lines. Scaling,fontsize and moving across the screen is managed elsewhere (isnt my problem anyway).
Code: Select all
GLS = 0.1
function love.draw()
love.graphics.setColor(255,255,255)
love.graphics.scale( 1.0, 1.0 )
love.graphics.draw(fb,0,0)
end
function love.load()
love.graphics.setBackgroundColor(255, 255, 255)
love.graphics.setMode(600, 600, false, true, 0)
fb = love.graphics.newCanvas( )
fb:setWrap( "clamp", "clamp" )
InitFB()
end
function InitFB()
fb:clear()
love.graphics.setCanvas(fb)
love.graphics.translate( 300+Dx, 300+Dy )
love.graphics.scale( scale, scale )
love.graphics.setColor(0,0,0)
love.graphics.setLineStyle( "rough" )
love.graphics.setLineWidth(0.04)
love.graphics.line(0,0,10000,0)
love.graphics.line(0,0,0,10000)
love.graphics.line(0,0,0,-10000)
love.graphics.line(0,0,-10000,0)
love.graphics.setLineWidth(0.04)
Fontscaler = Fontsize/Fontfactor
for i=1,100 do
--x
love.graphics.line(i,-GLS,i,GLS)
love.graphics.print(i, i, 0.2, 0, Fontscaler , Fontscaler )
love.graphics.line(-i,-GLS,-i,GLS)
love.graphics.print("-"..i, -i, -1, 0, Fontscaler , Fontscaler )
--//x
--y
love.graphics.line(-GLS,i,GLS,i)
love.graphics.line(-GLS,-i,GLS,-i)
love.graphics.print("-"..i, -1, i, 0, Fontscaler , Fontscaler )
love.graphics.print(i, 0.1, -i-0, 0, Fontscaler , Fontscaler )
--//y
end
Arckanum