Page 1 of 1

Incorrect ZApplication.MousePosition in Preview

Posted: Sat Oct 25, 2014 10:25 am
by Rado1
In the latest Beta, if an application has set ViewportRatio to the value other than "Full window", e.g. 16:9, and it is running in the ZGE Preview panel, the ZApplication.MousePosition is not set correctly. The offset of the returned position depends also on the size of the Preview panel.

See the attached testing project: run it in a Preview which is wider than taller and has some black side strips. Put the mouse to the middle of the screen marked with small yellow point. The white rectangle, determining the mouse position should also be in the middle, but it is not. Change the Preview size and observe that the position offset changes. Try to run it with F9 and see that it is correct.

(Fix is quite urgent since I cannot continue with planned game development.)

Posted: Sat Oct 25, 2014 12:06 pm
by Kjell
:?

Also, even though ViewportWidth / Height display the correct values when viewing the properties of App, when you access them through a ZExpression they contain the ScreenWidth / Height values instead.

K

Posted: Mon Oct 27, 2014 8:28 am
by VilleK
Beta updated. This happened because I earlier tried to fix the issue where Viewport properties were zero during preview.

Posted: Mon Oct 27, 2014 10:33 am
by Rado1
Tested the latest beta and the fix works. Thanks Ville!