Sign in to follow this  
mobii

Manage C# Many Textures from one Picture

Recommended Posts

mobii    122
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)
{
	sprite.Draw2D
	(
		t,
		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),
		Col
	);
}



I get this Graphical error: http://62.101.51.60/BLH/images/user/8_0327195902.jpg 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
mobii    122
I just write say me get help from Post:
http://www.gamedev.net/community/forums/topic.asp?topic_id=306845&whichpage=1?

to get Picture in right size I use:

spriteTexture = Direct3D.TextureLoader.FromFile
(
device,
@"..\..\t.tga",
1000, // Picture Width
1000, // Picture Height
0,
Direct3D.Usage.None,
Direct3D.Format.A8R8G8B8,
Direct3D.Pool.Default,
Direct3D.Filter.None,
Direct3D.Filter.None,
0xFFFFFF
);
// 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