Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Im having trouble rendering with sprites

 

device.clear(....)

device.beginscene()

sprite.begin(SpriteFlags.AlphaBlend)

sprite.draw2d(Texture,Rectangle.Empty,new Rectangle(0,0,100,100),new Point(),Color.Black)

sprite.end()

device.endscene()

device.present()

 

Simple enough render sequence but the sprite is no where to be found. (What i want is to render a texture with Black Transparant) Help please?

Edit Directx 9.0C

Posted

My Bad

 

The Sprites do work its just that the color supplied is more like Lighting than Transparancy, So i guess the next question is how to apply transparancy to a texture, as far as i can tell the way to do it is to get the surface of the texture make a copy the use UpdateSurface to update the texture surface using the copy while applying a color key, but my attempt to do so failed to make the color transparant i will post code shortly but im without internet right now so it may take a while.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...