love.graphics.newImage
Posted: Mon Apr 25, 2011 12:44 am
Can I get a little help? No matter what I do with my code I'm told my image file doesn't exist.
main.lua
tile.lua
This is the line that is causing the problems.
Here's the error message.
Here's a picture of my folder so you can see the files.
Uploaded with ImageShack.us
main.lua
Code: Select all
function love.load()
require("tile")
map =
{
width = 120,
height = 240,
x = 0,
y = 0,
layout = map_generate(layout)
}
tilesetBatch = love.graphics.newSpriteBatch(tileset.set, (tileset.Width / tileset.QuadWidth), (tileset.Height / tileset.QuadHeight))
end
function love.draw()
require("blit")
end
Code: Select all
tileset =
{
set = love.graphics.newImage("tileset.png"), --Tileset to be used
QuadWidth = 8, --The width of a blit piece
QuadHeight = 16, --The height of a blit piece
Width = 128, --The width of the tileset
Height = 256, --The height of the tileset
}
Code: Select all
set = love.graphics.newImage("tileset.png"), --Tileset to be used
Code: Select all
Error
Could not open file tileset.png. Does not exist.
Traceback
[C]: ?
[C]: in function 'newImage'
.\tile.lua:3 in main chunk
[C]: in function 'require'
main.lua:2: in function 'load'
[C]: in function 'xpcall'
Uploaded with ImageShack.us