Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / pretty stupid cursor question

Author
Message
Sk8er Namja
20
Years of Service
User Offline
Joined: 20th Apr 2004
Location:
Posted: 19th May 2004 01:27
Hi guys

I'm relatively new to Dark Basic Professional, and I've done the tutorials now and I think I get the idea of how to make games. So that's the good news...

Now here it goes... I think of doing a RTS game, you know where the map scrolls and all. So far I think I do know how to do it, but there's one thing I just don't know how to do it.
Here's what I wanna do: As soon as the mouse hits the border of the screen, the map should scroll into the appropriate direction, like when you move the mouse to the top border of the screen, the map scrolls up. This is not a big deal. But I want to change the cursor to an arrow for the time it is at the border of the screen. And I know how to display the cursor, but I don't know how to delete the graphic, and make the arrow disappear when the mouse leaves the border of the screen.

I show you what I got for the right border only, you get the idea for the other three, so no need to post them.

do
load image "scrollarrow-right.jpg", 1

rem show the cursor for scrolling to the right
if mousex()=1023
hide mouse
paste image 1,995,mousey()
endif

show mouse

loop


At 'paste image' it's 995 on the x axis because the graphic (the arrow) that should be displayed has a width of 28 pixels, which needs to be deducted in order to display it correctly...

I've searched the code base and I couldn't find it...

Thanks for your help guys

1 PRINT "This s..t works!!!"
2 GOTO 1
RUN
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 19th May 2004 01:36
change the mouse pointer instead of loading a graphic, that way your just swapping the .cur file and never have to hide mouse etc

you can add additional cursors in the IDE


* DBP_NETLIB_v1.1 - VB.NET PLUGIN FOR DBP * Click Logo

Login to post a reply

Server time is: 2024-11-26 18:36:35
Your offset time is: 2024-11-26 18:36:35