We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Preventing rescaling in browsers
Page Index Toggle Pages: 1
Preventing rescaling in browsers (Read 1372 times)
Preventing rescaling in browsers
Feb 22nd, 2010, 10:52am
 
Hi,
I did a little sketch with a fixed size(300,400) in the setup() which runs nicecly directly, as application and as applet.
However, when run as applet, the window size scales with the "zoomlevel" of the browser (I am using Explorer) which ruins the applet because "boarder-collisions checks" now result in different particle trajectories.
Now the question: How do I prevent this "scaling" when I export my sketch as an applet?
Re: Preventing rescaling in browsers
Reply #1 - Mar 10th, 2010, 12:52am
 
Excuse me for "pushing" this thread, but I still very much hope that somebody has a solution for my problem?
Re: Preventing rescaling in browsers
Reply #2 - Mar 10th, 2010, 1:50am
 
I have no idea as I never use Internet Explorer, except for some testing.
I am a bit surprised that IE resizes applets with the zoom (although it has some logic), even more that it results in an internal resizing of the applet (I would have thought that IE just increase the pixel size).
A possible solution would be... to ask users not to zoom in the page!
Another solution is to make all the logic to depend on width/height variables, which is always a good idea anyway. Hoping at least that these variables are updated when the applet is resized...
Re: Preventing rescaling in browsers
Reply #3 - Mar 11th, 2010, 3:26am
 
Hmm, thanks.
You can test the "zooming" with my gravity game
( ttp://bejoscha.tavernmaker.de/processing/gravityGame/index.html )

The "out of screen" logic is based on width/height and scales as it should, but the objects are placed by x/y coordinates directly.
Thus "zooming" changes the bouncing-boarder conditions relative the objects which is bad  Angry
Unfortunately, IExplorer REMEMBERS the zoom setting when restarting, so some users are not even aware of the fact, that they are not on default 100% zoom...

But I do not want to blame M$ again. Just tried it with Firefox: same problem. (Start my game and use the mousewheel to zoom with the focus NOT in the applet-window and you see what I mean.
I think there should be a solution within Processing which prevents this rescaling...
Re: Preventing rescaling in browsers
Reply #4 - Mar 11th, 2010, 5:00am
 
Your site is currently not reachable, I will try it later. Or will try on another sketch. It is an interesting problem... Smiley
Page Index Toggle Pages: 1