Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wfc13
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wildfirecode13
wfc13
Commits
8dc9173f
Commit
8dc9173f
authored
Aug 04, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
e8f27ef4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
12 deletions
+21
-12
index.html
project/index.html
+1
-1
TestButton.ts
project/src/common/TestButton.ts
+4
-1
NewbieScene.ts
project/src/scenes/NewbieScene.ts
+16
-10
No files found.
project/index.html
View file @
8dc9173f
...
...
@@ -43,7 +43,7 @@
<canvas
id=
"canvas"
style=
"width: 100%;height: 100%"
></canvas>
</div>
<!-- 帧率检测 -->
<
script
src=
"https://yun.duiba.com.cn/db_games/libs0126/stats.js"
></script
>
<
!-- <script src="https://yun.duiba.com.cn/db_games/libs0126/stats.js"></script> --
>
<script>
...
...
project/src/common/TestButton.ts
View file @
8dc9173f
export
default
class
TestButton
extends
FYGE
.
Sprite
{
constructor
(
txt
)
{
constructor
(
txt
,
parent
?
)
{
super
();
const
bg
=
new
FYGE
.
Shape
();
...
...
@@ -18,5 +18,8 @@ export default class TestButton extends FYGE.Sprite {
buttonTxt
.
verticalAlign
=
FYGE
.
VERTICAL_ALIGN
.
MIDDLE
;
buttonTxt
.
fillColor
=
'0xffffff'
;
this
.
addChild
(
buttonTxt
);
if
(
parent
)
parent
.
addChild
(
this
)
}
}
\ No newline at end of file
project/src/scenes/NewbieScene.ts
View file @
8dc9173f
import
{
unwatchPageVisibility
,
watchPageVisibility
}
from
"@spark/utils"
;
import
{
changeScene
,
closeCurrentPanel
,
showPanel
}
from
"../../module/ctrls"
;
import
PanelCtrl
from
"../../module/ctrls/panelCtrl"
;
import
{
Scene
}
from
"../../module/views/Scene"
;
import
TestButton
from
"../common/TestButton"
;
import
getQueryParams
from
"../getQueryParams"
;
import
{
PrizePanel
}
from
"../panels/prize"
;
import
{
ShareFailPanel
}
from
"../panels/share_fail"
;
import
{
ShareSuccessPanel
}
from
"../panels/share_success"
;
import
{
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
import
{
IndexScene
}
from
"./IndexScene"
;
let
prize
;
export
class
NewbieScene
extends
Scene
{
prizeBtn
:
FYGE
.
Sprite
;
onPageVisibilityChange
=
async
(
visible
)
=>
{
console
.
log
(
'页面visible'
,
visible
);
if
(
!
prize
)
{
...
...
@@ -26,14 +24,11 @@ export class NewbieScene extends Scene {
super
.
start
();
const
query
=
getQueryParams
();
if
(
query
.
autoprize
)
{
if
(
query
.
autoprize
==
1
)
{
this
.
openPrize
(
data
);
}
this
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
this
.
openPrize
(
data
);
},
this
);
}
openPrize
(
data
){
...
...
@@ -41,13 +36,24 @@ export class NewbieScene extends Scene {
showPanel
(
PrizePanel
,
data
);
}
onClick_prizeBtn
(){
this
.
openPrize
(
this
.
data
);
}
initUi
(){
super
.
initUi
();
this
.
prizeBtn
=
new
TestButton
(
'立即岔开'
,
this
);
}
initEvents
()
{
super
.
initEvents
();
watchPageVisibility
(
this
.
onPageVisibilityChange
)
watchPageVisibility
(
this
.
onPageVisibilityChange
);
this
.
prizeBtn
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
this
.
onClick_prizeBtn
,
this
);
}
removeEvents
()
{
super
.
removeEvents
();
unwatchPageVisibility
(
this
.
onPageVisibilityChange
)
this
.
prizeBtn
.
removeEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
this
.
onClick_prizeBtn
,
this
);
}
get
groupNames
()
{
return
[
"newbie"
]
}
...
...
Write
Preview
Markdown
is supported
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