Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Curving a sprite/shape  (Read 2365 times)

0 Members and 1 Guest are viewing this topic.

Megatron

  • Newbie
  • *
  • Posts: 22
    • View Profile
Curving a sprite/shape
« on: July 05, 2011, 02:30:54 am »
I was wondering if it's possible to curve a sprite in a radial manner? I'm asking as I'm trying to make a straight line curve into a circular shape on one end? Here's an example of what I mean.

This is a template for displaying character information in battle:



I have a green HP bar that fills the bottom bar of the template like so:



I would like to be able to wrap that bar along the loop. I know I could create the gradient bar itself with the loop shape, but that doesn't help when I need to change the subrect/scale of the gradient bar to show a loss of HP for the character.

Do I need to do direct OpenGL calls to do that? Could someone help me out, I'd appreciate it.

I'm using SFML 2 from the start of June if that matters.

Thanks

aquaglow

  • Newbie
  • *
  • Posts: 15
    • View Profile
Curving a sprite/shape
« Reply #1 on: July 05, 2011, 12:34:00 pm »
I believe this is on the "To Do" list for v2:
https://github.com/SFML/SFML/issues/1

Someone describes a method of masking here by overriding draw and using the OpenGL API Directly, might be helpful: http://www.sfml-dev.org/wiki/en/sources/masking_using_alpha_and_blending

 

anything