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 / I can't seem to get me head round this!!

Author
Message
DLS
20
Years of Service
User Offline
Joined: 6th Jul 2004
Location: Wet And Windy Britain
Posted: 7th Jul 2004 20:49
hi all. i just started using DBpro resently and i'v got a bit stuck.

i've done games programming in the past for dos type ones and i'm fairly good at VB. but for some reason i can't make a simple button to exit the game.

once i know how to do that i can then adapt it for playing the game, options menu etc

i've looked in the code base and in the formun and tryed the code that looked like it would do the trick they were almost identical but neither on ot them would work.

my buttons are 150 pixels in the x and 31 in the y

also how do u create and control a software mouse pointer

i been pondering over this now for 3 days and i need help

cheers in advance
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Jul 2004 21:18
There are a few ways depending on how your buttons are being displayed.

If you are pasting the image into place then you can simply check the coordinates of the image to see if the mouse button is being pressed while within those coordinates



If you are using a sprite then there is also another way



Call Pick_Sprite_Setup at the top of your code, and then you can call the Pick_Sprite function with the sprite number of your exit button when the mouse button is pressed.. If you get a non-zero number back then the mouse is positioned over the exit button sprite.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
DLS
20
Years of Service
User Offline
Joined: 6th Jul 2004
Location: Wet And Windy Britain
Posted: 8th Jul 2004 01:33
thanx for that i'll give it a try and hopefully this one works.

now for the other bit.

how do u make a special graphic for the mouse instead of using the windows mouse.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 8th Jul 2004 01:40
you need to make a .cur file - I think Pixel Toolbox has this capability. Lookup Pixel Toolbox on google


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 8th Jul 2004 02:35 Edited at: 8th Jul 2004 02:40
Or you could just hide the mouse pointer, and create a sprite that is positioned at the mouse coordinates!

hide mouse

load image "mycurs.bmp",1,1
sprite 1,mousex(),mousey(),1
offsetx= ?
offsety= ?

do

sprite 1,mousex()-offsetx,mousey()-offsety,1

loop


note ?: offsetx and offsety need to be set if you want your image to be centered on the mousi pointer. they should each be set to half the image's pixel size.


DLS
20
Years of Service
User Offline
Joined: 6th Jul 2004
Location: Wet And Windy Britain
Posted: 8th Jul 2004 08:31
cheers for that. had a feeling it could be done with a sprite.

i'll give it a shot when i got some time.

Login to post a reply

Server time is: 2024-09-22 16:32:58
Your offset time is: 2024-09-22 16:32:58