Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Player "draw" with the mouse  (Read 2677 times)

0 Members and 1 Guest are viewing this topic.

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Player "draw" with the mouse
« on: April 05, 2009, 03:34:21 PM »

I'd like to have the player be able to draw a small pattern like a circle on the screen with the mouse.  For example, could have a "on LeftClick" at a certain point, check the global, then check that mouse is released at a certain point? check another global, etc?  Not sure how to go about this.  I did a search and couldn't come up with anything really helpful.  Thanks for any help.  :)
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Azrael

  • Regular poster
  • ***
  • Karma: 9
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • View Profile
    • Mad Orange
Re: Player "draw" with the mouse
« Reply #1 on: April 05, 2009, 04:01:35 PM »

Well it's an intresting problem :)

I think the best way should be using an Entity with "LeftClick" and "LeftRelease" events. Also "MouseLeave" should be useful to check if the mouse exit the drawing area (or you could block the pointer to exiting the drawing area checking pointer coordinates).

So if "LeftClick" on the entity you should place something to simulate the drawing under the pointer coordinates. Maybe a non interactive entity like a little circle with the colour you want (obviously only the first time and after only if the mouse pointer has moved)?

Check if the pattern match what drowned should be a bit more difficult. Maybe you could check the "non interactive entities like a little little circle" coordinates? Uhm i don't know...
Logged

Azrael

  • Regular poster
  • ***
  • Karma: 9
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • View Profile
    • Mad Orange
Re: Player "draw" with the mouse
« Reply #2 on: April 05, 2009, 04:03:06 PM »

I forgot, i don't know how much heavy will be this method  :-\
Logged

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: Player "draw" with the mouse
« Reply #3 on: April 08, 2009, 05:19:11 AM »

Thanks, Azrael, I will see if I can simplify it.
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  
 

Page created in 0.043 seconds with 22 queries.