I'm wondering why I can't do the following:
Code: Select all
abc[1] = love.graphics.newImage('Button_normal.png')
attempt to index global 'abc' (a nil value)
Code: Select all
abc[1] = love.graphics.newImage('Button_normal.png')
attempt to index global 'abc' (a nil value)
Code: Select all
abc = {}
abc[1] = love.graphics.newImage('Button_normal.png')
Code: Select all
function love.load()
for i=1,#buttons do
button_images[i][1] = love.graphics.newImage(buttons[i][5])
button_images[i][2] = love.graphics.newImage(buttons[i][6])
end
love.graphics.setBackgroundColor(0, 0, 0)
love.mouse.setVisible(true)
end
Code: Select all
function love.load()
button_images = {}
for i=1,#buttons do
button_images[i] = {}
button_images[i][1] = love.graphics.newImage(buttons[i][5])
button_images[i][2] = love.graphics.newImage(buttons[i][6])
end
-- snip
end
Users browsing this forum: Ahrefs [Bot], Altostratus, Google [Bot], Semrush [Bot] and 4 guests