- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
大家好,我想问一下。我用 Flash CC 和 createJS 制作了一个游戏。这是一个拖放游戏(3 个对象用于拖放,3 个对象用于放置)和很多矢量动画片段对象。但是当我在手机上运行它时,游戏看起来有性能问题。我读过一些关于 caching
对象的文章。但我真的对 cache
一无所知,也不知道如何在像 movieclip 这样的对象上使用它。您有任何解释或解决方案,或者如何使用 cache
功能的教程吗?非常感谢。
最佳答案
来自文档:
Draws the display object into a new canvas, which is then used for subsequent draws. For complex content that does not change frequently (ex. a Container with many children that do not move, or a complex vector Shape), this can provide for much faster rendering because the content does not need to be re-rendered each tick. The cached display object can be moved, rotated, faded, etc freely, however if its content changes, you must manually update the cache by calling updateCache() or cache() again. You must specify the cache area via the x, y, w, and h parameters. This defines the rectangle that will be rendered and cached using this display object's coordinates. http://createjs.com/Docs/EaselJS/classes/DisplayObject.html#method_cache
因此,您不想缓存正在播放的 MovieClip(您必须每帧都更新缓存,这很慢)。但是,您可以在 MC 中缓存刚刚被转换的元素。
例如,行走角色的动画, ARM 、腿部、头部和 body 的复杂矢量形状经过变换(缩放、旋转、平移)以创建行走动画。您不会缓存角色 MC,但可以缓存 body 部位本身。
关于html - 如何使用 createJS 和 Flash CC 在 Movieclip 上使用缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29028144/
如何在 createjs 中显示自定义光标?我在 Canvas 上渲染了多个图像/位图。我希望每当我单击特定位图时光标更改为特定图像。也就是说,单击图片 1 时,光标将变为画笔图像,单击图片 2 时,
我在 CreateJS/TweenJS 中有多个 Tweens: createjs.Tween.get(elem1).to({..}); createjs.Tween.get(elem2).to({.
我在 creatJS 方面遇到问题,希望您能提供帮助。 var stage = new createjs.Stage(canvas); 我收到此错误: angular.js:13642 Refere
我的项目是从服务器加载的。我使用 preloadjs 加载图像,然后使用它创建位图。加载图像后,可以使用以下命令创建位图新的createjs.Bitmap(路径);如果使用 firfox,但在使用 C
我正在制作一个射击游戏,其中我需要通过将子弹绑定(bind)到“tick”事件来更新子弹的状态,但是当调用删除方法将它们从“tick”事件中删除时,它不会将其删除。创建新实例后,它会不断更新,而不是绑
我试图将这个 h1 插入到 canvas 中。但它没有显示。无论如何,将 w3school html 集成到 Canvas 中,而无需使用 easeljs 程序创建文本。我将其添加到 Canvas 内
如何在createjs中仅在对象的右侧和底部绘制阴影。物体上或顶部和左侧没有阴影。 阴影仅包含 4 个参数 1.阴影的颜色 2. x 3. 年 4.模糊效果 但它没有说明 4 个不同的方面。 var
在 CreateJs 中,Firefox 呈现的文本对象的顶部位置与其他浏览器略有不同,而形状对象没有显示这种差异。 例如, this.text = new cjs.Text("Click to St
希望有人能帮忙。 我在 CreateJS 中有一个游戏工作正常,添加了暂停按钮的功能,也工作正常,除了暂停按钮不可见,但我的所有其他对象都是:(如果我单击我知道暂停按钮所在的位置该功能有效,但我只是看
我正在尝试使用 createjs 版本 8 中的新继承模型。我想让 Tile 继承自 createjs.Shape这是最基本的代码。 //This is the Tile constructor fu
这个问题已经有答案了: easeljs not showing bitmap (1 个回答) 已关闭 6 年前。 我怀疑答案就在 PreloadJs 中但是,我已经在我的 code 中删除了对它的修改
我正在使用这个 fiddle 中的代码: https://codepen.io/rauluranga/pen/KwoBdE 我想使用此代码使我的oes.container 中的每个对象都具有随机移动。
我正在开发一个 createjs 游戏,其中图像保存在容器内。我想将图像补间到屏幕上的某个位置并将图像切换到另一个图像。几秒钟后,我想从 Canvas /屏幕中删除新图像。 目前,我正在将 (evt)
我尝试将自己的方法添加到 Tween 类中以暂停/恢复所有补间。这就是我所拥有的: createjs.Tween.pauseAllTweens = function() { for ( var
这是图形: http://snag.gy/aVFGA.jpg 大矩形是 Canvas 元素,小矩形是 Canvas 中的图像对象。我想找到离左边的实际距离是多少。 值是我在控制台中看到的值: regX
我不知道我的代码有什么问题。我对 javascript 很陌生。有时 createjs 会工作,有时则不会。这没有意义,因为我正在从其他人的教程中复制精确的代码。
所以, 我刚开始学习 CreateJS,我遇到了我的第一个问题:我无法让补间工作(我希望它应该工作)。 示例如下:http://www.hakoniemi.net/labs/createjs-test
我想更改父容器内 2 个子容器的坐标。最初,我循环遍历父容器的子容器并单独更改它们的 x,y...但随后更改父容器的 x,y 更有意义>... 问题是...我需要获取每个子项的单独更改坐标...但是更
我尝试通过 SoundJS 声音注册加载声音,并收到以下错误: createjs.js:15 Uncaught Error: Type not recognized. 我认为 soundjs 库在定位
所以我尝试使用 Createjs 对矩形大小进行动画处理。我发现有两种方法可以创建矩形。要么: var rectangle = new createjs.Rectangle(0,0,100,100);
我是一名优秀的程序员,十分优秀!