Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 12:22 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Transform handle for rotating
PostPosted: July 4th, 2013, 9:57 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi,

I am working on a jigsaw puzzle in Opus Pro and wonder if there is any way to add the equivalent of a transform handle to each puzzle piece that can rotate the piece clockwise or counterclockwise. The piece would be already set up for drag and drop to be moved to the drop zone (jigsaw puzzle canvas). Can start the puzzle piece at an angle so that the player needs to rotate it in order to fit into the drop zone's target area.

But how to add CW and CCW rotation when a piece is selected?

Can conceive of putting the piece in a drag-able frame, have a non-visible group of 4 corner handles show when the piece is selected by mouse (see below). But how to create a script that can, once mouse down on only one of the visible handles, to rotate the piece CW or CCW? So far can't get my brain around this part. Maybe not possible?

Here's what a selected puzzle piece would look like with rotation handles:

Attachment:
puzzlepiece.png


You do not have the required permissions to view the files attached to this post.

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Transform handle for rotating
PostPosted: July 5th, 2013, 7:12 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
stephen wrote:
So far can't get my brain around this part. Maybe not possible?
You do not need to 'wrap' your brain around it. Just rotate your head and stick your ear in the appropriate mating piece.

Quote:
Can start the puzzle piece at an angle so that the player needs to rotate it in order to fit into the drop zone's target area.

But how to add CW and CCW rotation when a piece is selected?
You can start with the puzzle piece in normal orientation, and when mouse-over or when dragged have a random rotation applied.

I think the CW and CCW rotation can be easy -- if you could count on the User having a mousewheel mouse. You script the RegisterEventHandler to manage that.

However if you have to add rotation, drag & drop complicates that unless you don't mind restricting rotation to when the piece is still. In that case, the simplest rotator would be a vertical rectangle. I would set it up to Click on it and drag inside the object -- sort of like a virtual trackpad as on a laptop.
specifically:
You take the mouse-position upon click, and continue taking mouse-position as cursor moves inside the rectangle. You can simply allocate a rotation increment to the number of pixels the mouse is moved. (I say rectangle to that you have a confined space where this control applies. If you do not care about that, then forget the rectangle and simple have User hold down Ctrl key while dragging on Page -- pick up the Vertical movement pixels.)

If you really want the 'handles' -- that can be done too. Just a bit more work I think.

ETA: mousewheel play.
viewtopic.php?f=13&t=4093&hilit=mousewheel

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Transform handle for rotating
PostPosted: July 5th, 2013, 1:06 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Larry,

Thank you for these creative suggestions. I'll keep playing with the concepts, see what I can get to work.

Best Wishes,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Transform handle for rotating
PostPosted: August 22nd, 2013, 3:26 pm 
Offline

Joined: May 24th, 2007, 11:02 am
Posts: 132
Location: UK - Wales - Ceredigion
Opus: illuminatus > Evolution
OS: Windows 10 Pro
System: i7 8GB RAM
I had a quick go, no idea if this is what you had in mind. A few ways of doing it, but I thought this may be the easiest.


You do not have the required permissions to view the files attached to this post.


For this message jezjones29 has been thanked by : mackavi, Stephen


Top
 Profile Visit website  
 
 Post subject: Re: Transform handle for rotating
PostPosted: August 22nd, 2013, 4:51 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Thank you.

Very interesting! I'll play with it, see if I can apply it to the puzzle. :)

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group