This project has moved and is read-only. For the latest updates, please go here.

Drawing part of a texture!

Sep 7, 2015 at 9:41 PM
Hello,

Now sure if the Toolkit supports this and I am not very good at this. But say that I have a circle acting as a healthbar like in Diablo 3 and I would only want to draw a % of that circle image as health goes away sort of.

How would I do it with toolkit? I tried giving it an XMFLOAT2 position and a RECT that would store the updated part of the image it would need to draw but its not working. Does anyone know what math to apply here?

For the bars I was just using a drawing rect and changing but doing that with a circle is bad because it scales the entire circle and not decreases the view able area of the texture
Sep 7, 2015 at 9:44 PM
Edited Sep 7, 2015 at 9:45 PM
For general raster shapes, the typical solution would be to use an animated texture or draw the circle dynamically using Direct2D (possibly using Win2D).
Sep 7, 2015 at 11:25 PM
i am trying to provide a sourceRect which would act as the size of the image say its 1182 by 173 for example so its 0 0 1182 173

and then manipulate the 173 based on % value but dont need anything