Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, VoroneTZ, dpn), 1,346 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 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 | chip programmers | 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