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 / bar using .png hud and cube as a growin meter - problem

Author
Message
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 14th Jul 2009 20:20
I tried to make a healthbar using an image of a hudscreen i made in gimp and saved as a .png file.
This is the code i use to load up the hudscreen to the camera:


The script to the healthbar is the following :


then after "do" comes :


the problem is that the healthbar is hiding behind the hudscreen and it wont be shown even if i higher (or lower) the zdepth of the healthbar object is there any god solution for this one?

How about making a make a (bitmap/sprite?) healthbar in gimp or photoshop, like this one (but not that advance)?
http://www.danmycka.com/Images/MainImg_03_25.jpg

I been working with this two for a day now, ive search the forum (were i found the healtbar code) but cant find how to use it with the hudscreen

Hello!
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 14th Jul 2009 20:27
Well i don't know exactly but you could use a code like disable object zdepth to make it appear above all other objects. And if you paste an image over it, well, you have to make sure you don't :p. But try Disable Object Zdepth 99

Oh No, there's too much blood in my caffeine system!
Stack Overflow: Too many pancakes...
The programmer's national anthem is 'AAAAAAAAHHHHHHHH'. -Weinberg, p.152
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 14th Jul 2009 20:48
Thanx bobbel for a very fast answer, thats what i love with you guys and this forum

Unfortunately it didnt work, i also tried to write enable object zdeapth but with no results

Hello!
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 14th Jul 2009 21:03
wait i secound, i forgot to tell that my game is a top downshooter, so maybe i should disable the ydept instead. But i cant find any god command for doing so

Hello!
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 14th Jul 2009 21:05
Can you post a picture of what your problem is?

Oh No, there's too much blood in my caffeine system!
Stack Overflow: Too many pancakes...
The programmer's national anthem is 'AAAAAAAAHHHHHHHH'. -Weinberg, p.152
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 14th Jul 2009 21:30
Sure! this is how it looks

Hello!

Attachments

Login to view attachments
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 14th Jul 2009 23:33
So, what your problem is is that the black part is pasted OVER object 99? If so, the only solution is to not paste the image or work around that problem by using boxes drawn every loop. What you also could do is make the part that is overlapping object 99 transparent. In gimp this is really easy, just right click on the layer, click add alpha channel, select the area you want to be transparent and press the [Del] button. Now save it as a png, and use paste image 300, X, Y, 1 to paste the image, and not the sprite command.



Oh No, there's too much blood in my caffeine system!
Stack Overflow: Too many pancakes...
The programmer's national anthem is 'AAAAAAAAHHHHHHHH'. -Weinberg, p.152
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 15th Jul 2009 05:56
Just use a sprite for the health bar - don't bother with objects. You can easily make the health bar as long as it needs to be with SIZE SPRITE and it will always appear on top of everything else but other sprites.



Diggsey: I have a spine and memory, but one memorable guy says he hates me. What am I?
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 15th Jul 2009 20:49
BMacZero: Can you please make a working example code for a sprite that you control the size of with ex left/right arrowkeys. Then i learn the basics from the master himeself

Hello!
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 16th Jul 2009 01:18
Quote: "Then i learn the basics from the master himeself"

I'm flattered .

It's pretty straightforward if you don't mind the image getting 'squashed' as the health bar changes. Load the image, make a sprite out of it, and simply use SIZE SPRITE to change it to whatever length you need:



If you don't want the image to get squashed, you'd have to use memblocks, which are a little more in-depth:



Ask if you have any questions!



Diggsey: I have a spine and memory, but one memorable guy says he hates me. What am I?
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 16th Jul 2009 01:22 Edited at: 16th Jul 2009 01:22
This i how i did (after some searching in the forum). dont really work all the way, healtbart "disapear"(move out of sight i think) when press rightkey, and i get errormessage once i press the left key.



Hello!
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 16th Jul 2009 01:26
I think the main problem with that is that you never set X and Y to anything. It is pasted at X,Y at the start. When you press the rightkey, it is sized to X+1,Y. Y is always 0, so the sprite will never be visible. When you press left, it gives an error because you cannot size a sprite with a negative value.



Diggsey: I have a spine and memory, but one memorable guy says he hates me. What am I?
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 16th Jul 2009 23:22
finaly i got it work. thanks for all tips

this is the code i wrote:





Hello!

Login to post a reply

Server time is: 2024-11-24 03:39:10
Your offset time is: 2024-11-24 03:39:10