kineticjs

KineticJS drag multiple images without grouping them

被刻印的时光 ゝ 提交于 2019-12-11 09:05:41
问题 is it possible to drag all children elements of a layer without grouping them? I have different layers with image-elements and a path shape. The path draws a bubble around the images. If the user drag the bubble to another place, all images should move there, too. But it should be also possible to drag a single element. At the moment, it is possible to drag a single element and to drag the bubble, but there is no combination... 回答1: Yes, you can drag "related" nodes when a "container" node is

KineticJS .toImage() proper method for creating image from region / group

此生再无相见时 提交于 2019-12-11 08:18:02
问题 When using the .toImage() method in KineticJS, I always seem to get a much larger image than is really necessary, with the piece I need taking up only the top left corner of the data image. My stage is scaled based on window size and a pre-defined initial size (on window resize, resize stage function called which sets the scale and the size of the container). Should I be setting some sort of crop when I use toImage() to compensate for this? Looking at the image, it seems that the overall

I can't edit text on layer after add new layer using kineticjs

扶醉桌前 提交于 2019-12-11 06:38:40
问题 I have make this http://jsfiddle.net/62Wjc/5/, create and change text on layer but it's static. Now I make script for dynamic add fields + add layer + change layer. On my script have three functions, which are : Function CreateTxt for create element and create layer with KineticJS. Function fRField for remove element Function ChangeTxt for change text on layer. And this my script : $(document).ready(function() { var nwValue = []; var nwLayer = {}; var nwTxt = {}; var tulisan = 'Your text here

toDataUrl - saving Images in IE?

早过忘川 提交于 2019-12-11 06:08:55
问题 I have spent a lot of time building a dress-up game using KineticJS and I seem to have fallen at the final hurdle. I have created a 'Snapshot' button which I wanted to allow my users to print the canvas to a window or tab. Here is a snippet of my code: Camera.prototype.takeSnapshot = function() { var backgroundLayer = this.controller.view.getBackgroundLayer(); var backgroundContext = backgroundLayer.getContext(); var manikinLayer = this.controller.view.getManikinLayer(); var manikinCanvas =

Use Font Style on HTML5 Canvas

只愿长相守 提交于 2019-12-11 04:24:47
问题 I am trying to add text on a canvas using kinetic JS library. Kinetic JS Provides the setFontStyle() method to support the styles on fonts. http://kineticjs.com/docs/symbols/Kinetic.Text.php#setFontStyle According to the documentation It supports 'normal', 'italic', or 'bold'. But what I do if I want to apply bold and Italic at once. Also I want to underline the text. How I can do in kinetic JS. Isn't there anyone to tell me :'( 回答1: Like EliteOctagon already mentioned, KineticJS does not

How can I combine alpha with compositing in Images?

无人久伴 提交于 2019-12-11 04:22:05
问题 I have an HTML5 Canvas. I am using the KineticJS(KonvaJS) canvas library. The canvas contains an Image as shown below. Now I want to erase pixels but being combined with a certain transparency level. The red dot erases the pixels with transparency 0. This was solved in this question. The green dot erases the pixel with transparency level of 0.5. The higher the transparency the smaller is the effect of the eraser. How can I define the strength of the eraser? 回答1: You can use 'destination-out`

How to make dragable texts with curve using Kinetic js in canvas?

自古美人都是妖i 提交于 2019-12-11 04:19:06
问题 Can anybody have an idea , how to make text curves on dragable text using kinetic js in html5. 回答1: check out the TextPath shape. It enables you to draw text along curves: http://kineticjs.com/docs/symbols/Kinetic.TextPath.php Will put up a tutorial as soon as possible. 来源: https://stackoverflow.com/questions/14079861/how-to-make-dragable-texts-with-curve-using-kinetic-js-in-canvas

How to get the position of a click event relative to its layer in KineticJS?

旧街凉风 提交于 2019-12-11 04:03:04
问题 I'm developing a hex-grid strategy game in HTML5, and since it becomes complicated to add more buttons to UI, I'm rewriting my code using KineticJS to draw the canvas. In my game, there is a minimap, and a rectangle in it showing the position of player's camera. When the player clicks on the minimap, the center of his camera will be set to the position he clicked. My original code does not use any external library, and it looks like this: this.on('click', function(event){ var canvas =

KineticJS wont load in Internet Explorer

こ雲淡風輕ζ 提交于 2019-12-11 03:47:54
问题 I got a seriously annoying problem - I just made a cute script in KineticJS - http://test.manwe.cz/kolac.php As You can see, it works flawlessly in Chrome/FF, but in IE it just says that I cant use the method "indexOf" and points somewhere inside the Kineticjs.js ... I got the newest KineticJS version and I tried to debug it and it looks like the problem is in the Kinetic.Stage constructor. When I comment it out it works (but obviously nothing else works then) Thanks for your help, Im kinda

How to center text along Kinetic.TextPath with kineticjs

£可爱£侵袭症+ 提交于 2019-12-11 03:46:26
问题 Is there a way to center text along a path using Kinetic.TextPath in Kineticjs. If not, does anyone know a workaround? I have explored the svg textpath option but not sure how to get this svg into kineticjs. I have also tried to space the text manually using hair spaces but kineticjs seems to convert the character to a normal space eg. text.setText(String.fromCharCode(8202)) 回答1: The standard textpath does not have centering of text along the path I checked the source code here: github.com