C++ D3D9 fixed sprite / texture size

0

i want to know how to resize my textures and draw them without cutting off the texture

so it should be only smaller scaled like for example 50x50 pixels without cutting off from the image

                    ss->Begin(D3DXSPRITE_ALPHABLEND);

                    // Texture being used is 64 by 64:
                    D3DXVECTOR2 spriteCentre = D3DXVECTOR2(32.0f, 32.0f);

                    // Screen position of the sprite
                    D3DXVECTOR2 trans = D3DXVECTOR2(10.0f, 80.0f);


                    D3DXMATRIX mat;

                    D3DXVECTOR2 scaling(1.0f, 1.0f); // i want to use width and lenght in pixel if possible


                    D3DXMatrixTransformation2D(&mat, NULL, 0.0, &scaling, &spriteCentre, 0, &trans);


                    ss->SetTransform(&mat);

                    // Draw the sprite 
                    ss->Draw(myTexture, NULL, NULL, NULL, 0xFFFFFFFF);
                    ss->End();

any help would be appreciated :) bye

c++
textures
sprite
asked on Stack Overflow Sep 21, 2018 by rck

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0