简体   繁体   English

在cocos2d-x v3中绘制和添加大量精灵(〜200)的最佳方法是什么?

[英]What is the most optimal way to draw and add to a scene a large number of sprites(~200) in cocos2d-x v3?

The sprites are running an animation all the time they are being displayed. 精灵一直在显示动画。

I have tried: 我努力了:

  • Creating and adding them to the scene on the fly and some of them experience a noticeable lag when they are added to the screen. 动态创建和添加它们到场景中,其中一些在添加到屏幕时会出现明显的滞后。

  • Creating them before hand and keep them added in the scene but hidden. 事先创建它们,并将其添加到场景中但隐藏。 However when I position and display them, a noticeable lag freezes the game for less than a second. 但是,当我放置并显示它们时,明显的滞后将游戏冻结了不到一秒钟。

These sprite frames and animation are loaded when the game starts in their corresponding cache from spritesheets and plist files. 当游戏从spritesheets和plist文件进入其相应的缓存时,将加载这些sprite框架和动画。

Any ideas to minimize the lag? 有什么想法可以将延迟最小化吗? or any other approach? 或任何其他方法?

Actually you have to use "Spine" to add multiple/large no. 实际上,您必须使用“脊柱”添加多个/大号。 of Animations into a scene. 动画进入场景。 Cocos2dx3.x support "Spine" api ie "cocos2d-x-3.10/cocos/editor-support/spine". Cocos2dx3.x支持“ Spine” API,即“ cocos2d-x-3.10 / cocos / editor-support / spine”。 And here are some good examples:- spine-runtimes 这是一些很好的例子: -spine运行时

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM