Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] Stuck trying to figure out problem with SetDisplayAspect()

Author
Message
JonEnstrom
3
Years of Service
User Offline
Joined: 27th Apr 2020
Location:
Posted: 19th Oct 2020 00:11
I am baffled here, I have two snippets of code attached which you can run to reproduce the issue. The only difference between them is line #1 which for all intents and purposes should produce the exact same result, but they don't..





Interestingly even though "1080/1920" and "0.5625" are the same value, when you run the first snippet you get a square display ratio and the particle emitter follows the rectangle edge perfectly (use A and D to rotate it).

Meanwhile the second snippet produces the expected rectangular display ratio but the particle emitter no longer follows the rectangle correctly.

The author of this post has marked a post as an answer.

Go to answer

Heavens
8
Years of Service
User Offline
Joined: 10th May 2015
Location:
Posted: 19th Oct 2020 10:21
This post has been marked by the post author as the answer.
"1080/1920" and "0.5625" is not the same value, when you divide an integer by an integer the result is an integer so the line is being read as SetDisplayAspect(1) that’s why you get the square output.

For the result to be a float then one of the numbers you are dividing must also be a float.

Any of the following get you the correct result:

JonEnstrom
3
Years of Service
User Offline
Joined: 27th Apr 2020
Location:
Posted: 19th Oct 2020 15:58
Well that makes sense thanks!

Login to post a reply

Server time is: 2024-04-26 16:13:40
Your offset time is: 2024-04-26 16:13:40