Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
SpaceBeeGaming

Formula for screen aspect ratios

Question

3 answers to this question

Recommended Posts

  • 0
  • Solution

I gave this a whirl and it proved to be a bit more challenging than I thought it would be, and I'm not really content with it.

It works to a certain degree, works better for some ratios than others and whatnot. I couldn't seem to find an algorithm that would work properly.

https://pastebin.com/Wq60vHuy

I tested with all tier screens and a tier 3 graphics card. It should work with tier 1 and 2 graphics cards as well.
You can run monitor.test() and break/add some screens to see it in action.
If there's any code you're wondering about, feel free to ask ^_^

Edit: It feels like it should be a lot simpler but idk

Edited by Slamakans
Link to post
Share on other sites
  • 0

I'm taking into account the max resolution based on the screens as well, not sure were you think I should use that instead of something else?

The current resolution doesn't matter much since I'm setting the resolution anyways. If you mean that I should use it instead of monitor.getResolutionFromTier, I guess I should've named it getMaxResolutionFromTier cuz that's what it does

 

Forgot to say that monitor.fill() would be what you'd use to fill the screen but maybe you got that

 

Edit: I forgot that gpu.maxResolution() returns the lowest of the two. A bunch of the code can be removed if that is used instead: https://pastebin.com/1jtwLRQA (untested)
Amazing how you never learn not to code when tired af :rolleyes:

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.