How do you render a portion of a sprite?

Anything libgdx related goes here!

How do you render a portion of a sprite?

Postby terabix » Fri Apr 21, 2017 6:20 pm

Say for the instance of a textured health bar or a loading bar. You have a sprite and you only want to render half of it. You don't want to resize it because that would stretch it and make the patterning on it look weird.

Is there a way to render only a portion of it? How would I hide/show more and more of it over time or when the player performs an action or gets hit?
terabix
 
Posts: 47
Joined: Mon Feb 20, 2017 8:05 pm

Re: How do you render a portion of a sprite?

Postby evilentity » Fri Apr 21, 2017 6:42 pm

You can change the width/height of the region.
Need a freelancer? PM me!
evilentity
 
Posts: 3582
Joined: Wed Aug 24, 2011 11:37 am


Return to Libgdx

Who is online

Users browsing this forum: Bing [Bot] and 20 guests