v0.9.4: added main code module support for iOS

This commit is contained in:
Evan Debenham
2021-06-25 15:54:04 -04:00
parent 9b63eb5e09
commit d610383717
6 changed files with 39 additions and 8 deletions

View File

@@ -32,14 +32,25 @@ public class DeviceCompat {
public static boolean supportsFullScreen(){
switch (Gdx.app.getType()){
case Android:
//Android 4.4 KitKat and later, this is for immersive mode
//Android 4.4+ supports hiding UI via immersive mode
return Gdx.app.getVersion() >= 19;
case iOS:
//iOS supports hiding UI via drawing into the gesture safe area
return Gdx.graphics.getSafeInsetBottom() != 0;
default:
//TODO implement functionality for other platforms here
return true;
}
}
public static boolean isAndroid(){
return Gdx.app.getType() == Application.ApplicationType.Android;
}
public static boolean isiOS(){
return Gdx.app.getType() == Application.ApplicationType.iOS;
}
public static boolean isDesktop(){
return Gdx.app.getType() == Application.ApplicationType.Desktop;
}

View File

@@ -21,6 +21,7 @@
package com.watabou.utils;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
public abstract class PlatformSupport {
@@ -39,7 +40,12 @@ public abstract class PlatformSupport {
public static abstract class TextCallback {
public abstract void onSelect( boolean positive, String text );
}
public void vibrate( int millis ){
//regular GDX vibration by default
Gdx.input.vibrate( millis );
}
//TODO should consider spinning this into its own class, rather than platform support getting ever bigger
public abstract void setupFontGenerators(int pageSize, boolean systemFont );