Align to sides issue on Android and CocoonJS

Get help using Construct 2

Post » Wed Feb 27, 2013 8:43 pm

@ghale I just tested it with the CocoonJS launcher on a Samsung Galaxy S3, and a Nexus 7. Everything looks fine here.

Here is a screen shot taken off of my Samsung Galaxy S3:



What type of device are you testing on, and what OS is it running? CocoonJS doesn't work very well on 2.2 and older.

Maybe I'm not understanding exactly what your trying to accomplish?Wink2013-02-27 20:56:03
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Wed Feb 27, 2013 8:51 pm

@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.
B
10
S
4
G
4
Posts: 42
Reputation: 3,091

Post » Wed Feb 27, 2013 9:04 pm

@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.
Wink2013-02-27 21:23:15
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Thu Feb 28, 2013 1:24 pm

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:


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


Here you can download the APK: http://bit.ly/XmgErZ
Here you can download the .capx: http://bit.ly/ZLsfoCghale2013-02-28 13:48:40
B
10
S
4
G
4
Posts: 42
Reputation: 3,091

Post » Thu Feb 28, 2013 2:19 pm

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.
B
22
S
7
G
3
Posts: 189
Reputation: 4,270

Post » Thu Feb 28, 2013 2:22 pm

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?
B
10
S
4
G
4
Posts: 42
Reputation: 3,091

Post » Fri Mar 01, 2013 10:06 am

@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.

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.
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Fri Mar 01, 2013 10:21 am

@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
B
10
S
4
G
4
Posts: 42
Reputation: 3,091

Post » Fri Mar 01, 2013 10:53 am

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.
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Fri Mar 01, 2013 11:44 am

Thank you @Wink
B
10
S
4
G
4
Posts: 42
Reputation: 3,091

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 15 guests