Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SSAPP2501
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
SSAPP2501
Commits
ec2255ab
Commit
ec2255ab
authored
Aug 11, 2025
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app
parent
524f2cd2
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1495 additions
and
648 deletions
+1495
-648
SSAPP2501.fire
assets/SSAPP2501/scene/SSAPP2501.fire
+1264
-499
SSAPP2501.ts
assets/SSAPP2501/scene/SSAPP2501.ts
+184
-149
SSAPP2501_pg.ts
assets/SSAPP2501/scene/tool/SSAPP2501_pg.ts
+47
-0
No files found.
assets/SSAPP2501/scene/SSAPP2501.fire
View file @
ec2255ab
This diff is collapsed.
Click to expand it.
assets/SSAPP2501/scene/SSAPP2501.ts
View file @
ec2255ab
This diff is collapsed.
Click to expand it.
assets/SSAPP2501/scene/tool/SSAPP2501_pg.ts
View file @
ec2255ab
...
...
@@ -1017,6 +1017,53 @@ let pg = {
const
id
=
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
loop
);
resolve
(
id
);
})
},
/**
* 显示提示信息
* @param {string} message - 提示信息内容
*/
showToast
(
message
)
{
console
.
log
(
"
show toast->
"
+
message
);
// 创建一个临时节点显示提示信息
const
canvas
=
cc
.
director
.
getScene
().
getChildByName
(
'
Canvas
'
);
if
(
!
canvas
)
return
;
// 创建提示节点
const
node
=
new
cc
.
Node
(
'
Toast
'
);
canvas
.
addChild
(
node
);
node
.
setPosition
(
0
,
0
);
node
.
zIndex
=
999
;
// 创建背景
const
bg
=
new
cc
.
Node
(
'
ToastBg
'
);
node
.
addChild
(
bg
);
const
bgGraphics
=
bg
.
addComponent
(
cc
.
Graphics
);
bgGraphics
.
fillColor
=
cc
.
Color
.
BLACK
;
bgGraphics
.
lineWidth
=
0
;
bgGraphics
.
roundRect
(
-
200
,
-
30
,
400
,
60
,
10
);
bgGraphics
.
fill
();
// 创建文本
const
label
=
new
cc
.
Node
(
'
ToastLabel
'
);
node
.
addChild
(
label
);
const
labelComp
=
label
.
addComponent
(
cc
.
Label
);
labelComp
.
string
=
message
;
labelComp
.
fontSize
=
24
;
labelComp
.
lineHeight
=
24
;
labelComp
.
horizontalAlign
=
cc
.
Label
.
HorizontalAlign
.
CENTER
;
labelComp
.
verticalAlign
=
cc
.
Label
.
VerticalAlign
.
CENTER
;
// 动画显示和消失
node
.
opacity
=
0
;
const
fadeIn
=
cc
.
fadeTo
(
0.3
,
255
);
const
delay
=
cc
.
delayTime
(
1.5
);
const
fadeOut
=
cc
.
fadeTo
(
0.3
,
0
);
const
remove
=
cc
.
callFunc
(()
=>
{
node
.
removeFromParent
(
true
);
node
.
destroy
();
});
node
.
runAction
(
cc
.
sequence
(
fadeIn
,
delay
,
fadeOut
,
remove
));
}
},
/**
...
...
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