easeljs

Infinite canvas with EaselJS

流过昼夜 提交于 2019-12-03 08:42:47
Is there any way to display an infinite canvas with EaselJS? I have read the ways to do it with Javascript or JQuery, but is there any way to manage it with EaselJS? Thanks! You can drag/drop the canvas itself using JavaScript/jQuery - but there is a built-in drag-and-drop model on EaselJS content. Check out the DragAndDrop samples in the examples folder. The main steps are: Listen for a mousedown event on something . You should use the built-in EaselJS events on any display object. You can't use the stage event "stagemousedown", because it doesn't expose the drag events you need, and the DOM

Countdown animation with EaselJs

▼魔方 西西 提交于 2019-12-02 13:28:32
问题 I am trying to simulate a countdown animation using easeljs. I have got an example of what it should look like. http://jsfiddle.net/eguneys/AeK28/ But it looks like a hack, is there a proper/better/flexible way to do this? To put it other way, how can i define a path, and draw that path with easeljs. This looks ugly: createjs.Tween.get(bar, {override: true}).to({x: 400}, 1500, createjs.linear) .call(function() { createjs.Tween.get(bar, {override: true}).to({y: 400}, 1500, createjs.linear)

Easeljs game project

旧街凉风 提交于 2019-12-02 09:57:06
I'm working on a game project but I have a a problem i received this error: NS_ERROR_NOT_AVAILABLE: ctx.drawImage(this.image, 0, 0); //Bitmap.js in Easeljs lib. I used the bitmap in the next codes. Please tell me if in this there is a problem and how to fix it. Thanks for collaboration. Code 1 : p.initialize = function(x,y ,stage, world){ var bmp = new Bitmap('../assets/blackBall.png'); //console.log(bmp) //alert(bmp) bmp.regX = radius; bmp.regY = radius; bmp.x=x; bmp.y=y; this.skin = bmp; stage.addChild(bmp); var fixDef = new b2FixtureDef(); fixDef.density = 1.0; fixDef.friction = 0.5; fixDef

Stuttering animation when spanning multiple sprite sheets in easeljs

眉间皱痕 提交于 2019-12-02 06:52:13
Using EaselJS, I have an animation that the user may scroll through with a custom slider. It uses 10 sprite sheets to display 152 frames of size 1924 x 1708. //images were declared above in style | var chromophoreAni0 = new Image(); | var data = { images: [chromophoreAniImage0, chromophoreAniImage1, chromophoreAniImage2, chromophoreAniImage3, chromophoreAniImage4, chromophoreAniImage5, chromophoreAniImage6, chromophoreAniImage7, chromophoreAniImage8, chromophoreAniImage9], frames: {count: 152, width: 356, height: 316}, animations: {all: [0, 151]} }; chromophoreSpriteSheet = new SpriteSheet

easel JS security restrictions on localhost machine

旧时模样 提交于 2019-12-02 01:56:51
问题 I'm learning EaselJS and I'm getting this weird error: Unable to get image data from canvas because the canvas has been tainted by cross-origin data. easeljs-0.6.0.min.js:71 Uncaught An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images. The thing is, both my images are from localhost - I have them stored in my root directory. This is what my code looks like: function init() { var canvas = document.getElementById

easel JS security restrictions on localhost machine

帅比萌擦擦* 提交于 2019-12-02 01:26:58
I'm learning EaselJS and I'm getting this weird error: Unable to get image data from canvas because the canvas has been tainted by cross-origin data. easeljs-0.6.0.min.js:71 Uncaught An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images. The thing is, both my images are from localhost - I have them stored in my root directory. This is what my code looks like: function init() { var canvas = document.getElementById("demoCanvas"); var stage = new createjs.Stage(canvas); var im = new createjs.Bitmap("dbz.jpg"); im

Javascript collision detection system don't ignore blocked collisions

回眸只為那壹抹淺笑 提交于 2019-12-01 19:59:37
I'm having issues during a minigame development using EaselJS with my collision detection system and I need someone's help. The issue occurs when the hero (a circle bitmap) collides an object and there's other object behind the first one, the hero collides with both objects, even if the second collision is blocked. Here's an image explanation: The cause of the problem is really simple, even if the problem itself isn't: This collision detection system is based on the future position of the circle (and not on its actual position), then if the next position of the circle intersect a rectangle, it

Drawing a Line in a html5 canvas using EaselJS

家住魔仙堡 提交于 2019-12-01 08:17:15
问题 I am very new to Easel and HTML5 itself. I am trying to draw a line using on a canvas using EaselJS. The X- Co ordinate is fixedd to 100 and the Y-Co ordinate is got from a array list. The code that i have written is given below. Could please someone let me know where i am going wrong? function myFunction(attachPoint) { //Code for canvas creation is written here.[Not shown]; //created a stage. stage = new createjs.Stage(canvas.domElement()); //3. create some shapes.MagnitudeLessThanTwo is the

EaselJS: glitchy drag/drop

▼魔方 西西 提交于 2019-11-30 15:45:35
问题 I have a bitmap inside of a container. When I drag the container the cursor changes to the edit-text shape, and also the image jumps to the bottom-right side of the cursor (as though I'm holding the image from the top-left corner and dragging it). Here's my code just so you can see that I've RTFM: function createIcon(imgPath) { var image = new Image(); image.onload = function () { var img = new createjs.Bitmap(event.target) var con = new createjs.Container(); con.x = 160; con.y = 100; con

EaselJS: glitchy drag/drop

空扰寡人 提交于 2019-11-30 15:34:55
I have a bitmap inside of a container. When I drag the container the cursor changes to the edit-text shape, and also the image jumps to the bottom-right side of the cursor (as though I'm holding the image from the top-left corner and dragging it). Here's my code just so you can see that I've RTFM: function createIcon(imgPath) { var image = new Image(); image.onload = function () { var img = new createjs.Bitmap(event.target) var con = new createjs.Container(); con.x = 160; con.y = 100; con.addChild(img); stage.addChild(con); con.on("pressmove", function(evt) { evt.currentTarget.x = evt.stageX;