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
3 registered members (TedMar, AndrewAMD, fairtrader), 578 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
video_border + mouse = not working really well #375894
06/28/11 18:49
06/28/11 18:49
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
ok.. i dunno why this is like it is now..


http://nakoon-game.de/Nakoon_Game/Artworks/Grafiken/Launcher_Prob.png

Red = active area
Yellow = Area the mouse works

i tried to lock the mouse to the engines window.. wich i thought is the active area.. with this code:
Code:
RECT rect;
	GetClientRect(hWnd,&rect);
	ClientToScreen(hWnd,&rect);
	ClientToScreen(hWnd,&rect.right);
	ClipCursor(&rect);



But the mouse is only locked inside the yellow area.. so..
WHY?

the mouse_cursor can be locked to the active area with clamp. But the not the system cursor ._.


Or better.. How can i lock the system cursor to the active area, too?


i fixed that little problem with help of superkuh by using:
Code:
DEBUG_VAR(mouse_cursor.x,10);
		DEBUG_VAR(mouse_cursor.y,30);
		mouse_pos.x = mouse_cursor.x-40;
		mouse_pos.y = mouse_cursor.y-196;



But that just fixed the position problem..
There´s still the problem.. that the mouse can´t be hold inside the active area...

That wouldn´t be that problem.. if the mouse_map keeps active all over the border..

But mouse_map is active in the active_area only.. so.. this shit happens:

http://nakoon-game.de/Nakoon_Game/Artworks/Grafiken/Unbenannt.png


Seems to me, that video_border + mouse isn´t thought through really well ^^"


Last edited by Espér; 06/28/11 19:03. Reason: changed title.. ._.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: video_border + mouse = not working really well [Re: Espér] #376015
06/29/11 11:33
06/29/11 11:33
Joined: Jul 2000
Posts: 27,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,967
Frankfurt
If I understood you right, you want to restrict the mouse movement to the engine window, but your script restricts it to the application window instead. Both windows are not the same when you use a video border. Call ClipCursor with the engine window parameters instead, such as screen_size.x and screen_size.y.

Re: video_border + mouse = not working really well [Re: jcl] #376018
06/29/11 12:05
06/29/11 12:05
Joined: Apr 2008
Posts: 650
Sajeth Offline
User
Sajeth  Offline
User

Joined: Apr 2008
Posts: 650
No, I think he refers to the mouse bitmap being cut off at the edge.


Teleschrott-Fan.
Re: video_border + mouse = not working really well [Re: Sajeth] #376021
06/29/11 12:19
06/29/11 12:19
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Yes.. that cut off lookms really really reeeeeaaaally ugly...


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: video_border + mouse = not working really well [Re: Espér] #376028
06/29/11 13:12
06/29/11 13:12
Joined: Jul 2000
Posts: 27,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,967
Frankfurt
The engine can only render into the engine window, not outside the window. For the outside area, you could draw a bitmap with GDI functions, in a way that the bitmap moves with the cursor. Custom cursors would probably not look good when moving out of the engine window.

Re: video_border + mouse = not working really well [Re: jcl] #376029
06/29/11 13:19
06/29/11 13:19
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
so is there no way to make mouse_map stay alive on the border too?


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: video_border + mouse = not working really well [Re: Espér] #376032
06/29/11 13:22
06/29/11 13:22
Joined: Jul 2000
Posts: 27,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,967
Frankfurt
The way is the GDI bitmap that I suggested. GDI won't draw inside the engine window and the engine won't draw outside, so when you can keep the bitmap moving together with the mouse, it should move smoothly over the border, consisting partially of an engine bitmap and of a GDI bitmap. At least that's the theory.

Re: video_border + mouse = not working really well [Re: jcl] #376041
06/29/11 13:48
06/29/11 13:48
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
hmm..kay..

I tried to set mouse_pointer. But, to always get a visible arrow, i need to delete the mouse_map and mouse_mode lines.

Problem through this: The buttons are not reacting anymore..

Doesn´t matter what i do.. it´s not a well looking result ._.


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: video_border + mouse = not working really well [Re: Espér] #376049
06/29/11 15:47
06/29/11 15:47
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
and, how do i use ClipCursor? Didn´t find it in the manual ._.


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: video_border + mouse = not working really well [Re: Espér] #376052
06/29/11 16:29
06/29/11 16:29
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: Espér
and, how do i use ClipCursor? Didn´t find it in the manual ._.

The function starts with an uppercase letter and is written in camel case, do you know any Gamestudio function that follows this convention? wink

Its a WinAPI function.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Page 1 of 2 1 2

Moderated by  old_bill, Tobias 

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