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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - William_Hazem

Pages: [1]
1
Graphics / Re: SFML custom shape, problem with fill vertex
« on: June 19, 2021, 12:38:39 am »
Thanks!

2
Graphics / SFML custom shape, problem with fill vertex
« on: May 27, 2021, 10:29:59 pm »
I'm Trynig to make a Arrow Class that extends the sf::Shape, but when i draw the shape this happen:



Outline are correct, but when i set the fill color, it's fill outside the area.


unsigned int Arrow::getPointCount() const {
    return 5;
}

sf::Vector2f Arrow::getPoint(unsigned int index) const {
    float x = origin.x;
    float y = origin.y;

    if(index == 0)
        return {x, y - tickness/2};
    else if(index == 1)
        return {x + length, y - tickness/2};
    else if(index == 2)
        return {x + length, y - tickness/2 - 30.f};
    else if(index == 3)
        return {x + length + 30.f, y};
    return {x , y};
   
   
}
 

Pages: [1]