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
DrawTexEx() won't draw anything!; huh?
Topic Started: Aug 1 2006, 01:21 PM (316 Views)
joshua
Unregistered

it's kinda strange, but I have copied the code from the help file:
DrawTexEx (number, left, top, width, height, x, y, scalex, scaley, rotation, r, g, b, a)
and filled in the stuff that has to be there, but nothing shows up! maybe I did something wrong...
DrawTexEx (8, 0, 0, width, height, x, y, 1, 1, 0, 255, 255, 255, 1)

Nothing is drawn at all! Please help!
Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
Did you call it in the draw event?

BTW probably this won't be necessary anymore in the next U3D version.
Offline Profile Quote Post Goto Top
 
Evolver
Member Avatar
Advanced Member
[ *  *  * ]
joshua
Aug 1 2006, 11:21 AM
it's kinda strange, but I have copied the code from the help file:
DrawTexEx (number, left, top, width, height, x, y, scalex, scaley, rotation, r, g, b, a)
and filled in the stuff that has to be there, but nothing shows up! maybe I did something wrong...
DrawTexEx (8, 0, 0, width, height, x, y, 1, 1, 0, 255, 255, 255, 1)

Nothing is drawn at all! Please help!

There are possible reasons of your problem:

1. DrawTexEx() must be placed in Draw event and object must be visible.

2. You must assign variables...
width=your picture width
height=your picture height
...or DrawTexEx (8, 0, 0, your picture width, your picture height, x, y, 1, 1, 0, 255, 255, 255, 1)

3. x and y coordinates must be assigned as screen coordinates, where texture will be drawn, otherwise it will be drawn in top left corner (x=0 y=0).

You must use texture sized as power of two, for example 128x64 or 256x256.
Otherwise texture will be scaled.
Offline Profile Quote Post Goto Top
 
joshua
Unregistered

No, all of that isn't the problem. Maybe it's something with the arguments, 'cause DrawTex does work, but DrawTexEx with the same arguments doesn't. Strange eh ? :huh:

Anyway, thanks in advance! ^_^
Quote Post Goto Top
 
Evolver
Member Avatar
Advanced Member
[ *  *  * ]
joshua
Aug 1 2006, 03:02 PM
No, all of that isn't the problem. Maybe it's something with the arguments, 'cause DrawTex does work, but DrawTexEx with the same arguments doesn't. Strange eh ? :huh:

Anyway, thanks in advance! ^_^

Now I get it, you must use alpha 0-255, not 0-1, 255 fully visible.
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
Found the mistake. Alpha is also given in the range from 0 to 255. So if you pass one the result is that the texture gets drawed with a very low alpha.
P.S. width and height are given in the range from 0 to 1. I will explain all these things more detailed in the next version of the help file.
Offline Profile Quote Post Goto Top
 
joshua
Unregistered

Thanks a hundred times! It works! :yahoo: :D ;)
Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply