Well actually I think that if you give the console a chance you will find that it is actually quite suited for development in general. It is actually more friendly than not using it.arquivista wrote:kikito sorry to post this here because is a bit off-topic but is a doubt related with your string2Tiles. I know that this could seem so basic... ermm...
well, I was trying to quickly use your example program that use console and prints. I'm on mac and using console to see messages it's not friendly. There is a way of use "print" commands directly in app window without have to transform them all to love.graphics.print and have to put coordinates (instead of "flow" the text as in a console/terminal)?
thanks.
I guess you could use an array of messages to hold 'logs'. Something like this (WARNING: completely untested code)
Code: Select all
-- file log.lua
local font = -- ... load a font here
local fontHeight = font:getHeight()
local messagesPerScreen = math.floor(love.graphics.getHeight() / fontHeight)
local logs = {}
function log(msg)
table.insert(logs, msg)
if #logs > messagesPerScreen then table.remove(logs, 0) end
end
function draw_log()
love.graphics.setFont(font)
love.graphics.setColor(255,255,255)
for i,msg in ipairs(logs) do
love.graphics.print(msg, 0, (i-1)*fontHeight)
end
end
Code: Select all
-- main.lua
require('log.lua')
function love.update(dt)
log('potato')
log('tomato')
end
function love.draw()
draw_log()
end
It could be refined, but seriously, I doubt that would be wise. That effort is best invested in creating your game, while you simply use the console, a wonderful tool for logging.