[英]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. 这是2D游戏开发中的常见问题。请考虑如何将子图形打包到子图形表的问题。 IE it well understood in 2d especvially seeing a you are dealing with rectangles.
IE在2d中很好地理解,特别是看到您正在处理矩形。 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 这个书应该很有趣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
Eratosthenes筛
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.