'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 » Fri Aug 21, 2015 3:07 pm

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 » Fri Aug 21, 2015 3:28 pm

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 » Sat Aug 22, 2015 9:08 am

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: slime and 35 guests