kineticjs - Detect collision between shape and Kinetic.Group -


The shape I am taking with width: 40 and with height There is a rectangle: 4 , and it is made that hard to find width = height (you can see the collision between large rectangles) when it becomes easy

My cases In, I have to find out the collision between this rectangle, and add another rectangle group, then add a small one to the group. Here's a fiddle to understand more:

It detects collision from bottom, and on the right side of the group, but left and upper boundaries are not well "detected".

OK, now you've re-applied your code to predefine your code. . You can use this code. To assign a handler to a group, or to move the clone back to the top of the original window element.

A demo:

  clone.on ("dragend", function () {var pos = stage.getPointerPosition (); var x = parseInt (pos.x) ; Var y = parseInt (pos.y); var GPO = group.position (); var gSize = group.getSize (); if (x> GPEx & amp; amp; amp; amp; & amp; x & lt; GPos.x + GSICEWith & gt; GPOA & amp; amp; y & lt; gPos.y + gSize.height) {This macro (group); POS = this. (), This. Search ({x: thisPos.x-gPos.x, y: thisPos.y-gPos.y});} and {it.movosto (layer); This.position (window.position ());} layer .draw ();});   

[For additional additional comments, the group's top-left clone has been removed after leaving the post.]

The clones are placed in the top-left of the added group when it is done:

  Maw (group); This.position (0,0);    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -