createjs

CreateJS getObjectsUnderPoint when alpha = 0

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 04:14:59
问题 I need to get all bitmaps under point in a container. The bitmaps alpha is set to 0 and this doesnt seem to work with this method. Are there any alternatives? I cant just add an event listener to the object as that is not enough in this scenario. Thanks 回答1: 1) If you just want to get the objects under a point you'd have to loop through all children of the container and call hitTest(x,y) (http://www.createjs.com/Docs/EaselJS/classes/DisplayObject.html#method_hitTest) this ignores the alpha

Set map borders to not cross inside the view area

六月ゝ 毕业季﹏ 提交于 2019-12-13 03:44:14
问题 I am trying to translate an old flash animation with animate. On the original flash animation the map image is draggable and zoomable but the map ´s borders always stick to the sides of the stage if you pan it or zoom it all the way. On my test i grabbed some code that allows panning and zooming but the map crosses the stage boundaries if you pan all the way, in fact you can make the map dissapear of the stage. I think there should be a way to draw like a secondary outer stage and not let the

EaselJS sprite on("click) returns CORS error

本秂侑毒 提交于 2019-12-13 01:11:24
问题 First off, I am working on a local EaselJS/CreateJS project, only to test some sprite and mouse interaction. I have added a simple sprite image to the stage, and I called it "enemy1": //Create the enemy sprite and add it to the stage var enemy_image = new Image(); enemy_image .src = "enemy_sprite.png"; var enemy1 = new createjs.Bitmap(enemy_image); enemy1 .x = 0; enemy1 .y = 0; stage.addChild(enemy1); Using this code, I want to show an alert every time the user clicks on it: enemy1.on("click"

HTML5: createjs images not displaying (intermittent)

走远了吗. 提交于 2019-12-12 06:05:50
问题 I have a HTML5 composition using createjs and associated libraries (via Flash CC 2014). However, sometimes images that are loaded in through the manifest fail to display when the composition is loaded. I have tried making multiple requests for the image file in the manifest but alas, to no avail. I have tried switching to sprite sheets but then sometimes the sprite sheet image itself fails to display! Does anyone know if anything can be done to stop this happening? I am unable to switch to an

Mouse down and moving drops chrome canvas to 30FPS using CreateJS

二次信任 提交于 2019-12-12 03:17:41
问题 I've been using the createjs Easeljs library for a few canvas game projects. In all I am impressed, but I have recently encountered a problem within chrome that is holding me back. When the left mouse button is down and the mouse moves the FPS is dropped to 30 on chrome (as reported by the developer tools). This is painfully obvious against the 60FPS the game normally runs at. To try to understand this I have stripped down a bare canvas and ticker, and the problem persists. So I am lost. The

collision detection using createjs

南笙酒味 提交于 2019-12-12 03:08:20
问题 I am a complete novice in createjs and wanted some guidance over this topic of collision detection. I have created some text objects using font awesome using a loop. Next I saved them in variable objx as id along with updating its position coordinates (x,y) in it. And here is the code for collision detection: createjs.Ticker.addEventListener("tick", function(){ var jx,jy,jt,t; for(var i = 0 ; i < objx.length-1 ; i++)objx[i].id.color="#8B0000"; for(var i = 0 ; i < objx.length-1 ; i++){ x =

Buffered audio in SoundJS

百般思念 提交于 2019-12-12 03:08:15
问题 I'm using SoundJS 0.5.2 to play audio in a music player that I'm designing for a client. According to the documentation, I have to register or preload an audio file before I can use it, by using the registerSound method of the Sound Class and the audio cannot be played before it is fully loaded. But how I do I go about buffering the audio while it is being played? Like wait till 10% of the audio is buffered, then play the song? Can this be accomplished using PreloadJS ? After Googling about

CreateJS : MovieClip.children doesn't update after gotoAndStop()

落花浮王杯 提交于 2019-12-12 02:14:56
问题 CreateJS (2015.11.26) via Animate CC (16.0.0.112) Structure : root - myContainer - frame 0 -> btn_0 - frame 1 -> btn_1 First frame of root contains following code : var self = this; createjs.Ticker.addEventListener("tick", initScreen); function initScreen() { createjs.Ticker.removeEventListener("tick", initScreen); self.myContainer.gotoAndStop(1); } this.myContainer.addEventListener("click", function(e) { console.log("Button 0 : "+self.myContainer.btn_0); console.log("Button 1 : "+self

Rotate the volume knob in html5 with createJS

自古美人都是妖i 提交于 2019-12-12 01:47:27
问题 I want to create volume knob using HTML5 and CreateJS. It is almost done. you can see this on following url http://www.urbantruanthosting.co.uk/radiosimulator/testpage.html but it is moving on every event of js. And I want to rotate on mouse's pressmove event on both side and currently it's moving clockwise, how can I rotate it in reverse. Please give me suggestion. Thanks in advance. and I have used following code. var bmp = new createjs.Bitmap(image).set({ scaleX: 1, scaleY: 1, regX: w / 2,

flash cc createjs hittest works without hit

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 01:38:29
问题 the rect should be alpha=0.1 once the circle touches the rect . but if statement not working . it becomes 0.1 opacity without hitting /* js var circle = new lib.mycircle(); stage.addChild(circle); var rect = new lib.myrect(); stage.addChild(rect); rect.x=200; rect.y=300; circle.addEventListener('mousedown', downF); function downF(e) { stage.addEventListener('stagemousemove', moveF); stage.addEventListener('stagemouseup', upF); }; function upF(e) { stage.removeAllEventListeners(); } function