Page 1 of 1

Games50 (pong): attempt to call field 'getPixelScale' (a nil value)

Posted: Wed Dec 26, 2018 2:55 pm
by wilsonsilva
If you're taking the course Games 50 from edX/Harvard and you're getting the error:

Code: Select all

attempt to call field 'getPixelScale' (a nil value)
It is because you're using love version 0.11 or greater and the method getPixelScale, used by the push library has been renamed to getDPIScale. Please use version 0.10.2. It can be downloaded here: https://bitbucket.org/rude/love/downloads/

Re: Games50 (pong): attempt to call field 'getPixelScale' (a nil value)

Posted: Wed Dec 26, 2018 5:05 pm
by pgimeno
Wouldn't it be better to use a fixed version of push? This is fixed since May.

https://github.com/Ulydev/push/commits/ ... 115b97d+35

Re: Games50 (pong): attempt to call field 'getPixelScale' (a nil value)

Posted: Wed Jun 17, 2020 11:10 am
by FormularSumo
Replacing getPixelScale with getDPIScale in push.lua fixes the problem. Or you could replace push.lua with an up-to-date version.

Re: Games50 (pong): attempt to call field 'getPixelScale' (a nil value)

Posted: Wed Jun 17, 2020 11:22 am
by zorg
FormularSumo wrote: Wed Jun 17, 2020 11:10 am Replacing getPixelScale with getDPIScale in push.lua fixes the problem. Or you could replace push.lua with an up-to-date version.
Great lord Necropost, we thank you for the much needed input, not like it has never been mentioned above. :huh:

Re: Games50 (pong): attempt to call field 'getPixelScale' (a nil value)

Posted: Thu Mar 25, 2021 6:13 pm
by mar1zzo
FormularSumo wrote: Wed Jun 17, 2020 11:10 am Replacing getPixelScale with getDPIScale in push.lua fixes the problem. Or you could replace push.lua with an up-to-date version.
Thanks, FormularSumo! It solved my problem. :ultrahappy:

Re: Games50 (pong): attempt to call field 'getPixelScale' (a nil value)

Posted: Tue Feb 15, 2022 5:03 pm
by burakthek
FormularSumo wrote: Wed Jun 17, 2020 11:10 am Replacing getPixelScale with getDPIScale in push.lua fixes the problem. Or you could replace push.lua with an up-to-date version.
I suggest to replace push library with an updated one because getDPIScale gave me some other problems. So I used this:(https://github.com/Ulydev/push)