Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Scarface5013

texture from texture ??

This topic is 5942 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 ??

Share this post


Link to post
Share on other sites
Advertisement
Texture coordinates!!!

Laurent - http://www.lafaqmfc.com/
My little game: http://www.lafaqmfc.com/starshooter.htm

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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 ??

Share this post


Link to post
Share on other sites
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 ??

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!