Problem with acceptance of displayWidth/displayHeight in iPhone app

Hello everyone,

I hope I did not miss an earlier post with the same question: I ran into a problem trying to use displayWidth/displayHeight within the iPhone app. The code is:

void settings() {
cwh = min(displayWidth,displayHeight);
mainXoff= (displayWidth - cwh)/2;
mainYoff= (displayHeight - cwh)/2;

cwh, mainXoff and mainYoff are all declared as interegs. The latter two are added as offset-values to x/y-coordinates.

I am intending to center a square canvas on a horizontally and vertically screen likewise. This works fine within the developping environment, but meets problems within the iphone processing app. “Reference Error: Can’t find the variable ‘displayWidth’. Suggestion for solution: comment out.”

Would be grateful for any suggestion for a a solution or work-around…!

By any chance, would it be based on the Processing.js (Pjs) library? :thinking:

Thank you very much GoToLoop for the hint into the direction of Processing.js and thereby to Javascript. Infact it showed that ‘window.innerWidth’ and ‘window.innerHeight’ are functional replacements for ‘displayWidth’ and ‘displayHeight’. It works fine now!!

Btw, only later I had realised that the Processing App that I had found in the App Store Germany comes from a third party. Might be that the App Store in other countries offer different Processing Apps though.