-
DirectX8
Hi!
I'm writing a 2D multiplayer game. It is basically a beat-em-up style game with two characters facing each other.
The ground is two green triangles, with no texture or anything. The characters are also two triangles but this time with texture. when i make the bg colour on the characters transparent, the ground turns black or worse, disappears completely!!
HELP!!!
Has this happened to anyone else? Do you know why this happens.
Please post me the answer!!
James :D
-
It's always easier with code to look at ;)
-
Here's the module with nearly all the code (all the necessary code anyway): cool:
Notes
TLVERTEX type =
Public Type TLVERTEX
x As Single
y As Single
Z As Single
rhw As Single
Color As Long
specular As Long
tu As Single
tv As Single
End Type
MP3 functions in different module
InitChar function in different module
frmMain controls: tmrItem
THIS CODE DOES NOT HAVE THE TRANSPARENCIES IN!! OR ALL THE FINISHED CODING SUCH AS HEALTH AND SPELLS ETC
-
You need to turn alpha blending on:
Code:
D3DDevice.SetRenderState(D3DRS_ALPHABLENDENABLE, 1)
For this to work, however, your texture needs to have an alpha channel, or you need to load your texture using the D3DXCreateTextureFromFileEx() function, and specify the color that should be transparent.
Z.