Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 631 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
mouse cursor and gui? #128587
05/08/07 09:54
05/08/07 09:54
Joined: May 2007
Posts: 30
F
fusukery Offline OP
Newbie
fusukery  Offline OP
Newbie
F

Joined: May 2007
Posts: 30
I am trying to make a gui with mouse action. But having problem with mouse now.
I set

mouse_mode = 1;
mouse_pointer = 2;

in the main() function

But I can not see the mouse cursor. Moreover, the camera view seems LOCKED (I am using an Old A5 template), just rotate right and left, no more.
Now I wonder how could I see the mouse cursor, and my view does not lock with this mode (in the tech demo, If I right click the mouse, I see the cursor, but my view is locked too). So, I could use mouse with interact with the GUI
==
Thanks for any helps.

Re: mouse cursor and gui? [Re: fusukery] #128588
05/08/07 10:04
05/08/07 10:04
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
from F1
The mouse pointer is switched off when mouse_mode is activated and a mouse_map is set, otherwise it's a arrow (2);
So use mouse_map bmap and write in loop
MOUSE_POS.X = POINTER.X;
MOUSE_POS.Y = POINTER.Y;

Last edited by tompo; 05/08/07 10:05.

Never say never.
Re: mouse cursor and gui? [Re: tompo] #128589
05/08/07 10:38
05/08/07 10:38
Joined: May 2007
Posts: 30
F
fusukery Offline OP
Newbie
fusukery  Offline OP
Newbie
F

Joined: May 2007
Posts: 30
Right, I make it work now, the problem now is when mouse is enable, the view is LOCKED, It means I can not rotate view by mouse but only by left right keyboard.

Re: mouse cursor and gui? [Re: fusukery] #128590
05/08/07 11:42
05/08/07 11:42
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
just make a loop
camera.pan += mouse_pos.x *0.1 *time_step;
camera.tilt += mouse_pos.y *0.1 *time_step;
0.1 to slow down if it's to fast, play with this settings.


Never say never.
Re: mouse cursor and gui? [Re: tompo] #128591
05/08/07 13:55
05/08/07 13:55
Joined: May 2007
Posts: 30
F
fusukery Offline OP
Newbie
fusukery  Offline OP
Newbie
F

Joined: May 2007
Posts: 30
It makes no change ... Could you explain more.

Re: mouse cursor and gui? [Re: fusukery] #128592
05/08/07 15:00
05/08/07 15:00
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
in some loop (could be in main function loop) write:
MOUSE_POS.X = POINTER.X; MOUSE_POS.Y = POINTER.Y;
camera.pan += mouse_pos.x *0.1 *time_step;
camera.tilt += mouse_pos.y *0.1 *time_step;

or use mickey
camera.pan += mickey.x;
camera.tilt += mickey.y;

Last edited by tompo; 05/08/07 15:08.

Never say never.
Re: mouse cursor and gui? [Re: tompo] #128593
05/09/07 07:53
05/09/07 07:53
Joined: May 2007
Posts: 30
F
fusukery Offline OP
Newbie
fusukery  Offline OP
Newbie
F

Joined: May 2007
Posts: 30
my script
Code:

BMAP arrow = <arrow.pcx>;

function mouse_toggle // switches the mouse on and off
{
MOUSE_MAP = arrow; // Arrow as Mouspointer!
MOUSE_MODE += 2;
if (MOUSE_MODE > 2) // was it already on?
{
MOUSE_MODE=0;
}
while (MOUSE_MODE > 0) // move it over the screen
{
MOUSE_POS.X = mouse_cursor.x;
MOUSE_POS.Y = mouse_cursor.y;
camera.pan += mouse_pos.x *0.1 *time_step;
camera.tilt += mouse_pos.y *0.1 *time_step;

wait(1);
}
}


and call this function in main function.
But I can not rotate camera with mouse. But when I press escape, menu appear (I use old A5 template), and the camera rotate free form ...???

Re: mouse cursor and gui? [Re: fusukery] #128594
05/09/07 07:59
05/09/07 07:59
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
set mouse_mode to 1 instead of 2


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