Sign in to follow this  

Manage C# Many Textures from one Picture

Recommended Posts

Manage C# DirectX9 Question: if someone have a example that load one Texture spriteTexture and have a function that can draw one small texture from spriteTexture Example I get from Managed DirectX 9 ISBN: 0672325969 and Example work fine in book but not when me use an other .tga picture this is how me try do: // ------------------------------------------------------------------------ I try take out pictures from t Example try take out picture 6 from row 0: ar.Add(new Art(1000, 1000, 1, 11)); // Add new Sprite ((Art)ar[0]).Draw(sprite, spriteTexture, X, Y, 0, 6, Color.White); // Draw Sprite 6
public void Draw(Sprite sprite, Texture t, int X, int Y, int r, int c, Color Col)
		new Rectangle(X * 50 ,Y * 0, 50, 50),
		System.Drawing.Rectangle.Empty,			// this Rectangle I no know what does
		new System.Drawing.Point(X, Y),

I get this Graphical error: the Blue is what me get on screen and White is Texture spriteTexture small Texturepicture is (0-49 * 0-49) // ------------------------------------------------------------------------ PS: How u spinn (change angle) of sprite? [Edited by - mobii on March 29, 2005 4:59:29 AM]

Share this post

Link to post
Share on other sites
I just write say me get help from Post:

to get Picture in right size I use:

spriteTexture = Direct3D.TextureLoader.FromFile
1000, // Picture Width
1000, // Picture Height
// if u do like this u get Error if u going take out textures from Pic
spriteTexture = TextureLoader.FromFile(device, @"..\..\t.tga"); // OK to whole pic but no to many textures

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this