Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hello_canvas
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
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
wildfirecode13
hello_canvas
Commits
90e7f514
Commit
90e7f514
authored
Aug 31, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
08e554f2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
README.md
README.md
+21
-1
No files found.
README.md
View file @
90e7f514
# hello_canvas
1、在spark web短里添加一个Canvas节点。
2、导出
3、spark init --target xx.json
4、会自动生成project/src/canvas/game。然后再
cd src/canvas/game
npm i
npm run dev
5、只需要关注project/src/canvas/game/src/scenes/StartScene.ts,这是canvas game的入口。
6、在StartScene.start开始写代码
#添加图片
1、spark web端上传图片
2、导出,处理冲突
3、复制project/src/resconfig/resList.js到project/src/canvas/game/resCanvasList.js
4、添加图片
var bg: FYGE.Sprite = new FYGE.Sprite();
bg.x = 0;
bg.y = 0;
bg.texture = RES.getRes(
resCanvasList
[
"4ee17a9c-5deb-43be-b205-16fb7593d172"
]
.url
);
this.addChild(bg);
\ No newline at end of file
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