Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Draggable Box
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tom Brinkman  
View profile  
 More options Aug 16 2012, 2:46 pm
From: Tom Brinkman <reportb...@gmail.com>
Date: Thu, 16 Aug 2012 11:46:58 -0700 (PDT)
Local: Thurs, Aug 16 2012 2:46 pm
Subject: Draggable Box

Can Paper.js create a draggable box, similar to this example:
http://simonsarris.com/project/canvasdemo/demo2.html

Seems like something Paper.js should be able do this, considering all the
other awesome things that it is capable of.  However, I didn't see any
examples that demonstrated this capability.

Thanks Tom


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Blackwood  
View profile   Translate to Translated (View Original)
 More options Aug 16 2012, 6:41 pm
From: Alex Blackwood <bigblackw...@gmail.com>
Date: Thu, 16 Aug 2012 15:41:57 -0700 (PDT)
Local: Thurs, Aug 16 2012 6:41 pm
Subject: Re: Draggable Box

Take a look at the Hit Testing
example: http://paperjs.org/examples/hit-testing/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robin Hood  
View profile   Translate to Translated (View Original)
 More options Aug 17 2012, 11:12 am
From: Robin Hood <robinhood...@gmail.com>
Date: Fri, 17 Aug 2012 08:12:50 -0700 (PDT)
Local: Fri, Aug 17 2012 11:12 am
Subject: Re: Draggable Box

Try the demo at http://jsdo.it/_shimizu/62ja
it is what you are looking for i guess.

I can't stress enough that the code is horribly written, so it
significantly under performs, so dont use the code as it is.
This is just to give u an idea.. I am using paper for drag and drop purpose
as well..


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Brinkman  
View profile  
 More options Aug 22 2012, 11:15 pm
From: Tom Brinkman <reportb...@gmail.com>
Date: Wed, 22 Aug 2012 20:15:16 -0700 (PDT)
Local: Wed, Aug 22 2012 11:15 pm
Subject: Re: Draggable Box

My browser (google chrome) was not able to run this example.  UGHHH.   Sad.
 Do you have another link?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robin Hood  
View profile  
 More options Aug 23 2012, 11:15 am
From: Robin Hood <robinhood...@gmail.com>
Date: Thu, 23 Aug 2012 08:15:15 -0700 (PDT)
Local: Thurs, Aug 23 2012 11:15 am
Subject: Re: Draggable Box

it run ok on firefox, no problem will write u one simple drag drop example
some time today.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robin Hood  
View profile   Translate to Translated (View Original)
 More options Aug 23 2012, 3:44 pm
From: Robin Hood <robinhood...@gmail.com>
Date: Thu, 23 Aug 2012 12:44:00 -0700 (PDT)
Subject: Re: Draggable Box

Tom, just put the code into html file and it should work just fine.

<html>
<head>
<script>
function init()
{
var canvas = document.getElementById('dynamicCanvas'); //jQuery:
$("#dynamicCanvas")[0];Get a reference to the canvas object
paper.setup(canvas); //Create an empty project and a view for the canvas
var hitOptions = { segments: true, stroke: true, fill: true, tolerance: 3 };

//create a rectangle
var rectangle = new paper.Rectangle(new paper.Point(200, 200), new
paper.Size(100, 100)); //or (top_left, bottom_right)
var cornerSize = new paper.Size(15, 15); //rounding of edges
var shape = new paper.Path.RoundRectangle(rectangle, cornerSize);
shape.strokeWidth = 3;
shape.strokeColor = '#525252';
shape.fillColor = '#FF6600';
shape.name = 'shape'
paper.view.draw();
tool = new paper.Tool(); //Create a simple drawing tool:
var obj
tool.onMouseDown = function(event) //Define a mousedown and mousedrag
handler
{
obj = null;
var hitResult = paper.project.hitTest(event.point, hitOptions);

if (hitResult && hitResult.type == 'fill') //state fill
obj = hitResult.item;

}

tool.onMouseMove = function(event)
{
var hitResult = paper.project.hitTest(event.point, hitOptions);
paper.project.activeLayer.selected = false;
if (hitResult && hitResult.item)
hitResult.item.selected = true;
}

tool.onMouseDrag = function(event)
{
if (obj)
obj.position = event.point;
}

tool.onMouseUp = function(event)
{
}
}

</script>

</head>

<body>
<canvas id="dynamicCanvas" width="800" height="500"></canvas>
<script type="text/javascript" src="js/lib/paper.js"></script>
<input type="button" value="Do event" onclick="init();"/>
</body>
</html>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan Beasley  
View profile  
 More options Aug 24 2012, 12:40 pm
From: Ryan Beasley <dr.ryan.a.beas...@gmail.com>
Date: Fri, 24 Aug 2012 09:40:42 -0700 (PDT)
Local: Fri, Aug 24 2012 12:40 pm
Subject: Re: Draggable Box

Tom, is there a problem with the Hit Testing example that Alex pointed you
at?
Just click on the fill color of a blob and drag it.

~Ryan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Brinkman  
View profile  
 More options Aug 26 2012, 7:29 pm
From: Tom Brinkman <reportb...@gmail.com>
Date: Sun, 26 Aug 2012 16:29:46 -0700 (PDT)
Local: Sun, Aug 26 2012 7:29 pm
Subject: Re: Draggable Box

Sorry, for late reply.  Works awesome.  Exactly what I hoped was possible
with paper.js.  You should add this as an tools example.  


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Brinkman  
View profile  
 More options Aug 26 2012, 7:30 pm
From: Tom Brinkman <reportb...@gmail.com>
Date: Sun, 26 Aug 2012 16:30:55 -0700 (PDT)
Local: Sun, Aug 26 2012 7:30 pm
Subject: Re: Draggable Box

Works great.  Exactly what I hoped was possible with paper.js.  Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »