canvas

How to select covered objects via mouse in fabricJS?

时光总嘲笑我的痴心妄想 提交于 2021-02-18 08:24:15
问题 I'm trying to develop a way to select objects that are layered below and (totally) covered by other objects. One idea is to select the top object and then via doubleclick walk downwards through the layers. This is what I got at the moment: var canvas = new fabric.Canvas("c"); fabric.util.addListener(canvas.upperCanvasEl, "dblclick", function (e) { var _canvas = canvas; var _mouse = _canvas.getPointer(e); var _active = _canvas.getActiveObject(); if (e.target) { var _targets = _canvas

How to select covered objects via mouse in fabricJS?

你离开我真会死。 提交于 2021-02-18 08:23:47
问题 I'm trying to develop a way to select objects that are layered below and (totally) covered by other objects. One idea is to select the top object and then via doubleclick walk downwards through the layers. This is what I got at the moment: var canvas = new fabric.Canvas("c"); fabric.util.addListener(canvas.upperCanvasEl, "dblclick", function (e) { var _canvas = canvas; var _mouse = _canvas.getPointer(e); var _active = _canvas.getActiveObject(); if (e.target) { var _targets = _canvas

Preloading huge amount of images

我的未来我决定 提交于 2021-02-18 07:39:54
问题 I'm trying to do a parallel preload of images using the logic implemented on the below link. http://blog.lieldulev.com/2010/05/21/parallel-image-preloading-in-js/ I have a huge amount of images, currently 350+ images with an average of 50KB file size each, amounting to a total of 20MB of images im trying to preload. I need the images for canvas drawing. Using the above logic of parallel downloading, I'm having issues of the browser waiting for 2mins to finish loading the whole page. sometimes

Is WebGL or Canvas the only way to get SVG Keyframe Animations Hardware Accelerated?

岁酱吖の 提交于 2021-02-18 03:44:49
问题 What I'm looking is a flash alternative for mobile phones using html5. I was looking into SVG and it seems the only way to get hardware acceleration is to use CSS transforms on it. But CSS transforms aren't enough, I want to animate the actual nodes that make up a vector (ie, points on a path) so I could get more sophisticated character animation. To do this I was looking at some gui based editors. I checked what adobe has been up to and they seem to have killed Edge Animate and rebranded

Canvas image drawing order

雨燕双飞 提交于 2021-02-17 03:13:32
问题 I'm making a simple engine for isometric games to use in the future. The thing is i'm having trouble drawing on the canvas. Take for instance this code: function pre_load() { var imgs = ['1', '1000','1010','1011','1012','1013']; var preload_image_object = new Image(); $.each(imgs,function(i,c){ preload_image_object.src='img/sprites/'+c.logo+'.png'; }) } function GameWorld() { //[...] this.render = function() { this.draw(1000, this.center); this.draw(1013, this.center); this.draw(1010, this

Canvas image drawing order

偶尔善良 提交于 2021-02-17 03:13:16
问题 I'm making a simple engine for isometric games to use in the future. The thing is i'm having trouble drawing on the canvas. Take for instance this code: function pre_load() { var imgs = ['1', '1000','1010','1011','1012','1013']; var preload_image_object = new Image(); $.each(imgs,function(i,c){ preload_image_object.src='img/sprites/'+c.logo+'.png'; }) } function GameWorld() { //[...] this.render = function() { this.draw(1000, this.center); this.draw(1013, this.center); this.draw(1010, this

Canvas image drawing order

蹲街弑〆低调 提交于 2021-02-17 03:12:28
问题 I'm making a simple engine for isometric games to use in the future. The thing is i'm having trouble drawing on the canvas. Take for instance this code: function pre_load() { var imgs = ['1', '1000','1010','1011','1012','1013']; var preload_image_object = new Image(); $.each(imgs,function(i,c){ preload_image_object.src='img/sprites/'+c.logo+'.png'; }) } function GameWorld() { //[...] this.render = function() { this.draw(1000, this.center); this.draw(1013, this.center); this.draw(1010, this

Canvas that created from video raising “Tainted canvases may not be exported.” error when saving

醉酒当歌 提交于 2021-02-16 21:01:50
问题 I'm creating snapshot from HTML5 video, using this example. Video is hosted on 3rd party servers, that I can't control. So I wanted to save image, but toDataURL failing because of security reason. Here is error: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. I guess there is a solution for image. img.crossOrigin = "Anonymous" something like that. Here and here. I tried videoDomElm.crossOrigin = "Anonymous" , but no luck. Is there any solution for

Canvas that created from video raising “Tainted canvases may not be exported.” error when saving

不问归期 提交于 2021-02-16 21:00:58
问题 I'm creating snapshot from HTML5 video, using this example. Video is hosted on 3rd party servers, that I can't control. So I wanted to save image, but toDataURL failing because of security reason. Here is error: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. I guess there is a solution for image. img.crossOrigin = "Anonymous" something like that. Here and here. I tried videoDomElm.crossOrigin = "Anonymous" , but no luck. Is there any solution for

Canvas that created from video raising “Tainted canvases may not be exported.” error when saving

被刻印的时光 ゝ 提交于 2021-02-16 21:00:22
问题 I'm creating snapshot from HTML5 video, using this example. Video is hosted on 3rd party servers, that I can't control. So I wanted to save image, but toDataURL failing because of security reason. Here is error: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. I guess there is a solution for image. img.crossOrigin = "Anonymous" something like that. Here and here. I tried videoDomElm.crossOrigin = "Anonymous" , but no luck. Is there any solution for