Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MilderJoghurt
FrozenNumbers
Commits
3d505edb
Commit
3d505edb
authored
Jan 08, 2016
by
Fjen Undso
Browse files
mainmenu: fix gametitle placement. ref
#15
parent
85590716
Changes
2
Show whitespace changes
Inline
Side-by-side
core/src/org/milderjoghurt/frozennumbers/FrozenNumbersGame.java
View file @
3d505edb
...
...
@@ -66,6 +66,11 @@ public class FrozenNumbersGame extends ApplicationAdapter {
size3Params
.
fontParameters
.
size
=
40
;
assets
.
load
(
"size40.ttf"
,
BitmapFont
.
class
,
size3Params
);
FreetypeFontLoader
.
FreeTypeFontLoaderParameter
size4Params
=
new
FreetypeFontLoader
.
FreeTypeFontLoaderParameter
();
size4Params
.
fontFileName
=
"fonts/crayon.ttf"
;
size4Params
.
fontParameters
.
size
=
60
;
assets
.
load
(
"size60.ttf"
,
BitmapFont
.
class
,
size4Params
);
assets
.
load
(
"backgrounds/background.jpg"
,
Texture
.
class
);
// menu
assets
.
load
(
"sprites/btn_help.png"
,
Texture
.
class
);
...
...
core/src/org/milderjoghurt/frozennumbers/screens/MainMenuScreen.java
View file @
3d505edb
...
...
@@ -8,6 +8,7 @@ import com.badlogic.gdx.graphics.GL20;
import
com.badlogic.gdx.graphics.Texture
;
import
com.badlogic.gdx.graphics.g2d.Batch
;
import
com.badlogic.gdx.graphics.g2d.BitmapFont
;
import
com.badlogic.gdx.graphics.g2d.GlyphLayout
;
import
com.badlogic.gdx.graphics.g2d.Sprite
;
import
com.badlogic.gdx.math.Vector2
;
import
com.badlogic.gdx.scenes.scene2d.ui.Label
;
...
...
@@ -25,6 +26,7 @@ public class MainMenuScreen implements Screen {
Sprite
p1_quest
,
p2_quest
;
boolean
p1_isready
,
p2_isready
;
float
wWidth
,
wHeight
;
GlyphLayout
glyphLayout
=
new
GlyphLayout
();
public
MainMenuScreen
(
Game
g
,
Map
<
String
,
Screen
>
m
)
{
game
=
g
;
...
...
@@ -102,7 +104,7 @@ public class MainMenuScreen implements Screen {
}
//
d
rawing
s
tuff
//
D
rawing
S
tuff
Gdx
.
gl
.
glClearColor
(
0
,
0
,
0
,
1
);
Gdx
.
gl
.
glClear
(
GL20
.
GL_COLOR_BUFFER_BIT
);
Batch
batch
=
FrozenNumbersGame
.
batch
;
...
...
@@ -116,13 +118,15 @@ public class MainMenuScreen implements Screen {
p1_quest
.
draw
(
batch
);
p2_quest
.
draw
(
batch
);
Label
p2TextLabel
=
new
Label
(
"Frozen Numbers"
,
new
Label
.
LabelStyle
(
FrozenNumbersGame
.
assets
.
get
(
"size40.ttf"
,
BitmapFont
.
class
),
Color
.
WHITE
));
// Game Title
Table
container
=
new
Table
();
container
.
setTransform
(
true
);
container
.
add
(
p2TextLabel
);
Label
p2GameTName
=
new
Label
(
"Frozen Numbers"
,
new
Label
.
LabelStyle
(
FrozenNumbersGame
.
assets
.
get
(
"size60.ttf"
,
BitmapFont
.
class
),
Color
.
WHITE
));
container
.
add
(
p2GameTName
);
container
.
setPosition
(
wWidth
/
2.0f
,
wHeight
/
2.0f
-
30
);
container
.
draw
(
batch
,
1
);
container
.
setRotation
(
180
);
container
.
setPosition
((
float
)
(
wWidth
/
2.0
),
(
float
)
(
wHeight
/
2.0
+
60
)
);
container
.
setPosition
(
wWidth
/
2.0
f
,
wHeight
/
2.0
f
+
30
);
container
.
draw
(
batch
,
1
);
batch
.
end
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment