function love.load()
require("gutil")
end
function love.mousepressed(x,y)
end
function love.update(dt)
end
function love.draw()
love.graphics.rectangle("fill",gutil.tile(0,0),gutil.tile(1,1)) --test
end
gutil = {}
function gutil.tile(tix,tiy) --max 10
h , w = love.graphics.getDimensions()
hw = h - w
he = hw / 2
ta = w / 11
t = ta * tix
tt = t + he
tn = ta * tiy
return tt , tn
end
function gutil.getScale()
h , w = love.graphics.getDimensions()
ta = w / 11
scale = ta / 16 --EXAMPLE
return scale
end
NO HELP NEEDED
Last edited by Darlex on Wed Aug 08, 2018 10:33 pm, edited 2 times in total.
gutil.tile returns two values, but since it's followed by a comma Lua will only get the first value and discard the second one. You should do something like this:
Nixola wrote: ↑Tue Jul 17, 2018 3:36 pm
gutil.tile returns two values, but since it's followed by a comma Lua will only get the first value and discard the second one. You should do something like this:
Please don't just rename the topic to "closed". Use a descriptive title and add something like "[SOLVED]" at the beginning or end, so people know what it is.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Nixola wrote: ↑Tue Jul 17, 2018 4:31 pm
Please don't just rename the topic to "closed". Use a descriptive title and add something like "[SOLVED]" at the beginning or end, so people know what it is.