Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/NeXTormer/SpaceGamev2
Browse files Browse the repository at this point in the history
  • Loading branch information
NeXTormer committed Jan 19, 2018
2 parents 87ccab3 + 1390977 commit 2df5f78
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
3 changes: 2 additions & 1 deletion android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
<activity
android:name="me.spacegame.AndroidLauncher"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:screenOrientation="sensorLandscape"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.INTERNET"/>

Expand Down
1 change: 1 addition & 0 deletions android/android.iml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes-jar" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
Expand Down
4 changes: 1 addition & 3 deletions android/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">SpaceGamev2.0</string>

<string name="app_name">SpaceGame</string>
</resources>
24 changes: 21 additions & 3 deletions core/src/me/spacegame/screens/MainMenuScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public class MainMenuScreen implements Screen {
private Label usernameLabel;
private Label infoLabel;

private float logoscalex;
private float logoscaley;


private Preferences preferences = Gdx.app.getPreferences("sgusername");


Expand All @@ -72,7 +76,7 @@ public MainMenuScreen(SpaceGame game) {
parameter3.size = (int) Scale.getScaledSizeX(42);

camera = new OrthographicCamera();
camera.setToOrtho(false, 1920, 1080);
camera.setToOrtho(false, Scale.getScaledSizeX(1920), Scale.getScaledSizeY(1080));
batch = new SpriteBatch(4);
game.finishLoadingAssets();
background = game.getTexture("background");
Expand Down Expand Up @@ -120,7 +124,10 @@ public MainMenuScreen(SpaceGame game) {
}

textField = new TextField(username, tfs);
textField.setPosition(Scale.getScaledSizeX(920), Scale.getScaledSizeY(645));

float offset = ((Gdx.graphics.getHeight()/1080.0f) - 1) * 60.0f;

textField.setPosition(Scale.getScaledSizeX(920), Scale.getScaledSizeY(645) + offset);
textField.setSize(600, 100);

textField.setMaxLength(16);
Expand All @@ -135,6 +142,17 @@ public MainMenuScreen(SpaceGame game) {
stage.addActor(textField);

Gdx.input.setInputProcessor(stage);

if(Scale.getScaledSizeX(170 * 11f) > 1870)
{
logoscalex = 1870;
logoscaley = 176;
}
else
{
logoscalex = Scale.getScaledSizeX(170 * 11f);
logoscaley = Scale.getScaledSizeY(16 * 11f);
}
}

@Override
Expand All @@ -159,7 +177,7 @@ public void render(float delta) {
batch.begin();
batch.draw(background, 0, 0);

batch.draw(logo, Scale.getScaledSizeX(100), Scale.getScaledSizeY(800), Scale.getScaledSizeX(170 * 11f), Scale.getScaledSizeY(16 * 11f));
batch.draw(logo, Scale.getScaledSizeX(100), Scale.getScaledSizeY(800), logoscalex, logoscaley);
//batch.draw(logo, 40, 1200);
batch.end();

Expand Down

0 comments on commit 2df5f78

Please sign in to comment.