当前位置:网站首页>Cocoscreator plays spine animation
Cocoscreator plays spine animation
2022-06-26 06:58:00 【RemoteDev】
1. establish 2D Air Engineering

2. The project opens the default scene , Canvas has been added to the default scene

3. Add an empty node to the canvas

4. Named node is NodeSke
5. Add bone animation (Spine) Component to empty node

After successful addition , Click on NodeSke node , You can see that... Has been added to the property inspector sp.Skeleton node
6. take Spine Drag the animation folder to assets Catalog

an Spine Animation catalog girl You can see the relevant animation files

7. take Spine Animation json Drag files to Skeleton Data in
Select the specified skin


After selecting skin , The animation canvas appears at the hollow node of the scene

8. Adjust the animation position
Animation position adjustment OK
Save the scene just made as main

9. Select the camera , And switch Layer by UI_2D, You can see that the camera has rendered the canvas in the scene

10. Click preview to view the effect in the browser

11. Select the empty node NodeSke, Then select the animation to play by default in the attribute inspector on the right

Now? , In the browser, you can see Spine The animation has been played automatically

12. Control animation playback through scripts , stop it , And switch animation skin
a. Add script file

b. by NodeSke Node to add a custom script
c. Double click the script to open VSCODE And in girl.ts Add methods to play animation and stop animation

d. Nodes are associated with variables
Drag nodes into variables
e. Add animation control buttons

f. Add variable associations for buttons

g. Add click event associations for buttons


coded Spine Animation play , stop it , Skin change function
// Play animation
playAnimation(){
this.SkeObj.setAnimation(0,"dance",true);
}
// Stop Animation
stopAnimation(){
let SpEnt:sp.spine.TrackEntry = this.SkeObj.setAnimation(0,"dance",true);
SpEnt.animationStart = SpEnt.animationEnd;
}
// Skin peeler
changeSkin() {
const skins =['girl', 'boy', 'girl-blue-cape', 'girl-spring-dress'].map(x=> `full-skins/${x}`);
this.skinId = (this.skinId + 1) % skins.length;
this.SkeObj!.setSkin(skins[this.skinId]);
}
demonstration :
边栏推荐
- Fmt Must the result of println (true) be true?
- Phantom star VR equipment product details II: dark battlefield
- Shell编程-用户信息管理
- [digital signal processing] basic sequence (unit step sequence | relationship between unit step sequence and unit pulse sequence | rectangular sequence | relationship between rectangular sequence and
- Installation and login of MySQL database
- 高德地图使用自定义地图无效问题
- Dpdk - tcp/udp protocol stack server implementation (I)
- [micro service series] protocol buffer dynamic analysis
- Temperature alarm
- Go learning notes 1.3- data types of variables
猜你喜欢
![[image fusion] MRI-CT image fusion based on gradient energy, local energy and PCA fusion rules with matlab code](/img/fc/fd81dedaa6b7c7542f9d74b04f247c.png)
[image fusion] MRI-CT image fusion based on gradient energy, local energy and PCA fusion rules with matlab code

If you meet a female driver who drives didi as an amateur, you can earn 500 yuan a day!

Guide to "avoid dismissal during probation period"

On a classical problem

Pytorch builds CNN LSTM hybrid model to realize multivariable and multi step time series forecasting (load forecasting)
![[image detection] image saliency detection based on ITTI model with matlab code](/img/f3/a8b13431724059f8c8a77961778c67.png)
[image detection] image saliency detection based on ITTI model with matlab code
![[image fusion] multimodal medical image fusion based on coupled feature learning with matlab code](/img/50/e48b9fa1cfbbb183285a8e41c77119.png)
[image fusion] multimodal medical image fusion based on coupled feature learning with matlab code

遇到女司机业余开滴滴,日入500!

Kotlin compose state recovery remembersaveable and remember

C# Nuget离线缓存包安装
随机推荐
Load balancer does not have available server for client: userService问题解决
I use flask to write the website "II"
China polyphenylene oxide Market Development Prospect and Investment Strategy Research Report 2022-2027
MySQL 数据库的小白安装与登录
淺析一道經典題
Simple use of typescript's class interface
My SQL(二)
Turris omnia: an open source router technology favored by hackers
Market development status analysis and investment risk outlook report of China's battery industry 2022-2027
Go learning notes 1.3- data types of variables
NumPy学习挑战第四关-NumPy数组属性
Solve the problem of transparency at the bottom of dialog
China imported wine circulation and investment market survey and Future Development Trend Outlook report 2022-2027
Solution of garbled code in sparkshell deletion key of SecureCRT
【图像融合】基于耦合特征学习的多模式医学图像融合附matlab代码
[feature extraction] feature selection of target recognition information based on sparse PCA with Matlab source code
On a classical problem
同步通信和异步通信的区别以及优缺点
NumPy学习挑战第五关-创建数组
Load balancer does not have available server for client: userservice problem solving