createjs soundjs的注册和预加载

播放声音前必须注册,registerSound 可以注册单个声音,registerSounds注册一堆声音,如果你在使用play播放之前或createInstance方法创立实例前没有注册,声音也会自动注册,但是重新播放可能会失败,因为声音没有准备好。如果你使用了preloadjs,声音加载完毕就会被注册(registration is handled for you)推荐使用内部注册函数或...

继续阅读 »

createjs 获取不到Bitmap宽度的问题

昨天做测试,bitmap一直获取不到宽度废了好多时间,跟热心网友一起调试后发现是图片加载后才能获取宽高当然这也很合情合理是我错了大致是这样示例[pcsh lang="js" tab_size="4" message="" hl_lines="" provider="manual"] var image = new Image(); // 新建dom img元素 image.src = &...

继续阅读 »

easljs 精灵集

示例[pcsh lang="js" tab_size="4" message="" hl_lines="" provider="manual"]function init(){ var stage = new createjs.Stage('gameview'); var image = new Image(); var data; var spriteS...

继续阅读 »

easljs Shape 类

使用方法:会生成一个Graphic实例,用graphics属性可以获取他示例:[pcsh lang="js" tab_size="4" message="" hl_lines="" provider="manual"]var shape = new createjs.Shape(); shape.graphics.beginFill("#ff0000").drawCi...

继续阅读 »