Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Ok, Guys, Thanks i did it.

 

But there is still a problem.

If i draw somethings uding .UpdateSurface or .StrechRectangle the quad shows transpernet on them. - that's OK.

But if i draw something using the Sprite object (Yes - with Alpha flags) it draw over the Quad, and i can not see the transpernt quad.

 

Maybe it's something for the order i do the:

m_sprite.Begin(SpriteFlags.AlphaBlend);??

 

Or maybe it's something using the .Z property??

 

Here is some code:

The Vertex:

m_device.RenderState.CullMode = Cull.None;

m_device.VertexFormat = CustomVertex.PositionColored.Format;

 

m_vertexFade = new VertexBuffer(typeof(CustomVertex.PositionColored), 6, m_device, 0, CustomVertex.PositionColored.Format, Pool.Default);

CustomVertex.PositionColored[] fverts = (CustomVertex.PositionColored[]) m_vertexFade.Lock(0, 0);

fverts[0] = new CustomVertex.PositionColored(0, 0, 1, m_clrFade.ToArgb());

fverts[1] = new CustomVertex.PositionColored(0, 768, 1, m_clrFade.ToArgb());

fverts[2] = new CustomVertex.PositionColored(1024, 768, 1, m_clrFade.ToArgb());

 

fverts[3] = new CustomVertex.PositionColored(0, 0, 1, m_clrFade.ToArgb());

fverts[4] = new CustomVertex.PositionColored(1024, 0, 1, m_clrFade.ToArgb());

fverts[5] = new CustomVertex.PositionColored(1024, 768, 1, m_clrFade.ToArgb());

m_vertexFade.Unlock();

 

The drawing of the obeject with Sprite object:

sprite.Draw(m_texture, m_rect[num], new Vector3(0, 0, 0), new Vector3(x, y, 0.5F), Color.FromArgb(255, 255, 255, 255));

 

Thank you all in advance, LDV

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...