Align to sides issue on Android and CocoonJS

0 favourites
From the Asset Store
Build your own spaceship for your side scroller space shooter games with various components.
  • Wink

    I'm using it on Samsung Galaxy S II.

    On it, the squares are not aligned correctly.

    I've attached a image of what I see in a previous post.

    I don't know what to say and what to do.

    BTW, thanks.

  • ghale A lot of people here use a Samsung Galaxy S II for testing. That is a nice high end device so I cant see why that's happening.

    When you are using the CocoonJS launcher what view are you using for this? I am using landscape view I don't know if that would make much of a difference though.

    You could try uninstalling the CocoonJS launcher, and reinstalling it again to see if that helps.

    CocoonJS just recently updated so this could also be a bug. If you cant get it working right you should report it as a possible bug to Ludei.

    Edit:

    Another idea I just had was try removing the Anchor behavior from all the sprites in my example .capx but keep all the other settings the same and see if that makes a difference.

    Second Edit:

    If you would like some help with your game project I would be willing to try, and help you with it. You would have to trust me, and share your .capx though. You can PM it to me if you don't want anyone else to see it.

  • Hello Wink,

    thanks for your help.

    I've tried several ways and I've noticed that on CocoonJS (on Launcher or with a compiled APK) if you call a Layout B from another Layout A and on Layout B you dinamically position elements, the ViewportTop, ViewportBottom, ViewportLeft, ViewportRight at layout start don't report the correct values.

    If you put an element and associate to it a reposition of the elements to the 4 edges of the screen (the same procedure at the start of layout), you can see that the items are correctly positioned.

    So the problem is at start of layout ONLY, after the screen has been painted, all works good.

    I've tried with: Galaxy SII, Nexus 7, Kindle Fire HD.

    I've tried using and not using anchors.

    I've written at Ludei but I've don't received a reply (I think they are at Mobile World Congress right now).

    I've solved painting items after 0.05 seconds (with Trigger Once function) and they are correctly painted on screen. I've beautified all using a fade effect.

    Generally speaking, with CocoonJS on Android if you put something (i.e.) on the center of the screen, the item is not centered but aligned on the left. The same issue I've noticed with AppMobi (now Intel SDK). If I put the same item on the screen AFTER the layout has been loaded and displayed, the item IS CENTERED.

    This is the sample capx I've used.

    When I run it, I see:

    <img src="http://i48.tinypic.com/34fh4sl.png" border="0" />

    After I force the repositioning on the screen clicking the text, I see this:

    <img src="http://i46.tinypic.com/ix8gwh.png" border="0" />

    Here you can download the APK: bit.ly/XmgErZ

    Here you can download the .capx: bit.ly/ZLsfoC

  • What you could do is make the layer invisible for the first second and then let if fade in. Would be a way around the cocoonJS drawing to the different canvas on load.

  • Hello superkew,

    I've done in a similar way, but I've painted the elements on the screen with a fade.

    Can you please give us a capx, please, so I can see how to accomplish this?

  • ghale Hmm, I see what you mean now after trying your APK example I get the same thing. But when I try my example with anchors, and no events I don't have this problem. <img src="smileys/smiley5.gif" border="0" align="middle" />

    This must be a bug in the CocoonJS Cloud compiler. I will also let them know about this possible bug maybe if enough people report it they will prioritize it.

    The funny thing is though I don't get this type of issue with any of my compiled games. Maybe it is just a bug in your account. I really don't know how the back end to the cloud compiler works though.

  • Wink

    Can you try to compile by yourself all starting from the capx?

    So I can know if is related to my account or not.

    I believe that is related to CocoonJS in general, because they have a cloud compiler.

    Can you tell me the result, please, and make public the resulting APK?

    Thanks,

    ghale

  • Sure ghale I was going to try that anyway. But I wont be able to do it until latter today or sometime tomorrow because I have a very busy day planned.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you Wink

  • ghale After making a compile I got the same result as you did so it's not just with your account.

    Here is my compiled apk:

    https://dl.dropbox.com/u/43763487/examples/Alignment_Demo_2013_03_02-03_59_31_debug_signed.apk

  • Hey I just tried your APK and I am getting the same alignment issues on my Kobo Arc. Forcing the alignment does work after having been touched.

  • Hello friend, the fast solution I've tried is to paint things on screen soon after the screen is displayed.

    Yes, it's not a nice solution, but it works on every device I've tested.

    I've added a fade effect so I've beautified it.

    I hope this helps.

  • Hi .. Thanks for this

    Works for me in phonegap.. BUT how will I get get my sprite/image

    for change size when rotate > landscape

    The red corner does it

    REGARDS

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)