• Advertisement
Sign in to follow this  

sprite.Begin(...) transperency ?

This topic is 4339 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all. I have come to next piece of code which is actualy does what i want(displays both textures): static_texture does not contain transperent pixels dynamic_texture contains transperent pixels sprite.Begin(SpriteFlags.None); sprite.Draw2D(static_texture, Rectangle.Empty, SizeF.Empty, new PointF(0, 0), Color.Transparent); sprite.End(); sprite.Begin(SpriteFlags.AlphaBlend); sprite.Draw2D(dynamic_texture, Rectangle.Empty, SizeF.Empty, new PointF(256, 256), Color.Green); sprite.End(); I suppose that two sprite.Begin()...sprite.End() operations are time consuming. is it possible to display both transperent and non transperent textures in one sprite.Begin()...sprite.End() block. Is the next piece of code possible without disrupting the static_texture pixels: sprite.Begin(SpriteFlags.AlphaBlend); sprite.Draw2D(static_texture, Rectangle.Empty, SizeF.Empty, new PointF(0, 0), Color.Transparent); sprite.Draw2D(dynamic_texture, Rectangle.Empty, SizeF.Empty, new PointF(256, 256), Color.Green); sprite.End(); Becouse as a result of above operation i get all the white color filled with the color specified in sprite.Draw2D(..., Color.THE_COLOR). By the way if Color.THE_COLOR = Color.Transperency then the static_texture is invisible is sprite.Begin(...) is fast enough and should i leave those two sprite.Begin()...sprite.End() blocks ??? [Edited by - _Tank_ on April 5, 2006 1:28:04 PM]

Share this post


Link to post
Share on other sites
Advertisement
Usually you need some way of measuring these kinds of things. What are you measuring it against? What do you want the metrics to be?
I would say that it's pretty close to the unmanaged ID3DXSprite's Begin method and so you shouldn't be worried. The whole reason behind ID3DXSprite and Sprite is simplicity.

I hope this helps.
Take care.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement