Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Progark gruppe 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Ingebrigt Ørstad
Progark gruppe 3
Commits
05701f6e
Commit
05701f6e
authored
5 years ago
by
Haakon Gunleiksrud
Browse files
Options
Downloads
Patches
Plain Diff
#29
Added some more front end features to the create-join-view
parent
0a1e2f32
No related branches found
No related tags found
1 merge request
!23
Resolve "Create-Join-More-Features"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/android/assets/glassy/skin/glassy-ui.json
+1
-0
1 addition, 0 deletions
frontend/android/assets/glassy/skin/glassy-ui.json
frontend/core/src/com/gameware/game/states/CreateJoinTournamentState.java
+93
-15
93 additions, 15 deletions
...c/com/gameware/game/states/CreateJoinTournamentState.java
with
94 additions
and
15 deletions
frontend/android/assets/glassy/skin/glassy-ui.json
+
1
−
0
View file @
05701f6e
...
...
@@ -93,6 +93,7 @@ com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton$ImageTextButtonStyle: {
com.badlogic.gdx.scenes.scene
2
d.ui.Label$LabelStyle:
{
default:
{
font:
font
fontColor:
black
}
big:
{
font:
font-big
...
...
This diff is collapsed.
Click to expand it.
frontend/core/src/com/gameware/game/states/CreateJoinTournamentState.java
+
93
−
15
View file @
05701f6e
...
...
@@ -6,24 +6,29 @@ import com.badlogic.gdx.math.Vector3;
import
com.badlogic.gdx.scenes.scene2d.InputEvent
;
import
com.badlogic.gdx.scenes.scene2d.Stage
;
import
com.badlogic.gdx.scenes.scene2d.ui.Button
;
import
com.badlogic.gdx.scenes.scene2d.ui.Label
;
import
com.badlogic.gdx.scenes.scene2d.ui.ScrollPane
;
import
com.badlogic.gdx.scenes.scene2d.ui.Skin
;
import
com.badlogic.gdx.scenes.scene2d.ui.Table
;
import
com.badlogic.gdx.scenes.scene2d.ui.TextButton
;
import
com.badlogic.gdx.scenes.scene2d.ui.TextField
;
import
com.badlogic.gdx.scenes.scene2d.utils.ClickListener
;
import
com.gameware.game.GameWare
;
public
class
CreateJoinTournamentState
extends
State
{
private
Stage
stage
;
private
Table
table
;
private
Table
outerTable
;
private
Table
innerTable
;
private
int
spacingOnBottom
=
Gdx
.
graphics
.
getHeight
()/
15
;
private
float
fontScaleX
=
3
f
;
private
float
fontScaleY
=
3
f
;
private
String
backBtnText
=
"Back"
;
private
String
enterBtnText
=
"Enter"
;
private
String
createBtnText
=
"Create new"
;
private
String
joinBtnText
=
"Join new"
;
private
String
tournamentText
=
"Tournament 1"
;
public
CreateJoinTournamentState
(
GameStateManager
gsm
)
{
super
(
gsm
);
...
...
@@ -34,32 +39,100 @@ public class CreateJoinTournamentState extends State {
skin
.
getFont
(
"font"
).
getData
().
setScale
(
fontScaleX
,
fontScaleY
);
cam
.
setToOrtho
(
false
,
Gdx
.
graphics
.
getWidth
()/
2
,
Gdx
.
graphics
.
getHeight
()/
2
);
table
=
new
Table
();
table
.
setFillParent
(
true
);
outerTable
=
new
Table
();
outerTable
.
setFillParent
(
true
);
innerTable
=
new
Table
();
outerTable
.
setFillParent
(
true
);
table
.
row
();
outerTable
.
row
();
innerTable
.
row
();
TextButton
backBtn
=
new
TextButton
(
backBtnText
,
skin
);
backBtn
.
addListener
(
new
ClickListener
()
{
Label
tournamentLabel
=
new
Label
(
tournamentText
,
skin
);
TextButton
enterBtn
=
new
TextButton
(
enterBtnText
,
skin
);
enterBtn
.
addListener
(
new
ClickListener
()
{
@Override
public
void
clicked
(
InputEvent
e
,
float
x
,
float
y
){
handle
Back
BtnClick
();
handle
Enter
BtnClick
();
}
});
table
.
add
(
backBtn
);
table
.
row
();
TextButton
enterBtn2
=
new
TextButton
(
enterBtnText
,
skin
);
enterBtn2
.
addListener
(
new
ClickListener
()
{
@Override
public
void
clicked
(
InputEvent
e
,
float
x
,
float
y
){
handleEnterBtnClick
();
}
});
TextButton
enterBtn
=
new
TextButton
(
enterBtnText
,
skin
);
enterBtn
.
addListener
(
new
ClickListener
()
{
TextButton
enterBtn
3
=
new
TextButton
(
enterBtnText
,
skin
);
enterBtn
3
.
addListener
(
new
ClickListener
()
{
@Override
public
void
clicked
(
InputEvent
e
,
float
x
,
float
y
){
handleEnterBtnClick
();
}
});
table
.
add
(
enterBtn
);
stage
.
addActor
(
table
);
TextButton
enterBtn4
=
new
TextButton
(
enterBtnText
,
skin
);
enterBtn4
.
addListener
(
new
ClickListener
()
{
@Override
public
void
clicked
(
InputEvent
e
,
float
x
,
float
y
){
handleEnterBtnClick
();
}
});
innerTable
.
add
(
tournamentLabel
).
size
(
Gdx
.
graphics
.
getWidth
()/
5
);
innerTable
.
add
(
enterBtn
);
innerTable
.
row
();
innerTable
.
add
(
enterBtn2
);
innerTable
.
row
();
innerTable
.
add
(
enterBtn3
);
innerTable
.
row
();
innerTable
.
add
(
enterBtn4
);
innerTable
.
row
();
ScrollPane
tournamentsPane
=
new
ScrollPane
(
innerTable
,
skin
);
outerTable
.
add
(
tournamentsPane
).
pad
(
10
);
outerTable
.
row
();
TextButton
createBtn
=
new
TextButton
(
createBtnText
,
skin
);
createBtn
.
addListener
(
new
ClickListener
()
{
@Override
public
void
clicked
(
InputEvent
e
,
float
x
,
float
y
){
handleCreateBtnClick
();
}
});
outerTable
.
add
(
createBtn
).
pad
(
10
);
TextButton
joinBtn
=
new
TextButton
(
joinBtnText
,
skin
);
joinBtn
.
addListener
(
new
ClickListener
()
{
@Override
public
void
clicked
(
InputEvent
e
,
float
x
,
float
y
){
handleJoinBtnClick
();
}
});
outerTable
.
add
(
joinBtn
).
pad
(
10
);
outerTable
.
row
();
TextButton
backBtn
=
new
TextButton
(
backBtnText
,
skin
);
backBtn
.
addListener
(
new
ClickListener
()
{
@Override
public
void
clicked
(
InputEvent
e
,
float
x
,
float
y
){
handleBackBtnClick
();
}
});
outerTable
.
add
(
backBtn
).
pad
(
10
);
//outerTable.row();
Label
tournamentLabel1
=
new
Label
(
tournamentText
,
skin
);
outerTable
.
add
(
tournamentLabel1
).
size
(
10
f
);
stage
.
addActor
(
outerTable
);
}
@Override
...
...
@@ -99,4 +172,9 @@ public class CreateJoinTournamentState extends State {
private
void
handleEnterBtnClick
(){
gsm
.
set
(
new
ViewTournamentState
(
gsm
));
}
private
void
handleCreateBtnClick
(){};
private
void
handleJoinBtnClick
(){};
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment