Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Have menu over the U3D window...; Not that the mouse stays in the middle..
Topic Started: Sep 15 2007, 11:34 PM (194 Views)
Rixeno
Member Avatar
Teo-Carliss
[ *  *  *  *  * ]
Ok, here's the problem, or more like the question, I was wondering how I can have a menu pop-up in front of the U3D window so that the user can select an option but that the window doesn't handle the mouse in the center...

EDIT: I'm not sure if I explained it in enough detail. If so, please tell me and I'll inform you more about it.
Report spam the nanosecond you see it.
Ninjas are everywhere, for all you know there are eleven behind you right now, including me...
Offline Profile Quote Post Goto Top
 
MysteriXYZ
Member Avatar
Master Matrix Masher
[ *  *  *  *  *  * ]
Rixeno
Sep 15 2007, 11:34 PM
I was wondering how I can have a menu pop-up in front of the U3D window so that the user can select an option but that the window doesn't handle the mouse in the center...

So basically you want to be able to take away the control over the mouse cursor from :U3D: when you want to access a menu, right? Well, if you look in the Step Event of the camera object, you will see a piece of code. This code is used by :U3D: to take control over the mouse. To switch that control between the user and :U3D: you need to execute this code conditionally.
So you can set up a variable like UserControl, which can either be true or false.

In the Create Event of the camera, set UserControl to false. Then you can add a Key Press Event to the camera, with code to toggle the state of UserControl:
Code:
 
UserControl=!UserControl;

That entire piece of code in the Step Event of the camera should then only be executed if UserControl==false.
Remember that you will still not see the cursor, even if you control it. So you will also have to draw a cursor sprite whenever UserControl is true.

I hope this answered your question :).
U3D is like candy; after extensive consumption, it's Best to brush.
Offline Profile Quote Post Goto Top
 
Rixeno
Member Avatar
Teo-Carliss
[ *  *  *  *  * ]
You understand what I wanted and by the way you explained it, I guess it should make sense, I'll check it out when I have the time, thanks though :D

EDIT: Thanks just found out, it's in the Camera Step event of the SDK
Code:
 

GetMousePos();
//Mousecontrol
rotx+=(global.mouse_y-display_get_height()/2)*mouse_speed;
if(rotx<-60)
   rotx=-59;
if(rotx>60)
   rotx=59;
roty+=(global.mouse_x-display_get_width()/2)*mouse_speed;
SetMousePos(display_get_width()/2,display_get_height()/2);

It looks like it's the "SetMousePos" that keeps it there, but if I do what you said with the whole script, it should work... Thanks again MysteriXYZ B)

EDIT (Again): It works, just tried an example :clapping:
Report spam the nanosecond you see it.
Ninjas are everywhere, for all you know there are eleven behind you right now, including me...
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply