Page 1 of 1

Transforming a sprite with spritewidth = 1 pixel, Possible ?

Posted: Fri Sep 07, 2007 7:52 am
by DeXtr0
Hey everbody,

During the coding process of a graphic effect I split up a text into slices by using clipping. To achieve my effect I clipped it into sprites with a width of 1 pixel.

Now I want to add a perspective to it so drawing that 1 pixel-width sprite in the Z-direction but transformsprite3D does not do the job since the sprite is only 1 pixel in width (Or am I doing something wrong ?)

Does anybody already tried this or has an alternative for it ?
Since the sprite has a width of 1 pixel I was thinking of a way to do it like LineXY: From XY/Y1 to X2/Y2..

All help would be really appreciated...

Regards,
DeXtr0

Posted: Fri Sep 07, 2007 9:51 am
by Kaeru Gaman
the problem is the fact that your texture is not squarish.

a sprite for a texture has to be squarish and at least 16²

additionally, you can't create a sprite3D from a clipped area, only from complete sprites.

you can create squarsh sprites , clip your source sprite and display the stripes into them.
from those you can create sprite3D.

Posted: Fri Sep 07, 2007 10:13 am
by DeXtr0
Hey Kaeru,

That is correct my sprite is not a square (I should have thought of it !)
In fact , I'm thinking loud now, I don't need Sprite3D.
I can work with a normal 2D sprite too.

Is there a way to draw a sprite from X1,Y2 to X2,Y2 or maybe another way how to transform the 2D sprite into perspective ?

Cheers & thanks for the help already,
DeXtr0

Posted: Fri Sep 07, 2007 10:29 am
by Kaeru Gaman
Is there a way to draw a sprite from X1,Y2 to X2,Y2
ad hoc I would say, clip and display it pixelwise.
but I doubt that would be really performant...

I don't know if there are pattern-line functions with BitBlt...
drawing a line using a row of the sprite as pattern...

Posted: Fri Sep 07, 2007 10:37 am
by DeXtr0
Good idea Kaeru but I think you are right, performancy will decrease.
I'll check bitblt anyway...

Thanks