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
7840f124
Commit
7840f124
authored
Aug 13, 2021
by
shunx 马
Browse files
Options
Browse Files
Download
Plain Diff
合并
parents
f5a7032c
4445b545
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
82 additions
and
13 deletions
+82
-13
Main.ts
project/src/Main.ts
+1
-0
createMask.ts
project/src/common/createMask.ts
+8
-0
getImage.ts
project/src/common/getImage.ts
+30
-0
RulePanel.ts
project/src/panels/RulePanel.ts
+1
-1
cost.ts
project/src/panels/cost.ts
+10
-4
prize.ts
project/src/panels/prize.ts
+27
-8
IndexScene.ts
project/src/scenes/IndexScene.ts
+5
-0
No files found.
project/src/Main.ts
View file @
7840f124
...
...
@@ -70,6 +70,7 @@ export class Main {
console
.
log
(
"初始化皮肤配置完成"
)
//加载通用资源
await
RES
.
loadGroup
(
"common"
);
await
RES
.
loadGroup
(
"svga"
);
console
.
log
(
"通用资源加载完成"
)
//h5环境时,隐藏加载中
if
(
FYGE
.
getEnv
()
==
"web"
&&
document
.
getElementById
(
"__loading__"
))
document
.
getElementById
(
"__loading__"
).
style
.
display
=
"none"
;
...
...
project/src/common/createMask.ts
0 → 100644
View file @
7840f124
export
const
createMask
=
(
w
,
h
,
r
,
p
)
=>
{
const
m
=
new
FYGE
.
Shape
();
m
.
beginFill
(
1
,
1
);
m
.
drawRoundedRect
(
0
,
0
,
w
,
h
,
r
,
r
,
r
,
r
);
m
.
endFill
();
p
&&
p
.
addChild
(
m
);
return
m
}
\ No newline at end of file
project/src/common/getImage.ts
0 → 100644
View file @
7840f124
import
{
createMask
}
from
"./createMask"
;
export
const
getImage
=
(
url
,
parent
?,
w
?,
h
?
,
rad
?):
Promise
<
FYGE
.
Sprite
>
=>
{
return
new
Promise
((
r
)
=>
{
FYGE
.
GlobalLoader
.
loadImage
((
success
,
image
)
=>
{
if
(
success
)
{
const
c
=
new
FYGE
.
Sprite
;
if
(
parent
)
parent
.
addChild
(
c
);
const
texture
=
FYGE
.
Texture
.
from
(
image
);
const
pic
=
new
FYGE
.
Sprite
();
pic
.
texture
=
texture
;
pic
.
width
=
w
;
pic
.
height
=
h
;
c
.
addChild
(
pic
);
const
m
=
createMask
(
w
,
h
,
rad
,
c
);
c
.
mask
=
m
;
r
(
c
);
}
},
url
);
});
}
\ No newline at end of file
project/src/panels/RulePanel.ts
View file @
7840f124
...
...
@@ -46,7 +46,7 @@ export class RulePanel extends Panel {
section
.
style
.
overflowY
=
"auto"
;
section
.
style
.
width
=
432
+
"px"
;
section
.
style
.
height
=
492
+
"px"
;
section
.
style
.
lineHeight
=
48
+
"px"
;
section
.
style
.
lineHeight
=
36
+
"px"
;
section
.
style
.
fontSize
=
this
.
ruleTxt
.
size
+
'px'
;
section
.
style
.
color
=
this
.
ruleTxt
.
fillColor
;
section
.
style
.
whiteSpace
=
"pre-line"
;
...
...
project/src/panels/cost.ts
View file @
7840f124
...
...
@@ -6,8 +6,13 @@ import getObject from "../common/getObject";
let
section
;
export
class
CostPanel
extends
Panel
{
share_share_go
(){
console
.
log
(
'share_share_go'
);
start
(){
super
.
start
();
const
cost
=
1234567890
;
getObject
(
this
,
'cost_tips'
).
text
=
`消耗
${
cost
}
积分拆开1个盲盒`
}
cost_open
(){
console
.
log
(
'cost_open'
);
}
get
groupNames
()
{
return
[
"cost"
]
}
...
...
@@ -22,11 +27,12 @@ export class CostPanel extends Panel {
initEvents
()
{
super
.
initEvents
();
// getObject(this, 'share_fail_btn').addEventListener(FYGE.MouseEvent.CLICK, this.share_share_go
, this);
getObject
(
this
,
'cost_open'
).
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
this
.
cost_open
,
this
);
}
removeEvents
()
{
super
.
removeEvents
();
// getObject(this, 'share_fail_btn').removeEventListener(FYGE.MouseEvent.CLICK, this.share_share_go
, this);
getObject
(
this
,
'cost_open'
).
removeEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
this
.
cost_open
,
this
);
}
protected
get
closeBtns
():
any
[]
{
...
...
project/src/panels/prize.ts
View file @
7840f124
import
{
RES
}
from
"../../module/RES"
;
import
{
Panel
}
from
"../../module/views/Panel"
;
import
centerTextField
from
"../common/centerTextField"
;
import
{
createMask
}
from
"../common/createMask"
;
import
{
getImage
}
from
"../common/getImage"
;
import
getObject
from
"../common/getObject"
;
let
section
;
export
class
PrizePanel
extends
Panel
{
share_share_go
(){
console
.
log
(
'share_share_go'
);
start
()
{
super
.
start
();
const
prizename
=
'活动活动黑乎乎的后sdfsdffsdfsdff端df和'
;
const
prizeimg
=
'https://yun.duiba.com.cn/db_games/sxbank.png'
;
const
size
=
164
;
getImage
(
prizeimg
,
this
.
prizeContainer
,
size
,
size
,
10
);
getObject
(
this
,
'prize_name'
).
text
=
prizename
;
}
click_prize_open
()
{
console
.
log
(
'click_prize_open'
);
}
get
groupNames
()
{
return
[
"prize"
]
}
get
skinName
()
{
return
"prize"
}
prizeContainer
:
FYGE
.
Sprite
;
initUi
()
{
super
.
initUi
();
var
skin
=
RES
.
getSkinDataByName
(
this
.
skinName
);
this
.
position
.
set
(
skin
.
x
,
skin
.
y
);
centerTextField
(
getObject
(
this
,
'prize_name'
),
731
);
centerTextField
(
getObject
(
this
,
'prize_name'
),
731
);
centerTextField
(
getObject
(
this
,
'prize_tips'
),
731
);
const
container
=
this
.
prizeContainer
=
this
.
addChild
(
new
FYGE
.
Sprite
);
container
.
position
.
set
(
286
,
276
);
window
[
'q'
]
=
container
;
}
initEvents
()
{
super
.
initEvents
();
// getObject(this, 'share_fail_btn').addEventListener(FYGE.MouseEvent.CLICK, this.share_share_go
, this);
getObject
(
this
,
'prize_open'
).
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
this
.
click_prize_open
,
this
);
}
removeEvents
()
{
super
.
removeEvents
();
// getObject(this, 'share_fail_btn').removeEventListener(FYGE.MouseEvent.CLICK, this.share_share_go
, this);
getObject
(
this
,
'prize_open'
).
removeEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
this
.
click_prize_open
,
this
);
}
protected
get
closeBtns
():
any
[]
{
return
[
getObject
(
this
,
'prize_close'
)]
}
return
[
getObject
(
this
,
'prize_close'
)]
}
}
project/src/scenes/IndexScene.ts
View file @
7840f124
...
...
@@ -31,8 +31,13 @@ export class IndexScene extends Scene {
start
()
{
super
.
start
();
<<<<<<<
HEAD
this
.
getIndex
();
// showPanel(SharePanel);
=======
showPanel
(
PrizePanel
);
>>>>>>>
4445
b545174f45bdb5de86ca86be78b8f149ecec
getObject
(
this
,
'index_sharetips'
).
visible
=
false
;
this
.
initContainer
();
this
.
initmask
();
...
...
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