texture from texture ??

Started by
11 comments, last by Scarface5013 22 years, 2 months ago
for my little sprites i want to load a file with all sprites in it. but a time a only want to show one. so i want to copy a part from a texture in a texture. is there any method ?? or what is the proper way ??
Advertisement
Texture coordinates!!!

Laurent - http://www.lafaqmfc.com/
My little game: http://www.lafaqmfc.com/starshooter.htm
If you want to create a new texture from a part of an old, look into the copy rects function. I''m not an expert but I think that might be what your lookig for

[Edited by - kmsixpence on October 17, 2005 7:12:00 PM]
If you want to create a new texture from a part of an old, look into the copy rects function. I''m not an expert but I think that might be what your lookig for

[Edited by - kmsixpence on October 17, 2005 7:13:49 PM]
As Laurent said.
---visit #directxdev on afternet <- not just for directx, despite the name
very funny. thx for help. hahhaha. i don''t speak spanish so a spanish side doesn''t help me much. and "TEXTURE COORDINATES" is a nice word, but not very helpfull
You don't have to map the entire texture onto your quad. Use coordinates less than 1 to map a smaller area of your texure onto the quad.
So that instead of using (for your texure coordinates):
0,0 - 1,0
0,1 - 1,1

You'd use:
0,0 - 0.5,0
0,0.5 - 0.5,0.5

Of course you don't have to use 0.5, the value depends on how many sprites you've got on a texture, and how you've arranged them, but hopefully you get the idea.

John B

Edited by - JohnBSmall on February 16, 2002 5:40:49 PM
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
yes this is true. but i don''t want to put this texture on a quad. i want to put it in the sprite. perhaps for d3d it''s the same but i need something where i can use pixel-coordinates of the bmp which i loaded in the texture. perhaps you know something like this ??
yes this is true. but i don''t want to put this texture on a quad. i want to put it in the sprite. perhaps for d3d it''s the same but i need something where i can use pixel-coordinates of the bmp which i loaded in the texture. perhaps you know something like this ??
Well I''m not sure exactly what you mean by sprite. If you''re using the ID3DXSprite interface then it lets you specify a source rectangle when you draw it I think.
But it doesn''t sound like you''re using that. You really need to define sprite.
Although actually, I only know about DX8.1, so if you''re using DX7, then I can''t help anyway.

Sorry,
John B
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.

This topic is closed to new replies.

Advertisement