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
cf514893
Commit
cf514893
authored
Aug 26, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u
parent
340edf99
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
TestButton.ts
project/src/common/TestButton.ts
+30
-0
IndexScene.ts
project/src/scenes/IndexScene.ts
+10
-0
No files found.
project/src/common/TestButton.ts
0 → 100644
View file @
cf514893
const
w
=
200
;
const
h
=
80
;
export
default
class
TestButton
extends
FYGE
.
Sprite
{
getRect
(){
return
[
w
,
h
]
}
constructor
(
txt
,
parent
?)
{
super
();
const
bg
=
new
FYGE
.
Shape
();
bg
.
beginFill
(
0
,
1
);
bg
.
drawRoundedRect
(
0
,
0
,
w
,
h
,
10
,
10
,
10
,
10
);
bg
.
endFill
();
this
.
addChild
(
bg
);
const
buttonTxt
=
new
FYGE
.
TextField
;
buttonTxt
.
text
=
txt
;
buttonTxt
.
textWidth
=
200
;
buttonTxt
.
textHeight
=
80
;
buttonTxt
.
size
=
30
;
buttonTxt
.
textAlign
=
FYGE
.
TEXT_ALIGN
.
CENTER
;
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/IndexScene.ts
View file @
cf514893
...
...
@@ -4,6 +4,7 @@ import { RES } from "../../module/RES";
import
{
layers
}
from
"../../module/views/layers"
;
import
{
Scene
}
from
"../../module/views/Scene"
;
import
getObject
from
"../common/getObject"
;
import
TestButton
from
"../common/TestButton"
;
import
{
isMember
}
from
"../isMember"
;
import
{
getTimesPanel
}
from
"../panels/getTimes"
;
import
{
RulePanel
}
from
"../panels/RulePanel"
;
...
...
@@ -41,6 +42,15 @@ export class IndexScene extends Scene {
initUi
()
{
super
.
initUi
();
const
btn
=
new
TestButton
(
'测试跳转任务'
,
this
)
btn
.
y
=
300
;
btn
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,()
=>
{
console
.
log
(
'测试跳转任务'
);
window
[
'wx'
].
miniProgram
.
navigateTo
({
url
:
'/pages/points-mall/member-task/member-task'
});
},
this
);
if
(
!
isMember
())
{
initNonmemberMask
();
}
...
...
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