English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 19 May 2024, 12:44   #1
asrael
Registered User
 
Join Date: Apr 2017
Location: Germany
Posts: 31
Wrong aspect ratio for Circle[f]?

Hello.

Sorry, maybe a trivial question.

I'm drawing some Circles on a Lo and Hires screen.
On Lores it seems like it's almost a circle with correct aspect ratio.
But on Hires it seems to be more off.
So I suppose Circle doesn't calculate the right aspect ratio on its own depending on the screen.
Do I have to do it? How?


Cheers
asrael is offline  
Old 19 May 2024, 21:40   #2
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,374
Yes, that's correct. The Circle command assumes a 1:1 pixel aspect, so drawing a 20px radius circle will result in a circle 40px wide and 40px tall on the bitmap. A bitmap knows nothing about the aspect ratio of the current screenmode, since it's an independent object by itself so you have to calculate that yourself. If you haven't opened the screen yourself, you can query the size of it using ScreenWidth and ScreenHeight.

Handling it is relatively easy though: once you know the current screen dimensions you can check if it's roughly a 1:2 (hires) or a 1:1 (lores) screen. If it's a lores screen, just draw the circle with the desired radius:

Circle xpos, ypos, 20, #pen

If it's a hires screen, use the extra parameter to set separate radii for the X and Y axes, with the X radius twice the Y radius:

Circle xpos, ypos, 40, 20, #pen
Daedalus is offline  
Old 19 May 2024, 22:51   #3
asrael
Registered User
 
Join Date: Apr 2017
Location: Germany
Posts: 31
OK, cool, thanks.

So is the radio something like: ScreenWidth / ScreenHeight * radius ?
asrael is offline  
Old 20 May 2024, 02:13   #4
nocash
Registered User
 
Join Date: Feb 2016
Location: Homeless
Posts: 64
No, not exactly.
The radio is for audio broadcasts.
The ratio is ScreenWidth / ScreenHeight, not including the radius.
nocash is offline  
Old 20 May 2024, 10:48   #5
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,374
I see what you're getting at, and the second radius will be something like that, yes. But I would suggest doing it differently because slight variations in screen size will cause slight variations in your circle. And with such low resolutions, often it looks better to have symmetry than perfect X:Y ratios. So I would check if the width of the screen was more than 2* the height, and then make the X radius 2* the Y radius. If the width of the screen is less than 2* the height I would make the X and Y radius the same.
Daedalus is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aspect ratio - why circle is not circle? rotacak support.WinUAE 10 16 February 2019 22:46
Aspect ratio wrong? Leandro Jardim support.WinUAE 2 24 September 2013 10:13
Wrong aspect ratio Leandro Jardim support.WinUAE 5 24 September 2013 04:41
Always blurry chars - wrong aspect ratio? 1988 support.WinUAE 26 07 July 2011 16:36
iGame screenshot aspect ratio wrong? emuola support.Apps 3 16 September 2010 05:53

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:41.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07173 seconds with 15 queries