Would this work? [EASY]
Posted: Thu Oct 02, 2014 4:01 am
Hello! So, I'm new to LOVE2D (just started today), but I have around 2 years in Lua experience. I just wanted to confirm with the love library, this is how I'd create an image and a label saying the message in the region. Also, this would be how I can make the image and printing disappear when the screen is clicked, correct?
Code: Select all
local env = getfenv();
env["$draw"] = true;
env["@updatestatus"] = function(val)
env["$draw"] = val;
end;
function love.load()
env["$logo"] = love.graphics.newImage("military12.png");
end;
function love.draw()
if(env["$draw"] == true) then
love.graphics.print("Welcome to a game created by KOTwarrior", 400, 300);
love.graphics.draw(env["$logo"], 300, 200);
end;
end;
function love.mousepressed(x, y, button)
if(button == "l") then
env["@updatestatus"](false);
end;
end;