Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Draw health bar?
Topic Started: Oct 9 2008, 07:27 PM (1,139 Views)
mwonline
Member Avatar
Newbie
[ * ]
Hi all,
I am new to Ultimate 3D.
and i have problems to draw the health bar.
I tried some things but he don't showed the health bar.
So, my question is:
"How must I draw the Health bar in Ultimate 3D"

Please answer



Offline Profile Quote Post Goto Top
 
skarik
Member Avatar
kitten eating scum
[ *  *  *  *  *  * ]
http://u3d.xinto.net/Documentation/_2DGraphics.htm
Blog|EHS
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Are you trying to use GM's own function for drawing health? If so, then that won't work. You have to use U3D's drawing functions to be able to draw stuff to the screen. In this case you will have to use:
Code:
 

DrawTexEx(
TextureIndex,
Left, Top,
Width, Height,
X, Y,
ScalingX, ScalingY,
Rotation,
R, G, B, A
);
Offline Profile Quote Post Goto Top
 
mwonline
Member Avatar
Newbie
[ * ]
Thanks,

He draws now the health bar.

Thanks alot
Offline Profile Quote Post Goto Top
 
hakan55555
Member Avatar
Forum Leader
[ *  *  *  *  * ]
More; developed, one health bar how, do?

This like;
Posted Image

tube like...
Attached to this post:
Attachments: xxx.jpg (6.35 KB)
Edited by hakan55555, Oct 9 2008, 08:41 PM.
http://www.gde.ile.biz -Visual Desing Team group
Offline Profile Quote Post Goto Top
 
SonicMX
Member Avatar
Advanced Member
[ *  *  * ]
hakan55555
Oct 9 2008, 08:40 PM
More; developed, one health bar how, do?

This like;
Posted Image

tube like...
What about simplily drawing 2D Images? Just create billboards for the bars, then scale them as health's value.
I haven't tried yet, but Im sure it works.
Soy español de España, y malo en mates, y.. ¿intento hacer un juego? estoy loco xD
Offline Profile Quote Post Goto Top
 
Bazza
Member Avatar
Forum God
[ *  *  *  *  *  * ]
that would require transpanency for the corners wich would mean theyd have to be saved as png
My instinct is to hide in this barrel, like the wily fish.
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
bazza games
Oct 10 2008, 01:41 AM
that would require transpanency for the corners wich would mean theyd have to be saved as png
No, pixels with rgb values 64,128,96 are rendered as transparent (or something like that.) Make sure no compression is used (do not use JPEG format)
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
Reikyrr
Forum God
[ *  *  *  *  *  * ]
Eanbro
Oct 10 2008, 06:20 AM
bazza games
Oct 10 2008, 01:41 AM
that would require transpanency for the corners wich would mean theyd have to be saved as png
No, pixels with rgb values 64,128,96 are rendered as transparent (or something like that.) Make sure no compression is used (do not use JPEG format)
I had problems with transparancy somone confirm this message?
~Inspirational quote~
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
I don't remember the exact values. You can easily look inside the help file to find out.

By the way, what the hell is in your signature? It looks awesome!
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
mwonline
Member Avatar
Newbie
[ * ]
I have a problem.
When I draw the health bar with var then it looks like:
Image
And how I get it to normal size.




I have used this code:
Quote:
 
DrawTexEx(
2,
1, 1,
global.Health*1.26, 1,
70, 16,
1, 1,
0,
255, 255, 255, 255
);

Offline Profile Quote Post Goto Top
 
luenardi
Member Avatar
Cofee Machines Rock
[ *  *  *  *  *  * ]
DrawTexEx(TextureIndex,Left, Top,Width, Height,X, Y,ScalingX, ScalingY,Rotation,R, G, B, A)

adjust the scale instead..

Dude this isnt that hard.
think abit.
Posted Image

For your perception no.
But my universe has no such limits.


www.recall.co.nr
Offline Profile Quote Post Goto Top
 
mwonline
Member Avatar
Newbie
[ * ]
luenardi
Oct 11 2008, 10:06 AM
DrawTexEx(TextureIndex,Left, Top,Width, Height,X, Y,ScalingX, ScalingY,Rotation,R, G, B, A)

adjust the scale instead..

Dude this isnt that hard.
think abit.
i don't understand
Offline Profile Quote Post Goto Top
 
luenardi
Member Avatar
Cofee Machines Rock
[ *  *  *  *  *  * ]
global.Health* >>>>1.26<<<<make sure this value is correct

and round off the value

global.Health*1.26 = 10.34

round off

10.34 <<< remove comma
=10
Edited by luenardi, Oct 11 2008, 12:23 PM.
Posted Image

For your perception no.
But my universe has no such limits.


www.recall.co.nr
Offline Profile Quote Post Goto Top
 
MysteriXYZ
Member Avatar
Master Matrix Masher
[ *  *  *  *  *  * ]
As you probably read, Left, Top, Width and Height have to do with texture coordinates (often called "UV-coordinates"). These are not measured in pixels, but are relative to the origin and size of your texture. The top left pixel of a texture has <0,0> as UV-coordinates, while the bottom right pixel of the image has UV-coordinates <1,1>.
So if a pixel in a texture image is X pixels to the right of and Y pixels down from the top left corner, its UV-coordinates are <X/TextureWidth,Y/TextureHeight>.

Left and Top are UV-coordinates, while Width and Height are offsets from those coordinates, which are relative to the size of the texture.
If Width is bigger than 1, the part of your texture that will be displayed will be wider than your texture actually is, and this extra space will be filled with a copy of the texture. You could therefore say that Width and Height are the horizontal and vertical tiling factors.

So you will probably want Left and Top to be zero, while Width should be equal to CurrentHealth/MaxHealth.
U3D is like candy; after extensive consumption, it's Best to brush.
Offline Profile Quote Post Goto Top
 
Go to Next Page
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply