Problems with Vertices and Sprite - override

LDV

Freshman
Joined
Dec 29, 2003
Messages
31
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
 
Back
Top