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

Author Topic: [SFML 2.0] How to change point color in RectangleShape?  (Read 1299 times)

0 Members and 1 Guest are viewing this topic.

ThreeDumps

  • Newbie
  • *
  • Posts: 34
    • View Profile
[SFML 2.0] How to change point color in RectangleShape?
« on: October 15, 2012, 04:56:03 pm »
I want to do health bar by using RectangleShape. In sfml 1.6 it was possible to change color for some points in Shape and receive a gradient effect instead color fill. It is possible with RectangleShape? I don't see appropriate function. So...

How to change chosen point color in RectangleShape?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10835
    • View Profile
    • development blog
    • Email
Re: [SFML 2.0] How to change point color in RectangleShape?
« Reply #1 on: October 15, 2012, 04:59:25 pm »
You can't directly with sf::RectangleShape but you can use a sf::VertexArray instead and change the color for each vertices.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/