Torque2D on Patreon

2D version of the Torque engine.

Moderator: marauder2k9

  • 1
  • 3
  • 4
  • 5
  • 6
  • 7
63 posts Page 7 of 7
marauder2k9
Posts: 318
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Sat Sep 14, 2019 11:43 am
And the game is up on the play store!!
https://play.google.com/store/apps/deta ... ritterbits
marauder2k9
Posts: 318
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Sat Sep 14, 2019 9:30 pm
Multitouch fixed on android and audio fixed on android been a busy week :D
marauder2k9
Posts: 318
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Sun Sep 15, 2019 2:20 pm
now added a way to find out if the device the user is using is a tablet or a phone when running on iOS or Android devices.

simply call from script
if($deviceType $= "tablet") 
{
 //do something different for tablets
}
this value can also check if device is phone. If you are working a cross device game you can now set your camera to scale appropriately and all artwork providing they are 1:1 at multiples of 4 should rescale properly to a different camera size. For example on my app i have the phone to be a camera size of 90,160 (reverse due to portrait) but for tablets i have it set to 180,320. This way all artwork ends up looking about the right size for the screen.

Also for anyone working on iOS and you are getting black bars at the top and bottom of the screen, you have to create a launch screen.storyboard and set it to launch as your targets App Icons and Launch images Launch Screen File. This then resets UIScreen mainScreen to be the correct size.

And lastly if you are getting a weird offset in touches on iOS it is because of this code here:
S32 _iOSGetPortraitTouchoffset()
{
// NOTE: This needs to be changed to acount for different retina sizes, but I am not sure what is going on with it yet
    S32 offset = 0;
    
    S32 deviceType = Con::getIntVariable("$pref::iOS::DeviceType");
    
    bool retinaEnabled = Con::getBoolVariable("$pref::iOS::RetinaEnabled");
    
    if (deviceType == 2)
        offset = 500;
    else if (deviceType == 1)
        offset = retinaEnabled ? 500 : 250;
    else
        offset = retinaEnabled ? 320 : 160;
    
    return offset;
}
due to ios apps now only being released to iOS 7+ devices this offset is irrelevant but you cannot remove it completely or it will break touches after a few. so just comment everything out apart from S32 offset = 0; and the touches should then be accurate
  • 1
  • 3
  • 4
  • 5
  • 6
  • 7
63 posts Page 7 of 7

Who is online

Users browsing this forum: No registered users and 1 guest