Page 1 of 1

'attempt to call method 'getDimensions' (a nil value)'

Posted: Fri Aug 21, 2015 3:07 pm
by louie999
I don't know why it always gives me that error, here's the part of my code where the error happens:

Code: Select all

wazmb.__TILE = {}

local tt = wazmb.__TILE

tt._TILE_SET_ = "gfx/tiles/tileset.png"
tt._TILESIZE = 32
tt.TILESETW, tt.TILESETH = tt._TILE_SET_:getDimensions()
I really have no idea why that happens, could someone please shed some light on why I get that error? :(

Re: 'attempt to call method 'getDimensions' (a nil value)'

Posted: Fri Aug 21, 2015 3:28 pm
by davisdude
Try

Code: Select all

tt._TILE_SET_ = love.graphics.newImage( "gfx/tiles/tileset.png" )
;)

Re: 'attempt to call method 'getDimensions' (a nil value)'

Posted: Sat Aug 22, 2015 9:08 am
by louie999
OOPS, thanks for pointing that out, I totally forgot about the new image thing. :death: