Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,388 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
crosshair cursor crisis #365149
03/23/11 18:01
03/23/11 18:01
Joined: Feb 2007
Posts: 146
UK
robertbruce Offline OP
Member
robertbruce  Offline OP
Member

Joined: Feb 2007
Posts: 146
UK
Hello,

I have found that when using a mouse_map crosshair the cursor goes off the screen on the right and bottom sides.

When using a normal mouse arrow this does happen but not so far that the mouse pointer goes out of sight.

Just wondered if anyone can help with this, either by an adjustment to the bmap itself or adding some offset code
to the mouse function.

have enclosed a old demo level

thanks,

Rob




Re: crosshair cursor crisis [Re: robertbruce] #365151
03/23/11 18:16
03/23/11 18:16
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
The reason is the crosshair not being aligned to the upper left corner of the bitmap. You can move the crosshair to the upper left corner of the bitmap in any paint program. Alternatively it might help to set mouse_spot.x and mouse_spot.y to the bitmaps width / height divided by 2.


Always learn from history, to be sure you make the same mistakes again...
Re: crosshair cursor crisis [Re: robertbruce] #365152
03/23/11 18:18
03/23/11 18:18
Joined: Dec 2003
Posts: 988
Germany, Magdeburg
JoGa Offline
User
JoGa  Offline
User

Joined: Dec 2003
Posts: 988
Germany, Magdeburg
you could use "mouse_spot.x" and "mouse_spot.y" to set the hotspot of the mouse in the middle of your crosshair.
Code:
BMAP* arrow_pcx = "arrow.pcx";
...
mouse_map = arrow_pcx;
mouse_spot.x = bmap_width(arrow_pcx)/2; // hot spot in the bmap center
mouse_spot.y = bmap_height(arrow_pcx)/2;


If that is not exact enough, you could check it like this:
Code:
while(1)
{
  if(mouse_pos.x > (screen_size.x-bmap_width(arrow_pcx)/2))
  {
    mouse_pos.x = screen_size.x-bmap_width(arrow_pcx)/2);
  }
  //same with y
  wait(1);
}


last example is made by me -> untested and maybe buggy :-D
first example is out of the manual -> mouse_spot

edit: Uhrwerk was quicker xD

Last edited by JoGa; 03/23/11 18:23.
Re: crosshair cursor crisis [Re: JoGa] #365153
03/23/11 18:26
03/23/11 18:26
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
I've had quite a few problems with mouse_spot and asked for a fix (see here, though not sure if one has been implemented)

If there is no fix yet I'd use JoGa's approach or you'll be running into problems when clicking the left and top of the screen but won't help with mouse_ent, buttons or sliders

Re: crosshair cursor crisis [Re: robertbruce] #365255
03/24/11 21:18
03/24/11 21:18
Joined: Feb 2007
Posts: 146
UK
robertbruce Offline OP
Member
robertbruce  Offline OP
Member

Joined: Feb 2007
Posts: 146
UK
Thanks to everyone for your input.

Unfortunately it's still not working. I may have to alter the crosshair so that it does not go completely out of view. If I find a solution I will post.

best regards,

Rob


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1