FAQ Database Discussion Community


Do you know inheritance in createjs?

createjs
Anyone have any experience with inheritance and createjs. I am trying to extend the createjs.Container class with my button class but I am getting the following error in my browser console. Eveything seems to be working fine which makes me think the problem must be when the page loads. I...

How can I draw a line with easeljs-0.8.0.js?(createJs)

javascript,html5,canvas,createjs
guys. I use easeljs-0.8.0.js to draw a line, but it doesn't work, can you help me? <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <script src="lib/easeljs-0.8.0.js"></script> </head> <body> <canvas id="demoCanvas" width="1200" height="600"></canvas> </body> <script> window.onload = function() { var canvas = document.getElementById("demoCanvas"); var stage = new createjs.Stage(canvas); var lineShape =...

removeChild() not working using easeljs

javascript,easeljs,createjs
I am using easeljs to create a stage and then i am putting tiles on the stage on random locations. When the user clicks on a tile, the tile must be removed from the stage. There are two problems that i am facing. First was that the mouse event was...

Createjs DomElement Create a Form

javascript,html5-canvas,createjs
I am creating an app in Cordova and I'm using Createjs for all of my graphics. If I want to create a form so users can input their names - would I just use a textarea field (in a DIV) and just call it in a DomElement, or is there...

Angular and CreateJS not finding the stage element

javascript,angularjs,easeljs,createjs
I have an Angular view that is inherited from an ng-view element. In the view file, I have a canvas. The code is controlled by a controller. What I want to do is call up a stage to add elements on the canvas. However when I run the createJS.Stage function,...

How to get real FPS with createjs

android,mobile,easeljs,createjs
I created a game with createjs, but it runs very slowly on a mobile. I added a function to show FPS obtained with createjs.Ticker.getMeasuredFPS(). However, the FPS shown by the function is quite normal. I set the FPS to 60, and the result of getMeasuredFPS() is about 55-60, while the...

CreateJS get the total frame number of a spritesheet

createjs
I am building a spritesheetbuilder class when I can pass in spritesheets that may have a different number of total frames and I would like to know is there a way to dynamically find out how many frames there are in a spritesheet and then loop through them all without...

CreateJS - d.mousedown.f error on hitAreas

javascript,easeljs,createjs
While programming in CreateJS I have encountered a bug: Unhandled exception at line 13, column 10113 in https://code.createjs.com/createjs-2014.12.12.min.js 0x800a138f - Runtime Error JavaScript code: Can not retrieve "matrix" properties for undefined or empty appeal This bug appears only when I add a hit area into an image: function drawButton(e) {...

how to clone Movieclip by Java script

createjs
i try to clone Movie clip that contain motion and graphics by java script i have the following error: Uncaught Movie Clip cannot be cloned. I wonder how this is accomplished?

Use of .apply() on CreateJS method bezierCurveTo gives error

javascript,createjs
I've got a problem using the apply() method from Function.prototype.apply(). I'm trying to create a series of drawings on my CreateJS stage by passing arrays of arguments to the bezierCurveTo method using apply(). This will allow me to loop through about a hundred such sets of arguments and draw a...

Drag and drop doesn't work in chrome using EaselJS

javascript,google-chrome,createjs
I've been trying to implement some drag and drop functionality for a Bitmap in EaselJS. Anyways, it works just fine in Firefox and IE, but nothing happens when I try to run the code in Chrome. All of the code is local, as is the image. Here's a brief overview...

Easeljs snap to grid

javascript,canvas,drag-and-drop,easeljs,createjs
I am building an app using HTML5 in which a grid is drawn. I have some shapes on it that you can move. What I'm trying to do is to snap objects to some points defined when you hover them while moving a shape. What I tried is to save...

How to get container dimension?

flash-cs6,createjs
How to get width and height of a movieClip in createjs? What I am doing is creating a shape, then convert to movieClip, and give it a name, I can access the instance using the name in js, but I can't get the width and height? Is there any idea...

Flash to Html5 Canvas: slow vector graphics

flash,html5-canvas,vector-graphics,fps,createjs
I'm a Flash developer and have many games developed in the past. Now I'm going to convert them (if possible) to HTML5/CreateJS. I've used CreateJS toolkit that is built into Flash CC to convert my game. Converted game performs good on my Desktop, but unacceptable slow on any mobile device...

How to get a random color in my CreateJS shape?

javascript,random,easeljs,createjs
I want to have a random color where "Crimson" is defined var stage = new createjs.Stage("demoCanvas"); var circle = new createjs.Shape(); circle.graphics.beginFill("Crimson").drawCircle(0, 0, 50); circle.x = 100; circle.y = 100; stage.addChild(circle); stage.update(); ...

Create a Sprite from raw RGBa data

html5,html5-canvas,easeljs,createjs,sprite-sheet
I take several snapshots from playing video on canvas and thus getting raw RGB images into memory. In the documentations its states that Sprite class accepts a Spritesheet instance only. Is there any way to create a Sprite from raw RGBa? Or maybe convert that raw data into separate Bitmap...

Inherit two classes - Javascript

javascript,inheritance,multiple-inheritance,easeljs,createjs
I'm creating a new class definition Button that extends an existing Container class in EaselJS. There are no problems with that. However, I'd also like Button to inherit from a super class All, so that Button also has access to its .banana and .eatBanana. How do I go about this?...

CreateJS - Issue loading sounds in IE11

createjs,soundjs,preloadjs
I've run across a weird issue with sound file loading in IE11. I have a manifest of about a dozen images and then about 8 sound files. What's happening is versions of IE11 that have even the slightest modifications in the security settings are hanging up when trying to load...

CreateJS - Measuring FPS in RAF (requestAnimationFrame) mode

easeljs,createjs
I am using CreateJS in the RAF mode createjs.Ticker.timingMode = createjs.Ticker.RAF; How do I integrate with for instance stats.js measure the browser's FPS? Or is there any different, recommended way to measure the FPS with CreateJS? Thanks!...

createjs struggling with hitTest()

javascript,easeljs,createjs
I am populating the canvas with small circles to form a shape and would like to destroy some of the circles where ever user clicks on the screen using the following function. dotsArray : is the array of all circles dot.ball: is the circle being drawn bomb: is the circle...

How to convert Greensock's CustomEase functions to be usable in CreateJS's Tween system?

createjs,tween,easing,greensock,easing-functions
I'm currently working on a project that does not include GSAP (Greensock's JS Tweening library), but since it's super easy to create your own Custom Easing functions with it's visual editor - I was wondering if there is a way to break down the desired ease-function so that it can...

How should I create a responsive canvas with createJs to adapt different mobile device's screens?

html5,canvas,responsive-design,createjs
I want to develop a html5 mobile game. As you know, the screens of mobile devices are different size, so I want to create a responsive canvas so that it can adapt different screen.

createjs.Shadow alpha

alpha,shadow,createjs
Can the alpha of a drop shadow created with createjs.Shadow be controlled independently of the object it's attached to? I tried, simply: myObject.shadow = new createjs.Shadow("#000000",200,200,15); myObject.shadow.alpha=0.2; But that's a no go. Can't find anything in the API docs, but those are all pretty damn confusing to begin with....

Showing uncaught type error in CreateJS. Not showing any output..my code is given below

javascript,easeljs,createjs
its showing some error in createjs file. <html> <head> <title></title> <script src="https://code.createjs.com/createjs-2014.12.12.min.js"> </script> <script> var preload,cW,cH,winW,winH; var road,city1,city2,sky,build1,build2; window.onload = function(){ var canvas = document.getElementById("demoCanvas"); var stage = new createjs.Stage(canvas); cW=1200; cH=600; preload = new createjs.LoadQueue(true); var manifest =[{id:"ad_road",src:"road.png"}, {id:"ad_build1",src:"build.png"},...

How to change the width of a movieclip in flash html5 canvas?

createjs,flash-cc,flashcanvas
I was created a new project using flash cc html5 canvas and created a movieclip with 200px width and 200px height. I can able to get the properties using this.mc.nominalBounds;. And I tried this.mc.getBounds (); But it returns null. setBounds also not seems to work.

Size limitation when drawing to CanvasRenderingContext2D

html5-canvas,easeljs,createjs
I HAVE HEAVILY EDITED THIS QUESTION TO PROVIDE MORE DETAILS I came across a limitation when drawing to CanvasRenderingContext2D via EaselJS framework. I have objects like this: but when the position of those objects surpasses couple million pixels the drawings start to crumble apart. This is the same object with...

How to create blocked animation with Tween.js?

javascript,createjs,tween.js
I have this moveStep() function to make the Sprite move a step with Tween.js, createjs.Tween.get(this.lion).to({x: x, y: y}, 300); but if moveStep() is called more than once, the result is the same as when called once (x, y are calculated in the function). What is the practical way to chain...

Createjs create timer clock for game

javascript,html5,cordova,easeljs,createjs
Does anyone know the best way to create a timer clock in Createjs please? I know I could do something in html and reference it with the DOMElement, but I have had a bit of a nightmare getting that to work in the past? Basically I need to show a...

Delaying preloadjs for fixed time for testing

javascript,easeljs,createjs,preloadjs
Is there a way in preloadjs to delay the loading of resources by say 2 seconds just for testing purpose to see the animation in action. As in localhost the files are loaded very quickly. Thanks in advance....

Bitmap rotation in circular path CreateJS Tweenjs

javascript,html5-canvas,createjs
I'm trying to rotate a bird in circular path but the problem is the to method doesn't give much control to do the exact thing, I 'm trying to move the bird head up or down with the rotation. Here is my fiddle http://jsfiddle.net/HF765/142/ var tween = createjs.Tween.get(shape, {loop: true})...

Collision between two objects ndgmr.checkPixelCollision

createjs
I am trying to detect for a collision between two objects that are wrapped inside of two different containers. I am using a collision detection script found here https://github.com/olsn/Collision-Detection-for-EaselJS/tree/master/example/js. I can get the ndgmr.checkRectCollision working but then the transparent areas of my bitmaps are also dectected in the the collision...

EaselJS cache Text object

caching,rendering,easeljs,createjs
I would like some help regarding caching Text objects using EaselJS library. I never fully understood how caching works, and i must be missing something really fundamental, because i cannot seem to make it work. Take the following simle example. this.label.cache(this.label.x, this.label.y, rec.width, rec.height); https://jsfiddle.net/xnqcjsg8/ If you comment the line...

SoundJS — sounds played via instances not working in IE

internet-explorer,createjs,soundjs
I've run into some inconsistent behaviour between browsers with SoundJS, namely that IE11 is stingy about playing from Abstract Sound Instances. The following code works in every other browser I've tested, but not in IE11: <html> <head> <script src="https://code.createjs.com/soundjs-0.6.1.min.js"></script> <script> var sounds = {} function loadSounds() { createjs.Sound.registerSound('audio/song.mp3', 'song', 1);...

Touch Events not registering for HTML5 Canvas Authoring using Flash CC

javascript,html5,flash,canvas,createjs
I have been having some issues when it comes to authoring HTML 5 Canvas in Flash CC, mostly as a result of the lack of information on writing JavaScript inside Flash. I have been converting an existing drag and drop .fla into HTML 5 with the hope of making it...