Scaling width of a ID3DXSprite

Started by
1 comment, last by shrt 20 years, 2 months ago
Alright, so how do I make a sprite wider? I know it scales itself by the size of the texture used.. But there must be a way to scale it manually? The thing is, I want to make some sort of power-meter, which gradually enlargens in length, when a mousebutton is pressed, you know what i'm talking about for sure. [edited by - shrt on January 25, 2004 2:28:00 PM]
Jacob H. Hansen - My Website
Advertisement
Use D3DXMatrixTransformation2D and ID3DXSprite::SetTransform. Then, when you call ID3DXSprite::Draw, pass in NULL for pPosition, since it can be included in the matrix as well.

xyzzy
If you want to do a power-meter why then instead of enlarging the same sprite as the meter increases, simply slips your texture?, I mean, you can have your meter texture as if it where at 100%, then, lets say you just have 50% of power, so display only one half of your sprite, I think that would make a better effect tan enlarging the same pic. ID3DXSprite::Draw can accept a RECT structure as clip parameter.

Hope that helps.
My site Jvitel.com

This topic is closed to new replies.

Advertisement