I will be moving everything to canvases.
Since you where doing the game menu and such, I think you will probably need some info on this.
Actually, I have implemented a custom draw and print function, and the "print-to-the-camvas" will go in this function, so if you need to print to screen, the custom draw and print function is just as simple as:
lprint(<text>, <x>, <y>) <-- Note: it is LPRINT, not PRINT
and draw:
draw(<image>, <x>, <y>)
Both functions don't take into account the color. You will have to make a "love.graphics.setColor()" before calling the print or draw.
Also, I set the next shortcuts that you probably saw on the sourcecode I sent you, but in case you didn't:
Code: Select all
mouse = love.mouse
rectangle = love.graphics.rectangle
line = love.graphics.line
newImage = love.graphics.newImage
color = love.graphics.setColor
So you may just write "color(255, 255, 0, 255)" instead of all love.graphics.setColor.
Also, about the custom print and draw functions, LPRINT will draw a "" string if you don't pass any text string, and will print to (1,1) coords if you don't provide x or y.
DRAW will do nothing if you don't provide any image, and will draw to (1,1) if no X or Y provided.
Also this last one draws with [nearest,nearrest] filter.
I'm not sure if you got this two functions in the code I sent you, so here you got them both:
(copy paste in main.lua) NOTE: this is without canvases. I'm right now doing it. You may want to wait till I do and test it!!!
Code: Select all
function draw(image, x, y)
if image then
image:setFilter("nearest", "nearest")
love.graphics.draw(image, x or 1, y or 1, 0, screenScale, screenScale)
end
end
function lprint(text, x, y)
love.graphics.print(text or "", x or 1, y or 1)
end