Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Automatic Scaling Question — Gideros Forum

Automatic Scaling Question

moopfmoopf Guru
edited February 2012 in General questions
Hi,

Playing with Gideros for the first time today. After the frustrating experience of installing Eclipse and all the Android stuff (mainly in just making sure I was downloading the right versions of everything so it all played nicely together) I've got the players installed on my devices (that's a nice feature, I like that a lot - makes it so much quicker to test on a device).

Anyway, rambling :) So my question is on automatic scaling. In the properties for a project you can set the logical dimensions and scale mode. But, here's what I'm finding from my first tests:

1. On an iPhone, everything is good as I'm using 320 x 480 for the logical dimensions.
2. On the Acer A100 I have (7" tablet, 1024 x 600) scaling pixel perfect won't scale above 320 x 480 at all. Scaling letterbox gives good results.
3. On the iPad. It's not a nice scaling ratio to the iPhone screen. Scaling pixel perfect works well, scaling letterbox gives a fuzzy output due to the scaling amount.

I had the same problem whilst testing a competitor product but, in the configuration file there (which was a Lua file) it was possible to detect the device and alter the logical dimensions. For the iPad I changed the logical dimensions to 384 x 512 which then gave me 2x scaling, retaining a pixel perfect scale even when using letterbox. I could then alter layouts to accommodate the extra space.

So, is there any method for me to override the logical dimensions for different devices or the scaling amount? Obviously dealing with both platforms, I really need to find the best option for giving good results on all the main devices.

Any advice welcome :) If I've missed something, do tell me - there's a lot of documentation and forum posts to go through.

Cheers,

Gareth

Dislikes: johnyc100

+1 -1 (+0 / -1 )Share on Facebook

Comments

  • atilimatilim Maintainer
    Hi Gareth,

    I understand the importance of changing the project settings at runtime according to the device. Currently it's not possible except for some settings (background color and orientation) but we'll add this feature as soon as possible.

    Cheers and thank you

    Likes: chipster123

    +1 -1 (+1 / -0 )Share on Facebook
  • Hi Atilim, thanks for the reply. So for the moment do I have to use a kind of "best fit" whilst developing and hope that the feature makes it in in the next few months or is there some alternative setting of logical dimensions and scaling that will give me what I'm after already (I'm guessing not)?

    I'd hate to put time in developing with Gideros and find that the feature doesn't arrive before I'm ready to release the first project and have to put up with less than sharp imagery due to the scaling amount on the iPad. Gulp!
  • atilimatilim Maintainer
    Hi,

    We're planning to switch to weekly build process so that users can grab the version with new features without waiting. And I'm sure we'll implement this feature within a few months.
  • I'm not sure I got the problem, but couldn't you just scale it at 2x, resulting into two black bars (or in any case 20 pixel for side not counted) that you will manage through code (use a bigger Bg, move layout etc)?
    This is usually what I do with Beer, and there's no such a thing as less than sharp imagery :)
  • Hi H4ch1, I didn't think I had control over the scaling amount per device? Am I wrong? I'm not talking about whether I'm using hi-res or lo-res images, I'm talking about the automatic scaling that Gideros does to fit to the device screen.

    Atillim, thanks :)
  • Umh, what I mean is that if you set it so that it scale to ipad while keeping the same aspect ratio, you will not get unsharp art. You will just get 40 pixel empty, 20 from one side and 20 to the other. So if you know that your on ipad, then you can just make up yourself for those 40 pixel more, while keeping the art unaltered, scaled, and with the right, sharper assets loaded.
    If this is not what you're looking for, than I got it wrong d:
  • Which scale mode is this? On letterbox (so there are bars on either side width ways in portrait) it actually scales a little more than 2x on the iPad, 2.13rec which does lead to a little blurring of images. It's definitely not as sharp as it could be.
  • you could use 2.13x images then, or not? Those would be good on iphone 4 too since downscaling of so little shouldn't do art quality any harm (:
    But in RPGplane (universal app I did with Corona) the art was very crisp with letterbox.
  • In Corona you can override the logical dimensions with Lua scripting based on what device it's on, that's my point. I could force 2x on the iPad and deal with the extra space left over how I wanted to. With Corona, if I just let it do it based on the standard 320 x 480 dimensions and scale up I could definitely see fuzziness in the images due to scaling. I'm pretty picky about this, I'll admit :)

    Plus, oversizing assets is never the way to go, especially with mobile texture memory being limited. Whilst 2.13 would be possible, it's an odd one to work with (especially as we're working with what's basically 2.1333333333333 etc. and so I'd be surprised if there weren't some positional issues with assets sized for that) and would lead to larger assets than should be required. Plus I wouldn't want to use 2.13 sized assets on most Android setups either.

    I've just downloaded your RPGplane and I can tell the imagery and fonts are slightly blurred from stretching. I'm sure most wouldn't pick up on it, granted, but that goes back to me bring picky.

    To be honest, Gideros needs the flexibility to accommodate more granular control over scaling options. Atilim seems to recognise this, which is great :)
  • Actually 2.13 wouldn't work would it? The assets would appear oversized on the iPhone 4 which would have a scaling of 2x. Sorry, just thought of that after I replied! So I'd possibly need 2x and 2.13x sized in a universal app, plus 1x if I'm supporting non-retina. That's just not feasible - you're bloating the app.
  • Actually, not. Because you would setScale to the correct size from 2.13 using a proportion 2.13 : 1 = 2 : x . I can see why you would want such a feature, but honestly it wouldn't be a showstopper for me, nor for any of the customers d: But it's good to be picky! Quality comes from it (;
  • setScale I can't find in the API documentation (I can find setScaleX and setScaleY for sprites). Is that what you're referring to? Or are you talking about setScale on something else? Can you setScale on the stage for instance? It's not documented in the API but I think there's a few things missing from there at the moment.
  • atilimatilim Maintainer
    thank you for this great conversation :) It inspire me a lot. *-:)

    @moopf I forgot to tell there is a solution to this problem. There is a discussion here about creating different projects for different platforms: http://www.giderosmobile.com/forum/discussion/449/intro-question-project-structure-vs-file-system-structure#Item_2

    In addition to this, you can also set different settings for different projects. I mean:
    mygame-ios.gproj -> put 1x and 2x, set scale mode as pixel perfect
    mygame-android.gproj -> put 1x and 2x, set scale mode as letterbox

    I know, maintaining two different projects can be harder than a simple if statement. On the other hand, it's more flexible.
  • atilim, yes I was thinking about this earlier. It's certainly an option if I need to go down this route (if timing of my release comes before the support you talked about earlier is available).

    On the topic of iPhone/iPad - I took a look at the Export Project option and it appears you have to pick either iPhone or iPad when exporting a project for compiling in Xcode. Does that mean that Gideros doesn't export a setup for a universal app as an option? I'd expect to see a Universal option in addition to the device families already there otherwise. But then, presumably, I can alter the setup for the xcode project exported - I haven't actually got that far yet, just been using the device Gideros players.
  • atilimatilim Maintainer
    edited February 2012
    With beta8, we have removed .xib files and the resolution constants like 320x480 or 768x1024 from the project. Therefore, it should be really easy to convert it to a universal application.

    Also @pmanna's game is a universal app: http://www.giderosmobile.com/forum/discussion/463/game-is-live-on-the-app-store

    @pmanna if you're reading this, were you using beta8 while converting your project to universal?

    Anyway, we'll also support universal apps soon. :)
  • Ah that's good to know @atilim - converting to universal in xcode isn't a problem. Would definitely be good to have a universal option built in though :)
  • @atilim No, I went for tweaking the Objective-C code & project properties, doing something similar to what you do now: moved to beta8 today (didn't want to risk a screwup just before deployment!)
  • BTW, that's when I discovered how to turn my own app in a Player, under Studio control: I had to test Game Center, and it had to be on device. Unfortunately, Game Center checks your Bundle ID, so the Player itself won't work and I didn't want to modify it just for that: changing that flag allowed me to have everything at hand!
    Will it work this way when you'll be done with a Debugger?
  • atilimatilim Maintainer
    I see :)
    If you mean Lua debugger, the answer is yes. gdr_initialize(...., true) will also turn on Lua debugger.
Sign In or Register to comment.