sprite problem

cant seem to get this to work right my idea is to paint maybe 20-30 sprites that hang in front of the view of the camera here is the code

sprite.Begin(SpriteFlags.Billboard);

DrawStars(device);

sprite.End();

public void DrawStars(Device dev)

{

float x = camera2.EyeLocation.X - camera2.LookAt.X;

float y = camera2.EyeLocation.Y - camera2.LookAt.Y;

float z = camera2.EyeLocation.Z - camera2.LookAt.Z;

for(int i = 0; i< 20;i++)

{

sprite.Draw(texture, new Vector3(24/2,24/2,1), new Vector3(x, y, z), System.Drawing.Color.White.ToArgb());

}

}

this is how I setup my texture

texture = TextureLoader.FromFile(d, file, 24, 24, 0, Usage.None, Format.R5G6B5, Pool.Managed, Filter.Point,Filter.Point, 0);

right now nothing is showing up this is why I havent placed math in the for loop but any Ideas there would be great also

thanks for any help you can offer



Answer this question

sprite problem

  • sprite problem