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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Akow, degenerate_762), 1,430 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Getting mouse pointer to work without right click #171054
12/04/07 17:54
12/04/07 17:54
Joined: Jun 2006
Posts: 35
Texas
D
DancesWithLight Offline OP
Newbie
DancesWithLight  Offline OP
Newbie
D

Joined: Jun 2006
Posts: 35
Texas
I'm writing a game which has buttons. They need to be clicked. When the game runs, it starts up with the mouse showing as a white arrow. It needs to switch to the red arrow to be able to click buttons. It seems unreasonable to ask the player to right click to turn the arrow on, it should be there for them from the beginning so they can select from a menu. However no matter if I say mouse_mode = 1, or mouse_mode equals 2 at the beginning, in main, the mouse stays a white arrow when the program runs, unless I right click. How do I fix it to work automatically?


I'm using my registered A6 standard.

Thanks

Last edited by DancesWithLight; 12/04/07 19:12.

Waiting for fully immersible Virtual reality.
Re: Getting mouse pointer to work without right click [Re: DancesWithLight] #171055
12/05/07 13:04
12/05/07 13:04
Joined: Mar 2005
Posts: 564
/www/europe/ germany/index.php
TSG_Torsten Offline

User
TSG_Torsten  Offline

User

Joined: Mar 2005
Posts: 564
/www/europe/ germany/index.php
Hi, please look at the manual.
Anyway, I will give you the code here:
Code:

bmap arrow="arrow.tga"; // Your mouse pointer bitmap
// ...
function main()
{
mouse_map=arrow;
mouse_mode=1; // Activate the mouse
// ...
while(1)
{
mouse_pos.x=pointer.x;
mouse_pos.y=pointer.y; // Move the pointer
wait(1);
}
}


Regards
TSGames

Last edited by TSG_Torsten; 12/05/07 13:05.
Re: well yes, I used mouse mode = 1 [Re: DancesWithLight] #171056
12/07/07 03:17
12/07/07 03:17
Joined: Jun 2006
Posts: 35
Texas
D
DancesWithLight Offline OP
Newbie
DancesWithLight  Offline OP
Newbie
D

Joined: Jun 2006
Posts: 35
Texas
Hi, first I want to thank you for being the only one who answered so far.
Of course I read the manual, and looked up mouse mode.
I've tried setting it from a function, and just setting it within the main() function. There is no mention of mouse in any other line in my wdl. I set the mouse on early, but it doesn't make the mouse work. Yes, my panel buttons are good and actually trigger functions. I've even tried setting the mouse to other values like 0 or 2 to see what would happen. Its just a mystery. I guess I'll just use keypresses for results. Thanks for you help.

Anton


Waiting for fully immersible Virtual reality.
Re: well yes, I used mouse mode = 1 [Re: DancesWithLight] #171057
12/07/07 04:42
12/07/07 04:42
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline
User
JazzDude  Offline
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
You could just use set_mouse(2); when you need the mouse
and set_mouse(0); when you don't need it...using this function:


Code:
function set_mouse(_mode)   //set_mouse(2); //to enable the mouse
{ //set_mouse(0); //to disable the mouse
mouse_mode = _mode;
mouse_range = 50000;
mouse_map = arrow; //change to your bmap

while(mouse_mode > 0)
{
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
wait(1);
}
mouse_map = null;
}



Re: Getting mouse etc -- your code [Re: TSG_Torsten] #171058
12/07/07 21:29
12/07/07 21:29
Joined: Jun 2006
Posts: 35
Texas
D
DancesWithLight Offline OP
Newbie
DancesWithLight  Offline OP
Newbie
D

Joined: Jun 2006
Posts: 35
Texas
Your code works great!

Thanks


Waiting for fully immersible Virtual reality.

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