The Daily Click ::. Forums ::. Klik Coding Help ::. Setting the Mouse Arrow ...
 

Post Reply  Post Oekaki 
 

Posted By Message

MBK



Registered
  07/06/2007
Points
  1578

VIP Member
20th April, 2010 at 07:55:03 -

... to an active object's positon. How do I set the Mouse Arrow to an object? ... it's not what you think, I mean the opposite.

You see, it's possible to set an active to the mouse arrow and have it follow the mouse, BUT what I could make use of currently, if it's possible, is to set the Mouse Arrow to follow the active's position and I have no idea how to do that.


 
Click Me! http://www.create-games.com/project.asp?view=main&id=1444

http://www.mediafire.com/download.php?aoo1dnnlq5i

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?

aphant



Registered
  18/05/2008
Points
  1242
20th April, 2010 at 08:51:33 -

I think the Mouse object can do what you're looking for.

 

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
20th April, 2010 at 14:39:22 -

The Mouse Object will do it, but if I recall correctly it uses the position of the mouse cursor relative to your screen, not to your app. So you'll need to also use the Window Control object to get the window's current position.

eg.
Always > Set Actual Mouse X to WinXPos( "Window Control" )+X( "Active" )


edit: You will probably notice a small 'offset' due to having thick window edges on Vista/Windows 7. You might need to add another 5 pixels to taste.

Edited by an Administrator

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

MBK



Registered
  07/06/2007
Points
  1578

VIP Member
20th April, 2010 at 20:52:22 -

THANK YOU GUYS !!!
I sincerely, couldn't have done it without you guys or the mouse object. .... that said, there's still a PRoBLem

@Andy: thank you, that works great, BUT ... it brings up another problem ... IF you resize the game window during runtime, the mouse arrow no longer is set to the correct position, it still follows, just at the wrong place. ... here's what I did:

I --> toggle internal flag 9
Flag 9 is on --> Set Actual Mouse X to Window X position + X(Active) + 5
--> Set Actual Mouse Y to Window Y position + Y(Active) + 50

That causes things to work perfect until I realised that when I drag the edge of the window to a different size, the mouse arrow no longer lines up with the active in the correct position, instead it's following outside the game window, heh.

So I tried doing it without the window control object, which went like this:
Flag 9 is on --> Set Actual Mouse X to X(Active) + 209
--> Set Actual Mouse Y to Y(Active) + 90

But leaving out the window control does the same thing, works perfect until the window size is dragged to a different size at runtime.

Is there a way to prevent this from happening? (preferably without locking the window so its size can't be changed during runtime)


Edited by MBK

 
Click Me! http://www.create-games.com/project.asp?view=main&id=1444

http://www.mediafire.com/download.php?aoo1dnnlq5i

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?

MBK



Registered
  07/06/2007
Points
  1578

VIP Member
22nd April, 2010 at 01:05:48 -

Ok, it turns out that when I installed that Mouse extension, it put an example file on my start menu (i didn't realise), and guess what... there's a step in the example that prevents the exact problem in the post above from ever happening.

So now both problems i mentioned in this thread are fixed! Thanks guys, ... Now I have to get back to finding a nice smooth drawing method so all those fancy things I did for the graphics editor don't go to waste.
Anyone know of a good smooth drawing coding? I'll start a thread for it.

 
Click Me! http://www.create-games.com/project.asp?view=main&id=1444

http://www.mediafire.com/download.php?aoo1dnnlq5i

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
   

Post Reply



 



Advertisement

Worth A Click