Code: Select all
main.lua:7: attempt to perform arithmetic on field 'getWidth' (a function value)
Code: Select all
scale = love.graphics.getWidth / 320
Code: Select all
main.lua:7: attempt to perform arithmetic on field 'getWidth' (a function value)
Code: Select all
scale = love.graphics.getWidth / 320
love.graphics.getWidth is a function. You need to call it to retrieve a value.dawdejw wrote: ↑Mon Jan 29, 2018 3:47 pm So, when i was making a game (well, a program anyway), this lovely message popped up:This, is the line in question:Code: Select all
main.lua:7: attempt to perform arithmetic on field 'getWidth' (a function value)
I don't know, am I dumb or what, but I couldn't find more about this error, so I'm asking - what the heck is wrong with this line? All I want to do is a simple division - to divide window width by 320, and I can't see anything wrong with that line. Also, I don't know should I post .love or not, but I'll include it anyway.Code: Select all
scale = love.graphics.getWidth / 320
Code: Select all
love.graphics.getWidth()
OHH, I see, Thank you very much, I didn't know it makes a diffrence!Ulydev wrote: ↑Mon Jan 29, 2018 3:50 pmlove.graphics.getWidth is a function. You need to call it to retrieve a value.dawdejw wrote: ↑Mon Jan 29, 2018 3:47 pm So, when i was making a game (well, a program anyway), this lovely message popped up:This, is the line in question:Code: Select all
main.lua:7: attempt to perform arithmetic on field 'getWidth' (a function value)
I don't know, am I dumb or what, but I couldn't find more about this error, so I'm asking - what the heck is wrong with this line? All I want to do is a simple division - to divide window width by 320, and I can't see anything wrong with that line. Also, I don't know should I post .love or not, but I'll include it anyway.Code: Select all
scale = love.graphics.getWidth / 320
Code: Select all
love.graphics.getWidth()
Users browsing this forum: Bing [Bot], Google [Bot] and 5 guests