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.

DarkBASIC Discussion / Any commands/custom functions that can make my cursor appear ABOVE my other images?

Author
Message
Sunflash
19
Years of Service
User Offline
Joined: 28th Jun 2005
Location: Seattle, Wa
Posted: 15th Feb 2006 21:09
Lol, read the title^
I have a cursor image that follows the mouse (of course), but for some reason it appears UNDER some of the images, and OVER others. I know this has got to be something with the sequence in which I loaded the images, and made them into sprites.

I made the cursor image into a sprite AFTER I made all the other sprites, but it still won't show up above them. Is there any commands that will send an image above the others?
Thanks for the help,
-Sunflash

P.S. Oh yeah, it's a 2D game, I guess that would help a little

When FPSC develops enough, lets make a Redwall game!

Stora tomtefar
20
Years of Service
User Offline
Joined: 15th Mar 2005
Location: Göteborg, Sweden
Posted: 15th Feb 2006 21:22
I think you can change the cursor's default image when you've created the final .EXE-file by changing some properties in it whith "Resource Hacker". That means you don't need to use a sprite as the cursor, just use the standard one.
You could search for it on google, or something. Very usefull little program, I think.

www.godhatessweden.com

Good laughter!
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 15th Feb 2006 22:02
You probably want to look up the help for the command - SET SPRITE PRIORITY.

That lets you force what sprite will be drawn last - i.e. on top of all the rest. I hope it helps you.
UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 15th Feb 2006 22:54
Is that command in DBC? (Set sprite priority)


Hippopotomonstrosesquippedaliophobia-Fear of long words
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 15th Feb 2006 23:08
Oh, um - sorry. I'm not sure :/

If not (and I apologise if it isn't) then you could paste your sprite at the mouse coordinates each frame/loop instead of using a sprite - I think that would happen 'last'?
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 16th Feb 2006 05:10 Edited at: 16th Feb 2006 05:11
Unfortunately SET SPRITE PRIORITY isn't in classic. You just need to evaluate the order in which your sprites are drawn and the screen is SYNC'd.

Maybe try this,

DO
PASTE SPRITE 1, mousex(), mousey()
SYNC
`all other stuff here
LOOP

That way the mouse update is always the last thing before it SYNCs.


I'm going to eat you!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 16th Feb 2006 21:45
In Classic the sprite that's created last is on top of all the other sprites.


Sunflash
19
Years of Service
User Offline
Joined: 28th Jun 2005
Location: Seattle, Wa
Posted: 17th Feb 2006 07:46
Quote: "In Classic the sprite that's created last is on top of all the other sprites."


Yup, and thats what makes me wonder why it isn't showing up after the others.

I'll try pasting the image to the mouse cordinates. To bad that SET SPRITE PRIORITY dosn't work
Thanks for the help guys
-Sunflash

When FPSC develops enough, lets make a Redwall game!

Sunflash
19
Years of Service
User Offline
Joined: 28th Jun 2005
Location: Seattle, Wa
Posted: 17th Feb 2006 08:53
Ok, here's the trouble. I'm useing more then 32 sprites and images, so whenever the user switches menus (Options, Play Game, Practice, Exit ect.) I have to delete all the uneeded images, and loade the needed ones. Well, when you first run the program, the cursor is over the buttons fine. But when you switch menus, it isn't. This is because all the images that weren't needed in the main menu, were deleted, and the ones needed in the options menu were created... created OVER the cursor. So the only way (that I know of) is to delete the cursor, and reload it. But that takes time to load an image and then make it a sprite AND move it along the screen. It takes long enough for the cursor image to start flickering.

Wait, I'm having a thought here... I'll Be back, I have to test something.

When FPSC develops enough, lets make a Redwall game!

Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 17th Feb 2006 09:51
Just don't delete the menu images. You don't need to reload the cursor image either if you don't delete it. Just remake the sprite.

Sunflash
19
Years of Service
User Offline
Joined: 28th Jun 2005
Location: Seattle, Wa
Posted: 17th Feb 2006 11:10
Quote: "Just don't delete the menu images. You don't need to reload the cursor image either if you don't delete it. Just remake the sprite."


Lol, I tested for like, two hours, almost got it, but gave up. I decided to do what you just said. It works well!
Thanks all
I just hope that I don't run out of space for images and sprites in the future (I'm already at 21 of both)

When FPSC develops enough, lets make a Redwall game!

Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 17th Feb 2006 13:47
It's down to memory mainly. I mean the limit is over 60 thousand.

Login to post a reply

Server time is: 2025-05-23 15:11:59
Your offset time is: 2025-05-23 15:11:59