Mouse Cursors

Non-platform specific questions.

Mouse Cursors

Postby smillz » Sat Nov 08, 2008 4:56 am

Is there a way to change the mouse cursor without hiding the real mouse while having another actor use a Follow Mouse event?(I don't like doing that because it creates many z-depth issues if your game has any Mouse Button Down events and it has a small lag)
smillz
 
Posts: 21
Joined: Fri Jul 20, 2007 2:10 am
Score: 0 Give a positive score

Re: Mouse Cursors

Postby DilloDude » Sat Nov 08, 2008 7:10 am

You can use the ChangeCursor function. This only changes the cursor on the actor you select, so you have to change it for all actors that can be on top. So to make a default cursor, you need to make an actor (such as a filled region) that covers the whole screen. If you disable the MOUSEBUTTONDOWN event on that actor, you can still click on actors beneath it in z-depth. If you want to hide the mouse, you need to make a 1x1 pixel png image, with 0% opacity, and make hat the cursor.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: Mouse Cursors

Postby j2graves » Sat Nov 08, 2008 5:34 pm

btw, I'm having a little trouble with something cause the mouse button down events only allow for the mouse clicking on the object that has the event. could there please be an alternate mouse button down type event which is like a keydown event?
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: Mouse Cursors

Postby smillz » Sun Nov 09, 2008 2:41 am

thanks Dillo Dude! :D And J2graves:

1: create an actor with no animation (or an animation about the size of the standard game-editor pacman symbol), and let's call him "click"
2: give "click" a z-depth greater than every other actor so he always gets clicked
3: Disable "click's" visibility state to make him invisible (if you want to)
4: give "click" a Draw Actor -> Follow Mouse event so he's always with the mouse
5: give "click" a Mouse Button Down event

with "click" always recieving the Mouse Button Down events once you click the mouse, use him to then redirect actions to the desired actor. It's kind of confusing, so feel free to ask questions if you don't understand. :)
smillz
 
Posts: 21
Joined: Fri Jul 20, 2007 2:10 am
Score: 0 Give a positive score

Re: Mouse Cursors

Postby BlarghNRawr » Sun Nov 09, 2008 3:26 am

theres an easier way to invisible mouse by changing in the game properties to show mouse *no*
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Mouse Cursors

Postby DilloDude » Sun Nov 09, 2008 5:02 am

BlarghNRawr wrote:theres an easier way to invisible mouse by changing in the game properties to show mouse *no*

If you want there to never be a mouse, then yes; however, if you want sometimes to be a mouse (for menus and stuff) and sometimes to be none (like for scenes and things) then you either need to make an invisible cursor, or make a separate actor.

smillz wrote:1: create an actor with no animation (or an animation about the size of the standard game-editor pacman symbol), and let's call him "click"
2: give "click" a z-depth greater than every other actor so he always gets clicked
3: Disable "click's" visibility state to make him invisible (if you want to)
4: give "click" a Draw Actor -> Follow Mouse event so he's always with the mouse
5: give "click" a Mouse Button Down event
I find that sometimes with this if you move the mouse to quickly you can leave the actor momentarily. It's a good idea to either make it a large circle, or just make a filled region that covers the whole view.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: Mouse Cursors

Postby smillz » Mon Nov 10, 2008 7:04 am

DilloDude wrote:I find that sometimes with this if you move the mouse to quickly you can leave the actor momentarily. It's a good idea to either make it a large circle, or just make a filled region that covers the whole view.


yeah, that's a better idea
smillz
 
Posts: 21
Joined: Fri Jul 20, 2007 2:10 am
Score: 0 Give a positive score

Re: Mouse Cursors

Postby BlarghNRawr » Wed Nov 12, 2008 1:40 am

mouse still works like that :wink: but youer probably smarter than me
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron