diff --git a/rop-game-android/AndroidManifest.xml b/rop-game-android/AndroidManifest.xml index ad4b976..141d937 100644 --- a/rop-game-android/AndroidManifest.xml +++ b/rop-game-android/AndroidManifest.xml @@ -16,7 +16,8 @@ android:name=".MainActivity" android:label="@string/app_name" android:screenOrientation="landscape" - android:configChanges="keyboard|keyboardHidden|orientation|screenSize"> + android:configChanges="keyboard|keyboardHidden|orientation|screenSize" + android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> diff --git a/rop-game-android/assets/fonts/score.fnt b/rop-game-android/assets/fonts/score.fnt new file mode 100644 index 0000000..5a97bce --- /dev/null +++ b/rop-game-android/assets/fonts/score.fnt @@ -0,0 +1,101 @@ +info face="Comic Sans MS" size=60 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=2 +common lineHeight=60 base=47 scaleW=512 scaleH=256 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="score_0.png" +chars count=97 +char id=32 x=503 y=78 width=5 height=5 xoffset=-2 yoffset=-2 xadvance=13 page=0 chnl=15 +char id=33 x=154 y=48 width=9 height=39 xoffset=0 yoffset=11 xadvance=10 page=0 chnl=15 +char id=34 x=275 y=150 width=17 height=19 xoffset=0 yoffset=12 xadvance=18 page=0 chnl=15 +char id=35 x=174 y=47 width=40 height=38 xoffset=-2 yoffset=12 xadvance=36 page=0 chnl=15 +char id=36 x=0 y=0 width=28 height=48 xoffset=0 yoffset=9 xadvance=30 page=0 chnl=15 +char id=37 x=348 y=0 width=35 height=39 xoffset=0 yoffset=11 xadvance=35 page=0 chnl=15 +char id=38 x=418 y=0 width=31 height=39 xoffset=-1 yoffset=12 xadvance=28 page=0 chnl=15 +char id=39 x=316 y=149 width=9 height=16 xoffset=3 yoffset=10 xadvance=17 page=0 chnl=15 +char id=40 x=99 y=0 width=17 height=47 xoffset=-1 yoffset=11 xadvance=16 page=0 chnl=15 +char id=41 x=117 y=0 width=17 height=47 xoffset=0 yoffset=11 xadvance=16 page=0 chnl=15 +char id=42 x=206 y=163 width=24 height=22 xoffset=-2 yoffset=12 xadvance=23 page=0 chnl=15 +char id=43 x=163 y=164 width=23 height=23 xoffset=-2 yoffset=22 xadvance=21 page=0 chnl=15 +char id=44 x=369 y=146 width=11 height=14 xoffset=1 yoffset=42 xadvance=12 page=0 chnl=15 +char id=45 x=415 y=146 width=19 height=9 xoffset=-1 yoffset=31 xadvance=18 page=0 chnl=15 +char id=46 x=435 y=146 width=10 height=9 xoffset=0 yoffset=41 xadvance=11 page=0 chnl=15 +char id=47 x=276 y=0 width=24 height=40 xoffset=-1 yoffset=11 xadvance=23 page=0 chnl=15 +char id=48 x=149 y=88 width=28 height=38 xoffset=-1 yoffset=12 xadvance=26 page=0 chnl=15 +char id=49 x=489 y=40 width=17 height=37 xoffset=1 yoffset=12 xadvance=19 page=0 chnl=15 +char id=50 x=59 y=128 width=25 height=37 xoffset=0 yoffset=12 xadvance=26 page=0 chnl=15 +char id=51 x=367 y=79 width=25 height=38 xoffset=0 yoffset=12 xadvance=26 page=0 chnl=15 +char id=52 x=61 y=89 width=29 height=38 xoffset=-2 yoffset=12 xadvance=26 page=0 chnl=15 +char id=53 x=27 y=49 width=26 height=39 xoffset=0 yoffset=11 xadvance=26 page=0 chnl=15 +char id=54 x=313 y=80 width=26 height=38 xoffset=-1 yoffset=12 xadvance=26 page=0 chnl=15 +char id=55 x=0 y=128 width=29 height=37 xoffset=-1 yoffset=13 xadvance=26 page=0 chnl=15 +char id=56 x=178 y=86 width=26 height=38 xoffset=-1 yoffset=12 xadvance=26 page=0 chnl=15 +char id=57 x=482 y=0 width=27 height=39 xoffset=-1 yoffset=12 xadvance=26 page=0 chnl=15 +char id=58 x=493 y=114 width=10 height=26 xoffset=1 yoffset=21 xadvance=13 page=0 chnl=15 +char id=59 x=257 y=120 width=12 height=32 xoffset=0 yoffset=21 xadvance=13 page=0 chnl=15 +char id=60 x=187 y=163 width=18 height=23 xoffset=-2 yoffset=23 xadvance=16 page=0 chnl=15 +char id=61 x=253 y=155 width=21 height=21 xoffset=-1 yoffset=23 xadvance=22 page=0 chnl=15 +char id=62 x=143 y=164 width=19 height=25 xoffset=-1 yoffset=21 xadvance=17 page=0 chnl=15 +char id=63 x=85 y=128 width=24 height=37 xoffset=-1 yoffset=14 xadvance=23 page=0 chnl=15 +char id=64 x=211 y=0 width=40 height=41 xoffset=-1 yoffset=11 xadvance=40 page=0 chnl=15 +char id=65 x=175 y=127 width=31 height=35 xoffset=0 yoffset=14 xadvance=32 page=0 chnl=15 +char id=66 x=286 y=81 width=26 height=38 xoffset=1 yoffset=12 xadvance=27 page=0 chnl=15 +char id=67 x=30 y=128 width=28 height=37 xoffset=-1 yoffset=13 xadvance=26 page=0 chnl=15 +char id=68 x=31 y=89 width=29 height=38 xoffset=1 yoffset=12 xadvance=31 page=0 chnl=15 +char id=69 x=120 y=88 width=28 height=38 xoffset=0 yoffset=12 xadvance=27 page=0 chnl=15 +char id=70 x=259 y=81 width=26 height=38 xoffset=1 yoffset=12 xadvance=26 page=0 chnl=15 +char id=71 x=394 y=40 width=32 height=38 xoffset=-1 yoffset=12 xadvance=29 page=0 chnl=15 +char id=72 x=384 y=0 width=33 height=39 xoffset=0 yoffset=12 xadvance=33 page=0 chnl=15 +char id=73 x=207 y=125 width=25 height=35 xoffset=-2 yoffset=14 xadvance=24 page=0 chnl=15 +char id=74 x=427 y=40 width=30 height=38 xoffset=-1 yoffset=12 xadvance=29 page=0 chnl=15 +char id=75 x=205 y=86 width=26 height=38 xoffset=2 yoffset=12 xadvance=26 page=0 chnl=15 +char id=76 x=232 y=81 width=26 height=38 xoffset=-1 yoffset=12 xadvance=24 page=0 chnl=15 +char id=77 x=215 y=42 width=39 height=38 xoffset=-1 yoffset=12 xadvance=38 page=0 chnl=15 +char id=78 x=291 y=41 width=34 height=38 xoffset=0 yoffset=12 xadvance=34 page=0 chnl=15 +char id=79 x=255 y=42 width=35 height=38 xoffset=0 yoffset=12 xadvance=34 page=0 chnl=15 +char id=80 x=419 y=79 width=24 height=38 xoffset=-1 yoffset=12 xadvance=22 page=0 chnl=15 +char id=81 x=169 y=0 width=41 height=46 xoffset=-1 yoffset=12 xadvance=38 page=0 chnl=15 +char id=82 x=91 y=88 width=28 height=38 xoffset=0 yoffset=12 xadvance=28 page=0 chnl=15 +char id=83 x=144 y=127 width=30 height=36 xoffset=0 yoffset=14 xadvance=30 page=0 chnl=15 +char id=84 x=110 y=127 width=33 height=36 xoffset=-1 yoffset=13 xadvance=29 page=0 chnl=15 +char id=85 x=450 y=0 width=31 height=39 xoffset=0 yoffset=12 xadvance=32 page=0 chnl=15 +char id=86 x=0 y=89 width=30 height=38 xoffset=0 yoffset=12 xadvance=28 page=0 chnl=15 +char id=87 x=301 y=0 width=46 height=39 xoffset=0 yoffset=12 xadvance=45 page=0 chnl=15 +char id=88 x=360 y=40 width=33 height=38 xoffset=-2 yoffset=12 xadvance=31 page=0 chnl=15 +char id=89 x=458 y=40 width=30 height=38 xoffset=-2 yoffset=12 xadvance=28 page=0 chnl=15 +char id=90 x=326 y=40 width=33 height=38 xoffset=-1 yoffset=12 xadvance=31 page=0 chnl=15 +char id=91 x=135 y=0 width=16 height=47 xoffset=1 yoffset=12 xadvance=16 page=0 chnl=15 +char id=92 x=130 y=48 width=23 height=39 xoffset=1 yoffset=13 xadvance=24 page=0 chnl=15 +char id=93 x=152 y=0 width=16 height=47 xoffset=0 yoffset=12 xadvance=16 page=0 chnl=15 +char id=94 x=293 y=150 width=22 height=16 xoffset=1 yoffset=11 xadvance=24 page=0 chnl=15 +char id=95 x=381 y=146 width=33 height=10 xoffset=-3 yoffset=47 xadvance=27 page=0 chnl=15 +char id=96 x=354 y=148 width=14 height=15 xoffset=0 yoffset=11 xadvance=24 page=0 chnl=15 +char id=97 x=417 y=118 width=25 height=27 xoffset=-2 yoffset=23 xadvance=22 page=0 chnl=15 +char id=98 x=54 y=49 width=25 height=39 xoffset=1 yoffset=11 xadvance=26 page=0 chnl=15 +char id=99 x=25 y=166 width=23 height=27 xoffset=-1 yoffset=23 xadvance=22 page=0 chnl=15 +char id=100 x=0 y=49 width=26 height=39 xoffset=-1 yoffset=11 xadvance=25 page=0 chnl=15 +char id=101 x=390 y=118 width=26 height=27 xoffset=-1 yoffset=23 xadvance=24 page=0 chnl=15 +char id=102 x=252 y=0 width=23 height=41 xoffset=-1 yoffset=11 xadvance=22 page=0 chnl=15 +char id=103 x=393 y=79 width=25 height=38 xoffset=-2 yoffset=23 xadvance=23 page=0 chnl=15 +char id=104 x=444 y=79 width=24 height=38 xoffset=0 yoffset=11 xadvance=25 page=0 chnl=15 +char id=105 x=493 y=78 width=9 height=35 xoffset=1 yoffset=14 xadvance=12 page=0 chnl=15 +char id=106 x=29 y=0 width=18 height=48 xoffset=-3 yoffset=14 xadvance=17 page=0 chnl=15 +char id=107 x=105 y=48 width=24 height=39 xoffset=0 yoffset=12 xadvance=23 page=0 chnl=15 +char id=108 x=164 y=48 width=9 height=39 xoffset=2 yoffset=11 xadvance=12 page=0 chnl=15 +char id=109 x=294 y=120 width=33 height=28 xoffset=0 yoffset=23 xadvance=33 page=0 chnl=15 +char id=110 x=49 y=166 width=23 height=27 xoffset=0 yoffset=23 xadvance=23 page=0 chnl=15 +char id=111 x=443 y=118 width=24 height=27 xoffset=-1 yoffset=23 xadvance=23 page=0 chnl=15 +char id=112 x=80 y=48 width=24 height=39 xoffset=-1 yoffset=22 xadvance=23 page=0 chnl=15 +char id=113 x=469 y=79 width=23 height=38 xoffset=-2 yoffset=23 xadvance=22 page=0 chnl=15 +char id=114 x=97 y=166 width=21 height=27 xoffset=0 yoffset=23 xadvance=21 page=0 chnl=15 +char id=115 x=270 y=120 width=23 height=29 xoffset=-1 yoffset=21 xadvance=21 page=0 chnl=15 +char id=116 x=233 y=120 width=23 height=34 xoffset=-2 yoffset=16 xadvance=20 page=0 chnl=15 +char id=117 x=73 y=166 width=23 height=27 xoffset=-1 yoffset=23 xadvance=22 page=0 chnl=15 +char id=118 x=468 y=118 width=24 height=27 xoffset=-1 yoffset=23 xadvance=21 page=0 chnl=15 +char id=119 x=328 y=119 width=32 height=28 xoffset=-1 yoffset=23 xadvance=31 page=0 chnl=15 +char id=120 x=361 y=118 width=28 height=27 xoffset=-2 yoffset=23 xadvance=25 page=0 chnl=15 +char id=121 x=340 y=79 width=26 height=38 xoffset=-2 yoffset=23 xadvance=22 page=0 chnl=15 +char id=122 x=0 y=166 width=24 height=27 xoffset=0 yoffset=23 xadvance=24 page=0 chnl=15 +char id=123 x=58 y=0 width=20 height=47 xoffset=-2 yoffset=11 xadvance=16 page=0 chnl=15 +char id=124 x=48 y=0 width=9 height=48 xoffset=4 yoffset=9 xadvance=18 page=0 chnl=15 +char id=125 x=79 y=0 width=19 height=47 xoffset=-2 yoffset=11 xadvance=16 page=0 chnl=15 +char id=126 x=326 y=149 width=27 height=15 xoffset=-1 yoffset=25 xadvance=26 page=0 chnl=15 +char id=215 x=231 y=161 width=21 height=22 xoffset=-2 yoffset=23 xadvance=21 page=0 chnl=15 +char id=247 x=119 y=164 width=23 height=26 xoffset=-2 yoffset=20 xadvance=21 page=0 chnl=15 diff --git a/rop-game-android/assets/fonts/score_0.png b/rop-game-android/assets/fonts/score_0.png new file mode 100644 index 0000000..9f5aa2e Binary files /dev/null and b/rop-game-android/assets/fonts/score_0.png differ diff --git a/rop-game-android/src/com/kandl/ropgame/MainActivity.java b/rop-game-android/src/com/kandl/ropgame/MainActivity.java index b4f4339..8fac238 100644 --- a/rop-game-android/src/com/kandl/ropgame/MainActivity.java +++ b/rop-game-android/src/com/kandl/ropgame/MainActivity.java @@ -1,6 +1,8 @@ package com.kandl.ropgame; import android.os.Bundle; +import android.view.Window; +import android.view.WindowManager; import com.badlogic.gdx.backends.android.AndroidApplication; import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; @@ -16,6 +18,10 @@ public void onCreate(Bundle savedInstanceState) { cfg.useCompass = false; cfg.useGL20 = false; + requestWindowFeature(Window.FEATURE_NO_TITLE); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, + WindowManager.LayoutParams.FLAG_FULLSCREEN); + initialize(new RopGame(), cfg); } } \ No newline at end of file diff --git a/rop-game/src/com/kandl/ropgame/GameScreen.java b/rop-game/src/com/kandl/ropgame/GameScreen.java index 0cde79e..58ae398 100644 --- a/rop-game/src/com/kandl/ropgame/GameScreen.java +++ b/rop-game/src/com/kandl/ropgame/GameScreen.java @@ -31,6 +31,8 @@ import com.badlogic.gdx.Screen; import com.badlogic.gdx.graphics.*; import com.badlogic.gdx.graphics.g2d.Sprite; +import com.badlogic.gdx.graphics.g2d.TextureAtlas; +import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.scenes.scene2d.*; import com.badlogic.gdx.scenes.scene2d.actions.Actions; import com.badlogic.gdx.scenes.scene2d.ui.*; @@ -105,7 +107,7 @@ else if (Scene[0].getRoot().getX() + dx <= Scene[0].getWidth() - frontBackground GameTest.setColor(Color.BLUE); GameTest.fill(); GameTest.setColor(Color.YELLOW); - GameTest.fillRectangle(0, 0, 1024, 800); + GameTest.fillRectangle(0, 0, 1280, 790); frontBackground = new Image(new SpriteDrawable(new Sprite(new Texture(GameTest), 0, 0, 2048, 800)), Scaling.fill); GameTest.dispose(); scene.addActor(frontBackground); diff --git a/rop-game/src/com/kandl/ropgame/RopGame.java b/rop-game/src/com/kandl/ropgame/RopGame.java index ab82415..56c1665 100644 --- a/rop-game/src/com/kandl/ropgame/RopGame.java +++ b/rop-game/src/com/kandl/ropgame/RopGame.java @@ -5,7 +5,7 @@ public class RopGame extends Game { public static GameScreen gameScreen; - public static float Score; + public static float score; public static final int WIDTH = 1024; public static final int HEIGHT = 600; public static final boolean DEBUG = true; @@ -13,7 +13,7 @@ public class RopGame extends Game { @Override public void create() { - Score = 0; + score = 0; gameScreen = new GameScreen(); setScreen(gameScreen); loadAll(); diff --git a/rop-game/src/com/kandl/ropgame/ui/UITable.java b/rop-game/src/com/kandl/ropgame/ui/UITable.java index 4ae41f4..47ef7dd 100644 --- a/rop-game/src/com/kandl/ropgame/ui/UITable.java +++ b/rop-game/src/com/kandl/ropgame/ui/UITable.java @@ -1,5 +1,6 @@ package com.kandl.ropgame.ui; +import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Texture; @@ -41,11 +42,11 @@ public UITable() { RightCorner = null; RightBackground = null; OrderLine = new Image(); - Score = new Label("$" + String.format("%1$.2f", RopGame.Score), new Label.LabelStyle(RopGame.assets.get("font.fnt", BitmapFont.class), Color.WHITE)); + Score = new Label("$" + String.format("%1$.2f", RopGame.score), new Label.LabelStyle(new BitmapFont(Gdx.files.internal("fonts/score.fnt"), false), Color.YELLOW)); Scenes = new ButtonGroup(); Scene = new Button[4]; for (int i = 0; i < 4; ++i) { - Scene[i] = new Button((Drawable) null, null, null); + Scene[i] = new Button((Drawable) null); Scenes.add(Scene[i]); } @@ -95,7 +96,7 @@ public void changed(ChangeEvent event, Actor actor) { @Override public void act(float delta) { super.act(delta); - Score.setText("$" + String.format("%1$.2f", RopGame.Score)); + Score.setText("$" + String.format("%1$.2f", RopGame.score)); } public void resize(float width, float height) {