Code: Select all
local function printlocals()
local n = 1
while true do
local name, value = debug.getlocal(2,n)
if not name then break end
print(name, value)
n = n + 1
end
end
do
g = 1
local l = 2
printlocals()
end
Code: Select all
local function printlocals()
local n = 1
while true do
local name, value = debug.getlocal(2,n)
if not name then break end
print(name, value)
n = n + 1
end
end
do
g = 1
local l = 2
printlocals()
end
something like:dubem wrote:Hey gang!
Is it possible to loop through a matrix one step every update?
like:
update 1: matrix[1][1]
update 2: matrix[1][2]
update 3: matrix[2][1] and so forth
Have a nice day!
-- Alex
Code: Select all
local i = 1
local j = 0
local matrix = {{1,1,2,3,2,3,1,1,3,2},{1,2,2,2,3,1,4,1,1,1,2,3,2},{1,1,2,3,4,1,1,1,1,1,2},{1,1,1,2,2,3,1,3,1,3,2}}
function love.update (dt)
j = j + 1
if j > #matrix[i] then j,i = 1, i+1 end
print("update: "..matrix[i][j])
end
Well you should make an issue for that, since I dont know what you have and what you are missing, try creating an issue in the Support and Development forum and attach your code using [ code ] [ / code ] tags or preferably an attachment with your .love file so that we can easily find your issue.dubem wrote:Thanks man!
Another question: I want to know when/where an object goes over the window borders. Without a camera it is easy. But what how do I know with moving camera?
I suggest you to use Kikito's Gamera as your camera. If you use it then use toScreen method to know the object position in the camera.dubem wrote:Another question: I want to know when/where an object goes over the window borders. Without a camera it is easy. But what how do I know with moving camera?
Code: Select all
local x, y = gamera:toScreen(object.x, object.y)
if (not ((x >= 0 and x <= love.window.getWidth()) and (y >= 0 and y <= love.window.getHeight()))) then
-- do your stuff if the object goes over the window borders
end
Does setting [wiki]love.graphics.setDefaultFilter[/wiki] not work?Whatthefuck wrote:Is there a way to have a spritebatch use nearest filtering instead of linear? Setting the filter mode to nearest on the texture I wish to use on the spritebatch doesn't seem to work. (ie still uses linear)
Users browsing this forum: No registered users and 4 guests