Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Almost there.... help with finishing touch on radial progression bar? Rotation is off.

Author
Message
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 16th Apr 2018 02:16 Edited at: 16th Apr 2018 02:28
Hey Guys,

Been trying to work on this for quite a bit. Trying to make a "radial anti-progress bar" that goes counter clockwise. Point is to go from full to empty like your gas gauge(well, except a full circle )

I have it working almost 100%, but the "rotation" is off. The direction goes in counterclockwise and clockwise direction! Taking half off in each direction. So, I need to rotate it it -90 degrees, or figure out why it is reducing both sides.

If I try to rotate the sprite using setspriteangle() nothing happens. If I try to render2dback() and getimage() there is no image to create a sprite. I appreciate your help.

agk code


.vs


.ps


If anyone has good suggestions for a good GLSL/ES guide/tutorial, I would love to hear. I bought and read OpenGL ES 2.0 Programming Guide, but I really think that is elementary level stuff that can be learned from a few google searches for free.

Attachments

Login to view attachments
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 16th Apr 2018 14:03 Edited at: 16th Apr 2018 14:04
I made a progression bar using masking: Usefull Comunity Shader Thread
I also cleaned up your shader a bit, so you can continue working until you get your desired effect: Progressbar.zip

Attachments

Login to view attachments
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 16th Apr 2018 15:59
Thanks Janbo! I will look at your progression bar, and see what I can learn.
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 16th Apr 2018 22:03
Here's some code I was playing with from the other thread about a "circle timer":

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 7th May 2018 17:29 Edited at: 11th May 2018 06:04
something like this

I did similar to my above code and made a speedometer easy enough to modify

but the easiest way to have a character progression bar for health might be is to use two sprites
one for the health of player in full health and another that is over the top that gradually removes
the green areas.
fubar
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 8th May 2018 13:31
There's a nice Health Meters library by JohnnyMeek here: https://forum.thegamecreators.com/thread/217856 (non-shader approach - worth noting that any functions that require a percentage in this lib, actually require a float between 0 and 1).

Login to post a reply

Server time is: 2024-03-28 08:28:20
Your offset time is: 2024-03-28 08:28:20