Inaccurate x position of counters on android devices?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hi,

    So because I'm creating an app for android, I need to make sure all of my objects are positioned by code in order for the app to be compatible with every screen size. At the moment, I'm trying to place a counter exactly in the center of my screen. I use:

    Set Y position to VirtualHeight /2
    Set X position to VirtualWidth /2

    The problem with that is, although the Y position worked perfectly, the calculation regarding the X position has placed my counter completely off the X axis. And this placement changes in accordance to screen size. When I run it on Windows, the counter is placed perfectly in the center.

    What's even more odd, is the fact that normal active objects with the same code are placed in the center of the screen in any android device (using emulator). So the counter in this case is the disobeyer.

    I've also tried to positioning the counter in accordance to the visible edge, but I get exactly the same results.

    Any Ideas?

    Thanks.

    Samer.

  • Just created a new project and created a counter, which I positioned in the center using the same code. I exported it for android and tested it on my phone and, what do you know, it's in the center. But I don't see why it wouldn't work in my original project. I'm still trying to figure out what's clashing.

    Samer.

  • Hi roro35bzh,

    Thanks for the useful bit of information!

    Your suggestion makes it easier for me since I had to adjust the x position slightly to make sure the counter is in the exact center. Never thought about adding a 'Counter width/2' calculation or vice versa.

    Thanks for that.

    Samer.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!