Center object Android device works but not when test on PC?

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.
  • Hello so I centre an object in my game using the Android object and I'm using “Fit inside and adjust Window Size”:

    Set X position to ScreenWidth( "Android object" )/2

    This works great on all Android devices, but when I'm testing on my PC and build and run, this method of centering doesn't work I guess because it's doing it relative to my PC screen size?
    Is there a different method I should be using just so I don;t have to build onto my Android device each time?

  • In the special object you have the condition Runtime -> is running as -> android|windows|mac|ios etc.
    That way you can use specific code for the windows runtime and another one for the android runtime without having to use different builds.
    For example :

    is running as android application
    -> Set X position to ScreenWidth( "Android object" )/2
    is running as windows application
    -> Set X position to ScreenXSize( "Window Control" )/2 (using the Window control object)

    Edited 2 times, last by Brovic (August 4, 2019 at 12:16 AM).

Participate now!

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