简体   繁体   中英

How can I scale multiple windows with fixed aspect ratio so that they cover maximum of monitor without overlapping

My question is in my title. I am trying to develop a logic so that I can scale fixed aspect ratio windows to cover most of the screen without overlapping eachother. There could be two three or four windows. There could be an alignment parameter also.

You my friend will want to start reading this

Optimal Layout Algorithm

this is a common problem in 2d game development ... think about the problem of how to pack sprites onto a sprite sheet. IE it well understood in 2d especvially seeing a you are dealing with rectangles. I am assuming that they are fixed aspect ratio and different sizes or else its simple maths. If i am wrong just shout and i will give you an algorithm.

There is another question on here about the

I don't want to go on and on because that link will lead you to where you want to be ...

this shuold be interesting http://primes.utm.edu/glossary/xpage/SieveOfEratosthenes.html

there was a good question bout the sieve ... well worth a read also Help speed up this algorithm? Sieve of Eratosthenes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM