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
4445b545
Commit
4445b545
authored
Aug 13, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ed4651d3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
9 deletions
+67
-9
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
prize.ts
project/src/panels/prize.ts
+27
-8
IndexScene.ts
project/src/scenes/IndexScene.ts
+1
-1
No files found.
project/src/Main.ts
View file @
4445b545
...
@@ -70,6 +70,7 @@ export class Main {
...
@@ -70,6 +70,7 @@ export class Main {
console
.
log
(
"初始化皮肤配置完成"
)
console
.
log
(
"初始化皮肤配置完成"
)
//加载通用资源
//加载通用资源
await
RES
.
loadGroup
(
"common"
);
await
RES
.
loadGroup
(
"common"
);
await
RES
.
loadGroup
(
"svga"
);
console
.
log
(
"通用资源加载完成"
)
console
.
log
(
"通用资源加载完成"
)
//h5环境时,隐藏加载中
//h5环境时,隐藏加载中
if
(
FYGE
.
getEnv
()
==
"web"
&&
document
.
getElementById
(
"__loading__"
))
document
.
getElementById
(
"__loading__"
).
style
.
display
=
"none"
;
if
(
FYGE
.
getEnv
()
==
"web"
&&
document
.
getElementById
(
"__loading__"
))
document
.
getElementById
(
"__loading__"
).
style
.
display
=
"none"
;
...
...
project/src/common/createMask.ts
0 → 100644
View file @
4445b545
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 @
4445b545
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/prize.ts
View file @
4445b545
import
{
RES
}
from
"../../module/RES"
;
import
{
RES
}
from
"../../module/RES"
;
import
{
Panel
}
from
"../../module/views/Panel"
;
import
{
Panel
}
from
"../../module/views/Panel"
;
import
centerTextField
from
"../common/centerTextField"
;
import
centerTextField
from
"../common/centerTextField"
;
import
{
createMask
}
from
"../common/createMask"
;
import
{
getImage
}
from
"../common/getImage"
;
import
getObject
from
"../common/getObject"
;
import
getObject
from
"../common/getObject"
;
let
section
;
let
section
;
export
class
PrizePanel
extends
Panel
{
export
class
PrizePanel
extends
Panel
{
share_share_go
(){
start
()
{
console
.
log
(
'share_share_go'
);
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
groupNames
()
{
return
[
"prize"
]
}
get
skinName
()
{
return
"prize"
}
get
skinName
()
{
return
"prize"
}
prizeContainer
:
FYGE
.
Sprite
;
initUi
()
{
initUi
()
{
super
.
initUi
();
super
.
initUi
();
var
skin
=
RES
.
getSkinDataByName
(
this
.
skinName
);
var
skin
=
RES
.
getSkinDataByName
(
this
.
skinName
);
this
.
position
.
set
(
skin
.
x
,
skin
.
y
);
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
()
{
initEvents
()
{
super
.
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
()
{
removeEvents
()
{
super
.
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
[]
{
protected
get
closeBtns
():
any
[]
{
return
[
getObject
(
this
,
'prize_close'
)]
return
[
getObject
(
this
,
'prize_close'
)]
}
}
}
}
project/src/scenes/IndexScene.ts
View file @
4445b545
...
@@ -30,7 +30,7 @@ export class IndexScene extends Scene {
...
@@ -30,7 +30,7 @@ export class IndexScene extends Scene {
start
()
{
start
()
{
super
.
start
();
super
.
start
();
showPanel
(
Shar
ePanel
);
showPanel
(
Priz
ePanel
);
getObject
(
this
,
'index_sharetips'
).
visible
=
false
;
getObject
(
this
,
'index_sharetips'
).
visible
=
false
;
this
.
initContainer
();
this
.
initContainer
();
this
.
initmask
();
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