texture from texture ??
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 ??
Texture coordinates!!!
Laurent - http://www.lafaqmfc.com/
My little game: http://www.lafaqmfc.com/starshooter.htm
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]
[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]
[Edited by - kmsixpence on October 17, 2005 7:13:49 PM]
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
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
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement