Added new SFX, dashing, made generation FPS-independent
This commit is contained in:
@@ -13,19 +13,20 @@ import android.util.DisplayMetrics;
|
||||
import io.anuke.mindustry.io.Formatter;
|
||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||
|
||||
public class AndroidLauncher extends AndroidApplication {
|
||||
|
||||
public class AndroidLauncher extends AndroidApplication{
|
||||
boolean doubleScaleTablets = false;
|
||||
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
@Override
|
||||
protected void onCreate (Bundle savedInstanceState) {
|
||||
protected void onCreate(Bundle savedInstanceState){
|
||||
super.onCreate(savedInstanceState);
|
||||
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
|
||||
config.useImmersiveMode = true;
|
||||
|
||||
|
||||
Mindustry.formatter = new Formatter(){
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm");
|
||||
|
||||
|
||||
@Override
|
||||
public String format(Date date){
|
||||
return format.format(date);
|
||||
@@ -36,23 +37,25 @@ public class AndroidLauncher extends AndroidApplication {
|
||||
return NumberFormat.getIntegerInstance().format(number);
|
||||
}
|
||||
};
|
||||
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
|
||||
float yInches= metrics.heightPixels/metrics.ydpi;
|
||||
float xInches= metrics.widthPixels/metrics.xdpi;
|
||||
double diagonalInches = Math.sqrt(xInches*xInches + yInches*yInches);
|
||||
if (diagonalInches>=6.5){
|
||||
// 6.5inch device or bigger
|
||||
Unit.dp.multiplier = 2f;
|
||||
}else{
|
||||
// smaller device
|
||||
Unit.dp.multiplier = 1f;
|
||||
if(doubleScaleTablets){
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
|
||||
float yInches = metrics.heightPixels / metrics.ydpi;
|
||||
float xInches = metrics.widthPixels / metrics.xdpi;
|
||||
double diagonalInches = Math.sqrt(xInches * xInches + yInches * yInches);
|
||||
if(diagonalInches >= 6.5){
|
||||
// 6.5inch device or bigger
|
||||
Unit.dp.multiplier = 2f;
|
||||
}else{
|
||||
// smaller device
|
||||
Unit.dp.multiplier = 1f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Mindustry.args.add("-debug");
|
||||
|
||||
|
||||
initialize(new Mindustry(), config);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user