Games50 (pong): attempt to call field 'getPixelScale' (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
wilsonsilva
Prole
Posts: 1
Joined: Wed Dec 26, 2018 2:39 pm

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

Post 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/
User avatar
pgimeno
Party member
Posts: 3548
Joined: Sun Oct 18, 2015 2:58 pm

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

Post 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
FormularSumo
Prole
Posts: 1
Joined: Wed Jun 17, 2020 11:08 am

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

Post by FormularSumo »

Replacing getPixelScale with getDPIScale in push.lua fixes the problem. Or you could replace push.lua with an up-to-date version.
User avatar
zorg
Party member
Posts: 3441
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post 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:
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
mar1zzo
Prole
Posts: 1
Joined: Thu Mar 25, 2021 6:06 pm
Location: Sao Paulo, Brazil
Contact:

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

Post 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:
burakthek
Prole
Posts: 1
Joined: Tue Feb 08, 2022 1:42 pm

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

Post 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)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 50 guests