Home News Features Games Authoring Community Forums About Contact
   

May 18, 2013, 04:59:35 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: "Advanced" features  (Read 834 times)
Uhfgood
Newbie
*
Offline Offline

Posts: 8


« on: July 28, 2012, 01:28:44 AM »

I'm developing a game with a particular kind of pie (radial) menu interface.  It relies on the mouse angle  (the angle of the mouse from a start position where you clicked) in order to determine which option works.  It does not work on detecting which region or area of the screen or a graphic it's on.  I'm wondering if there are any advanced math functions, to help me calculate mouse angle, and also any way to draw lines on the screen?

To give an idea of what I'm doing, I have a version I'm working on in adventure game studio, and you can see the video here - http://youtu.be/XGoyqaRFtVw

Essentially you click on the screen, pick an option by moving the mouse around this menu, and then clicking to select it.  The character then moves to the position, and executes whatever option is at that location.
Logged
BigMc
SLUDGE Linux/GTK+ Maintainer
Sr. Member
****
Offline Offline

Posts: 266



« Reply #1 on: July 28, 2012, 01:52:31 AM »

You can check the slope of the line connecting mouse clicks to implement that. That works with basic math. For two clicks at (x1, y1) and (x2, y2) that's (y2 - y1)/(x2 - x1). That requires an extra check for the direction the mouse was moved on that line.

Not sure if there is a way to calculate an angle and what's the best way to draw lines.
« Last Edit: July 28, 2012, 01:56:11 AM by BigMc » Logged
Trumgottist
Maker of SLUDGE
Longtime Member
*****
Offline Offline

Gender: Male
Posts: 1160



WWW
« Reply #2 on: July 28, 2012, 07:12:15 AM »

There is no line drawing function.

Feel free to prove me wrong, but I don't see a way to do what you're describing with SLUDGE. I do wonder why you want to do it like that rather than using objects, though. The video you linked doesn't show anything unusual.
Logged

"Programming is the computer game that makes all others possible." - Ron Newcomb
BigMc
SLUDGE Linux/GTK+ Maintainer
Sr. Member
****
Offline Offline

Posts: 266



« Reply #3 on: July 28, 2012, 10:46:53 AM »

It's possible without line. Which I would also find ok if the buttons get highlighted like in the video.
Logged
Uhfgood
Newbie
*
Offline Offline

Posts: 8


« Reply #4 on: July 28, 2012, 01:58:57 PM »

The line drawing isn't strictly necessary -- It's more for debugging when you don't know what option you're on.

I do wonder why you want to do it like that rather than using objects, though. The video you linked doesn't show anything unusual.


That's because you're thinking of it like regular gui buttons (or a standard verb coin).  The standard method relies on the mouse position being on top of a certain element on the coin or a certain region of the screen.  Like a rectangular region.  My menu works based on the particular angle, which means you don't have to have the mouse on the "button" to execute an action.  It also means that it doesn't strictly require a rectangular area that regular buttons do.

Also when I have it working, I will add an advanced feature which means you won't have to even click too open and click to close the menu, but instead you'll just click-drag-release and it will do  he required option without even showing the menu.  (This means that eventually you'll know the options well enough you'll know what direction to drag the mouse in, which could theoretically speed up game play.)

It's alright if sludge doesn't do it, I'll keep searching.  (AGS is too weird for me to use it.)
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
 
Unauthorised reproduction of anything on this website is not allowed without our written consent.
Materials on this site are the property of their respective owners. Copyright © Adventure Developers. All rights reserved.