Code: Select all
local orig_print = love.graphics.print
function love.graphics.print(...)
print("Entered")
orig_print(...)
end
function love.draw()
love.graphics.print("Hello, World!", 10, 10)
end
Code: Select all
local orig_print = love.graphics.print
local function new_print(...)
print("Entered")
orig_print(...)
-- the previous line changes love.graphics.print - change it back
love.graphics.print = new_print
end
love.graphics.print = new_print
function love.draw()
love.graphics.print("Hello, World!", 10, 10)
end