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 Professional Discussion / Just would to obtain my sprite panel transparent and with text over it!

Author
Message
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 29th Oct 2013 09:17
Hi guys.
I tried a lot of ways to obtain a panel (image or sprite) in the screen X and screen Y of my 3D object to let me to read some object informations.
Ok I made it and it working well too! (see attached pic)

But a problem..

If I use sprite to make my panel so I can use alpha command to make it transparent but I get my text behind my transparent panel..


If I use "paste image" to make my panel so I can put my texts over my panel but I can't use alpha command then I can't obtain my panel as transparent..

I trying all the way but I can't to obtain a transparent panel with text over it

help please!

Attachments

Login to view attachments
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 29th Oct 2013 12:09
This works if you're using M1U:



In a more serious project I would use a custom bitmap font system that renders text to images that are then displayed as sprites on top of the panel sprite however.


"Why do programmers get Halloween and Christmas mixed up?"
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 29th Oct 2013 16:22
Thanks Rudolpho! and really interesting the "render to text" method.
Can you provide me some link?
Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 29th Oct 2013 17:16
Have you tried hiding your sprite and then using PASTE SPRITE?

D.D.
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 29th Oct 2013 18:38
I don't have any direct links, but its pretty easy to figure out yourself.
Basically you have images of all characters you'll need to print, then you create a new image (for example as a memblock) that is large enough to hold the text you want to display and then you copy in your character images one-by-one to that larger image.
It is quite common to store all letters you'll need in a single image (a font sheet) and sample them from there.
You would then make a sprite from this image as well and set its Z priority so that it draws on top of any background you want for it.


"Why do programmers get Halloween and Christmas mixed up?"
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 29th Oct 2013 21:40
@Derek Darkly: Yeah mate thank you! your trick working well!

@Rudolpho: Thank you Rusolpho, time ago I was using "render to text" to handle my text and I think I will to use that again!

Thanks guys!
Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 30th Oct 2013 13:56 Edited at: 30th Oct 2013 13:57
Quote: "@Derek Darkly: Yeah mate thank you! your trick working well!"


No problem, glad to help.
And don't forget, you can fade your sprites with the SET SPRITE ALPHA command. I used it on my menu panel in my game D-Zone 2D for a nice menu box.

D.D.
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 31st Oct 2013 09:23
I tried your D-Zone 2D and it's great!!
Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 31st Oct 2013 21:10 Edited at: 31st Oct 2013 21:10
Quote: "I tried your D-Zone 2D and it's great!!"


Cool! Thanks a lot!! *blushes*

D.D.
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 1st Nov 2013 09:35
Thanks to you to show us your game! I really like old school shot'em up arcade!

Login to post a reply

Server time is: 2025-05-15 14:20:56
Your offset time is: 2025-05-15 14:20:56