easeljs

EaselJS - broken panning on zoomed image

我的梦境 提交于 2020-05-15 05:58:06
问题 I'm having trouble fixing panning in this example - it works fine unless you move the zoomed image and then zoom again(offset is set to default value and the view jumps to initial position - http://jsfiddle.net/p2Qzg/). Any ideas on how to fix that? I've been trying to solve that for three days now, without any good results. var canvas= document.getElementById("myCanvas"); canvas.width = window.innerWidth; canvas.height = window.innerHeight; var stage = new createjs.Stage("myCanvas");

看你有多色游戏

只愿长相守 提交于 2020-03-25 20:49:16
3 月,跳不动了?>>> 开发工具:pycharm 游戏介绍 : 这是一款小游戏,虽然名字有点猥琐,但是游戏确实是很纯洁的,纯洁到不能再纯洁了 。 这款游戏的玩法就是找出所有风格中颜色比较淡的,主要是考你的眼力和注意力 。 最开始是最简单的,轻易可以辨认出,越到后面就越难 , 方块越来越多,颜色的对比度也越来越小 , 到最后要非常专注才能看出 , 总之,这游戏就是在规定时间内尽可能的过更多关,对练眼还是有一定好处的,小伙伴快来玩吧 。 main.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <script src="js/easeljs.min.js"></script> <script src="js/Rect.js"></script> </head> <body> <canvas id =

围住神经猫

霸气de小男生 提交于 2020-03-25 20:22:46
3 月,跳不动了?>>> 开发工具: VS code 游戏案例: 围住神经猫 游戏玩法: 蓝色圆圈表示神经猫,用户点击灰色圆圈表示对神经猫的围捕,最终让神经猫无处可逃即可获胜。 运行效果图: 参考代码: easeljs-0.7.1.min.js为CreateJS套件的js 来源: oschina 链接: https://my.oschina.net/u/4463082/blog/3211445

JavaScript - extremely confused on removing elements from Container

☆樱花仙子☆ 提交于 2020-03-16 08:45:12
问题 I'm making a 2D, top-down Zelda style web rpg single player in JavaScript. When the player (purple shirt) walks near a cat, it will "rescue" it... which basically removes the animalContainer from the ContainerOfAnimals (thereby removing animalContainer's BMP from the stage), and then add the id of that animalContainer to a rescuedTotal_Array ... The weird thing is, In the pic below, I'm able to rescue animalContainer2 and then rescue animalContainer1 ... But if I go from animalContainer1 to

Bouncing ball code causes jitter in HTML5 canvas

…衆ロ難τιáo~ 提交于 2020-03-05 04:39:33
问题 I have a HTML Canvas on my website that I use to contain balls that drop into the canvas, they bounce around and have a real good time settling down at the bottom in a range of ways. I was under the impression this was working perfectly. However, it has now been brought to my attention these balls jitter and freak out on other people's computers. I checked the browser they are using and it is the same as mine (Chrome V79). So just to clarify - I have never had it bug on my computer but it

Bouncing ball code causes jitter in HTML5 canvas

本小妞迷上赌 提交于 2020-03-05 04:37:28
问题 I have a HTML Canvas on my website that I use to contain balls that drop into the canvas, they bounce around and have a real good time settling down at the bottom in a range of ways. I was under the impression this was working perfectly. However, it has now been brought to my attention these balls jitter and freak out on other people's computers. I checked the browser they are using and it is the same as mine (Chrome V79). So just to clarify - I have never had it bug on my computer but it

easeljs splitting an image into pieces

为君一笑 提交于 2020-01-21 23:53:14
问题 I'm new to easeljs and was wondering how would you split an image into a given number of pieces. From what I've gathered so far, I'm supposed to use SpriteSheets to accomplish this. However, the only tutorials I've seen are ones with multiple images in one Spritesheet, not one image divided into multiple images and put into a SpriteSheet. This is my code so far (I know that the variable frames is undefined since I cannot properly access the spriteSheet array yet): var data = { images: ["

easeljs splitting an image into pieces

微笑、不失礼 提交于 2020-01-21 23:52:08
问题 I'm new to easeljs and was wondering how would you split an image into a given number of pieces. From what I've gathered so far, I'm supposed to use SpriteSheets to accomplish this. However, the only tutorials I've seen are ones with multiple images in one Spritesheet, not one image divided into multiple images and put into a SpriteSheet. This is my code so far (I know that the variable frames is undefined since I cannot properly access the spriteSheet array yet): var data = { images: ["

How to protect js from custom events

久未见 提交于 2020-01-17 08:05:34
问题 I am writing a game on Javascript with canvas and easeljs and I wonder if there are any ways to protect it. For example, I use stage.Addchild(index) to add a new object to the stage. Simply editing DOM I can attatch new event handler and fire it, something like <body onclick="stage.removeChild(0)"> and this will remove all the stage objects one by one. I was thinking to filter all the coming events and check what had fired it. But I am not sure how to do that and there may be better ways to

EaselJS animate though frames based in current frame

蹲街弑〆低调 提交于 2020-01-16 19:13:07
问题 I'm working with EaselJS SpriteSheets and I want to know how I can make my hero stop running smoothly, So if the SpriteSheet is playing the "run" animation and it's on frame 5, I'll need to animate though frames 6, 7, 8, 8, 8, 7, 6, 5 and then stop on 0 in order make my hero stand still. How can I do that? Here's my SpriteSheet: Note that the frames aren't consecutive: They go from 0 to 4, 4 to 0 then 5 to 8. Frame 9 is unused. Here's my SpriteSheet code: user.hero.bmp = new createjs.Bitmap(