Results 1 to 4 of 4

Thread: DirectX8

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    5

    Exclamation 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

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    It's always easier with code to look at
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    5
    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
    Last edited by JBaker; Jul 26th, 2002 at 11:29 AM.

  4. #4
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width