Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
op_09
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
op_09
Commits
8c3be706
Commit
8c3be706
authored
Dec 06, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: loadSpriteByUrl
parent
7e19cd8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
op_09.js
play/assets/op_09/scene/op_09.js
+3
-0
No files found.
play/assets/op_09/scene/op_09.js
View file @
8c3be706
...
...
@@ -444,6 +444,9 @@ cc.Class({
// ------------------------------------------------
loadSpriteByUrl
(
node
,
url
,
cb
)
{
cc
.
loader
.
load
({
url
},
(
err
,
img
)
=>
{
if
(
!
node
)
{
cb
&&
cb
();
}
const
spriteFrame
=
new
cc
.
SpriteFrame
(
img
)
const
spr
=
node
.
getComponent
(
cc
.
Sprite
);
spr
.
spriteFrame
=
spriteFrame
;
...
...
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