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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
louie999
Prole
Posts: 46
Joined: Fri Mar 06, 2015 9:01 am

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

Post 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? :(

Code: Select all

fun = true
school = true

function isItFun()
    if school then
       fun = false
    end
    if not fun then 
       me:explode()
    end
end
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

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

Post by davisdude »

Try

Code: Select all

tt._TILE_SET_ = love.graphics.newImage( "gfx/tiles/tileset.png" )
;)
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
louie999
Prole
Posts: 46
Joined: Fri Mar 06, 2015 9:01 am

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

Post by louie999 »

OOPS, thanks for pointing that out, I totally forgot about the new image thing. :death:

Code: Select all

fun = true
school = true

function isItFun()
    if school then
       fun = false
    end
    if not fun then 
       me:explode()
    end
end
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests