Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Augmentile
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Auglement
Augmentile
Commits
6d00fefb
Verified
Commit
6d00fefb
authored
4 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Use proper rexUI classes
parent
27727975
No related branches found
Branches containing commit
No related tags found
1 merge request
!6
Resolve "Login scene for browser backend"
Pipeline
#7360
failed
4 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/frontend/containers/form.js
+21
-20
21 additions, 20 deletions
src/frontend/containers/form.js
src/frontend/game.js
+0
-10
0 additions, 10 deletions
src/frontend/game.js
with
21 additions
and
30 deletions
src/frontend/containers/form.js
+
21
−
20
View file @
6d00fefb
...
...
@@ -14,18 +14,15 @@
*/
import
Phaser
from
'
phaser
'
;
import
Button
from
'
phaser3-rex-plugins/plugins/button.js
'
;
import
InputText
from
'
phaser3-rex-plugins/plugins/inputtext.js
'
;
class
FormContainer
extends
Phaser
.
GameObjects
.
Container
{
constructor
(
scene
,
width
,
height
,
inputs
=
[],
buttons
=
[],
options
=
{},
containerX
=
0
,
containerY
=
0
,
children
=
[])
{
let
defaultOptions
=
{
fixedWidth
:
width
/
2
,
fixedHeight
:
36
};
options
=
{...
defaultOptions
,
...
options
};
constructor
(
scene
,
width
,
height
,
inputs
=
[],
buttons
=
[],
containerX
=
0
,
containerY
=
0
,
children
=
[])
{
super
(
scene
,
containerX
,
containerY
,
children
);
this
.
setSize
(
width
,
height
);
this
.
inputs
=
{};
let
y
=
0
;
inputs
.
forEach
(
input
=>
{
...
...
@@ -33,25 +30,29 @@ class FormContainer extends Phaser.GameObjects.Container {
label
.
setOrigin
(
0
,
0
);
this
.
add
(
label
);
let
text
=
scene
.
add
.
text
(
this
.
width
,
y
,
''
,
options
);
if
(
typeof
input
.
config
===
'
undefined
'
)
{
input
.
config
=
{};
}
let
text
=
new
InputText
(
scene
,
this
.
width
,
y
,
150
,
36
,
input
.
config
);
text
.
setOrigin
(
1
,
0
);
text
.
setInteractive
().
on
(
'
pointerdown
'
,
function
()
{
scene
.
rexUI
.
edit
(
text
);
});
scene
.
add
.
existing
(
text
);
this
.
add
(
text
);
this
.
inputs
[
input
.
name
]
=
text
;
y
+=
options
.
fixedHeight
;
y
+=
36
;
});
buttons
.
forEach
(
button
=>
{
let
sprite
=
scene
.
add
.
sprite
(
0
,
y
,
'
button
'
);
sprite
.
setOrigin
(
0
,
0
);
// button.setInteractive().on('pointerdown', function() {
// console.log(this);
// }
this
.
add
(
sprite
);
y
+=
options
.
fixedHeight
;
if
(
typeof
button
.
config
===
'
undefined
'
)
{
button
.
config
=
{};
}
let
text
=
scene
.
add
.
text
(
0
,
y
,
button
.
label
);
text
.
setOrigin
(
0
,
0
);
this
.
add
(
text
);
let
buttonOverlay
=
new
Button
(
text
,
button
.
config
);
buttonOverlay
.
on
(
'
click
'
,
button
.
callback
);
y
+=
36
;
});
}
}
...
...
This diff is collapsed.
Click to expand it.
src/frontend/game.js
+
0
−
10
View file @
6d00fefb
...
...
@@ -14,7 +14,6 @@
*/
import
Phaser
from
'
phaser
'
;
import
RexUIPlugin
from
'
phaser3-rex-plugins/templates/ui/ui-plugin
'
;
import
SplashScene
from
'
./scenes/splash
'
;
import
LoginScene
from
'
./scenes/login
'
;
import
'
./game.css
'
;
...
...
@@ -29,15 +28,6 @@ class Game extends Phaser.Game {
dom
:
{
createContainer
:
true
},
plugins
:
{
scene
:
[
{
key
:
'
rexUI
'
,
plugin
:
RexUIPlugin
,
mapping
:
'
rexUI
'
}
]
},
scale
:
{
mode
:
Phaser
.
Scale
.
FIT
,
autoCenter
:
Phaser
.
Scale
.
CENTER_BOTH
...
...
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