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.

Bug Reports / Set Camera Aspect

Author
Message
Dimension
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 16th Dec 2012 03:12 Edited at: 16th Dec 2012 03:13
I noticed that set camera aspect only works for equal or less than 1. Any aspect ratio where the screen height is greater than the screen width it doesn't work.
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 19th Dec 2012 03:22 Edited at: 19th Dec 2012 03:30
The help file states: By default this aspect ratio is calculated by dividing the screen width by the screen height, normally resulting in an aspect ratio of 0.75. What's wrong with this statement? Well if we take the screen resolutions of 640 x 480, 800 x 600 and 1024 x 768 this gives a ratio of 4:3, resulting in an aspect ratio of 1.33333 not 0.75. Therefore for a resolution where the width is greater than the height the aspect ratio should be 1 or greater. If you use this statement to set the aspect ratio.

Set Aspect Ratio Screen Width() / Screen Height()

For a resolution of 640 x 480 you'll get a value of 1 not 1.33333. For a resolution where the height is greater than width, you'll get a value of 0. The problem is setting the aspect ratio to 0. Screen Width() and Screen Height() are returning integers and dividing an integer by a integer is returning a integer. To force the value returned by the above statement to a float value use this statement.

Set Camera Aspect (1.0 * Screen Width()) / Screen Height()
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Dec 2012 17:27
Yes, the Help file has got it the wrong way round - and yes you also need to make sure float division is used in each case.

So, it's not really a bug - just another "bug" in the Help file.
Dimension
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 12th Jan 2013 04:53
I consider anything a bug that is not user friendly (to fail to realize this is failing to be a great programmer). The set camera aspect should except any value and function the way it's meant to, the problem is that DarkBASIC is unorganized. By saying it's not a bug you are implying there is something wrong with the user which is bad for business
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Jan 2013 01:09
Quote: "The set camera aspect should except any value and function the way it's meant to,"


Can you give a working code snippet and a way of testing this so we can check? At the moment it's not clear whether the problem is just your failure to use float division or whether DBPro is actually doing something wrong.

Login to post a reply

Server time is: 2024-04-19 03:43:54
Your offset time is: 2024-04-19 03:43:54