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 / Text over sprite without having it in the picture

Author
Message
Flamertor
8
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 15th Mar 2012 20:21 Edited at: 15th Mar 2012 20:26
Hi im making an MMORPG and im trying to get the name of the player over the sprites. I hope you can help.Thanks in advance.

P.S If you want to join my MMORPG test go to http://www.facebook.com/pages/IM-The-Game-Runner/258952367473908[img]null[/img] and like me

Go to my website http://imthegamerunner.moonfruit.com

Attachments

Login to view attachments
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Mar 2012 23:32
Sprites always take precedence over text. But, you can hide a sprite, paste it, and then place the test over it. Keeping the sprite hidden and pasting it has performance advantages as well.



Enjoy your day.
Naphier
9
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 16th Mar 2012 04:04
If the text doesn't need to be updated often then I suggest printing it in another bitmap then using that bitmap (or a portion of it) as a sprite itself.

Flamertor
8
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 16th Mar 2012 18:14 Edited at: 16th Mar 2012 19:08
The program you written latch is amzing but i left out one important part- i got 3d objects. Thxs for the help again - you always answer my question if you havent relized yet.

Thanks Naphier but i need it so the player can type in their Character name

Go to my website http://imthegamerunner.moonfruit.com
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Mar 2012 21:41
Do you mean text above the character - like above their head?

So as the player is walking around, you can see their name in front of everything but it "floats" above their head?

Enjoy your day.
Flamertor
8
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 16th Mar 2012 21:50
No if you click veiw on my frist post you will see a blue box with a gold outline. These are sprites so they don't flash, and in each of those boxs there will be the charter name of that account becuase you can have more than one charter per account and know which is which and what there names are, I hope this have help you understand what im trying to do.

Go to my website http://imthegamerunner.moonfruit.com
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Mar 2012 22:13
If they are 2d sprites, you can hide the actual sprite and paste it like I mentioned before, then write the text over the pasted image.

If you are using 3d planes as sprites, you can create another 3d plain, disable it's zdepth so it appears in front of everything else, then texture it with text.



Enjoy your day.
Flamertor
8
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 20th Mar 2012 18:44
Sorry for such a slow reply, being getting ready for a compation also sorry for the spelling.
It doe's work but they flash on the screen, which i don't really want.

P.S Have u looked at the picture.

Go to my website http://imthegamerunner.moonfruit.com
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Mar 2012 22:21
Quote: "P.S Have u looked at the picture.
"


Yes. If you always have the sprites hidden - you aren't showing them and then hiding them etc. - then you should be able to paste them without flashing.

I'm not at a computer with DarkBASIC, but I'll take a look at your picture again to see about layering sprites.

I also noticed that you have 3d and then 2d where your character info is.

The 2d over 3d, depending on a few things, may cause flashing. There shoud be a setup.ini file in the same folder as DB.exe. Make sure blitflipmode=1 inside the file and also try loading an .mp3 and playing it when your program starts. That should 'unlock' your sync rate.

Now, based on your picture, it looks you have 2d on the left and 3d on the right. Try resizing the camera view so that you actually split the screen.

for example:


this shifts the 3d camera over 400 pixels to the right. So your 2d can be drawn without overlapping the first 400 pixel area of 3d. This can help with flashing in the 2d over 3d case.

Enjoy your day.
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 24th Mar 2012 20:24
Here's an example of what I was talking about with 2d, 3d, and pasting a sprite. I also included a basic text entry function. I noticed that it did flash only after typing the text and pressing enter when the 2d was directly over the 3d so I shrank the 3d window and that stopped it.




What it comes down to ultimately, is that there is no advantage to using sprites over images except if you want to keep something on the screen behind a sprite (because nothing draws over a sprite except another sprite) or if you want to use the simple built in sprite collision. In DBC, sprites take a lot of processing power and like you see, you can't easily draw over them.

Enjoy your day.

Login to post a reply

Server time is: 2020-08-05 09:42:40
Your offset time is: 2020-08-05 09:42:40