试图找出如何在Mac匹配的宽高比到Android [英] Trying to figure out how to match aspect ratio on mac to android

查看:194
本文介绍了试图找出如何在Mac匹配的宽高比到Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一个形状匹配的游戏为幼儿。
我画我的Mac上使用GIMP的形状。

I'm making a shape matching game for toddlers. I drew the shapes using gimp on my mac.

里的影像都似乎在Android设备伸出。

The images all seemed stretched out on the android devices.

有一些数学方法我可以计算出多少我都短到Mac电脑上进行图像,使它们看起来正确的Andr​​oid设备?

Is there some mathematical way i could figure out how much shorter I have to make the images on the mac computer so they look correctly on the android devices?

推荐答案

这是一个很难回答的问题。我做了几个应用程序适用于iOS和有pretty多与iPhone和iPad,它们具有不同的纵横比(我怀疑是你所遇到的问题)之间发生的图形时,按键和背景的同样的问题。投掷方向混进去为好。

This is a tough question. I have made several Apps for iOS and have pretty much the same problem with graphics for buttons and backgrounds when going between iPhone and iPad, which have different aspect ratios (which I suspect is the problem you are having). Throw orientation into the mix as well.

我使用的GIMP,Inkscape中,脊柱的Cocos2D-X,和许多其他工具,以供参考(见的这里)。

I use Gimp, Inkscape, Spine, Cocos2d-x, and lots of other tools for reference (see here).

据我所知,不同的屏幕几何问题的常规选项(如果有其他人,让我知道):

As far as I know, the general options for "different screen geometry" issues are (if there are others, let me know):


  1. 不同的图片,每个几何。

  2. 缩放图形比例为几何(我怀疑你有这样的)。

  3. 所有相同的图形,比例缩放基于一维,然后将使用百分比固定填充屏幕上的图形。

选项1意味着额外的工作......一个业余爱好者或独立(像我)开发者不能接受的。
选项​​2平时看起来像垃圾。挫折和悲伤通常随之而来。
方案3是我最常使用的选项。我发现有时我必须添加的微小变化(读:黑客)的设备或几何形状上。在iOS中的情况下,这是不是太糟糕,因为只有两个几何处理。在Android中,那里有很多不同的几何形状的平板电脑的情况下,可以通过与几何形状的范围内工作,并选择一个固定的方向为你的应用剪下来。

Option 1 means extra work...not acceptable for a hobbyist or indie (like me) developer. Option 2 usually looks like junk. Frustration and sadness usually ensue. Option 3 is the option I use most often. I find that occasionally I have to add small changes (read: hacks) based on the device or geometry. In the case of iOS, it is not too bad, because there are only two geometries to deal with. In the case of Android, where there are lots of different tablet geometries, you could cut it down by working with ranges of geometries and picking a fixed orientation for your application.

在这一天结束时,由一个单一的维度(高度或宽度)比例缩放已经得到我的最大收益。

At the end of the day, proportional scaling by a single dimension (height or width) has gotten me the most bang for the buck.

我通常把图形有点大比我需要,所以我只需要缩小。这会消耗更多的内存,但我重新使用了很多,使用精灵表等没有与管理中的每个内存位(其中有一个大的AAA评级的游戏做的),哪些是你可以得到一个明确的权衡走在一个小的独立的应用程序。我并不是鼓励草率或内存管理不善;我鼓励反对简单的发展需要平衡资源......使得相同的图形不同的情况燃烧大量的日光。

I usually make the graphics a little "bigger" than I will need so I only have to scale down. This consumes a bit more memory, but I re-use a lot, use sprite sheets, etc. There is a definite tradeoff with managing every bit of memory (which you have to do in a large AAA rated game) and what you can get away with in a small independent application. I am not encouraging sloppiness or memory mismanagement; I'm encouraging balancing the resources against the developmental needs of simplicity...making the same graphics for different situations burns a lot of daylight.

ONE MORE注:
对于那些我用了一个框架,图形(如游戏)的应用程序,我用了视窗让我满足了显卡的物理......也就是说,动态地扩展图形的基础上有多大的规模总的场景我希望用户看到的。这让我把图形的身体在它的上面,并根据需要静态或动态匹配的大小。的code是C ++和仅松散地系在框架...和概念适用于游戏一般情况下(即,根据需要缩放图形)。你可以找到一些说明和code 这里,如果你有兴趣。

对您有帮助?

这篇关于试图找出如何在Mac匹配的宽高比到Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆