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

Author Topic: noob help with drawing shapes and lines  (Read 1936 times)

0 Members and 1 Guest are viewing this topic.

Chocolatesheep

  • Newbie
  • *
  • Posts: 17
    • View Profile
noob help with drawing shapes and lines
« on: July 05, 2012, 01:46:04 am »
So I have this sprite moving around the screen, and I wanted to draw the path it is taking, sort of like a trail that it's leaving behind. It's not going in a straight line, it's moving in irregular curved paths. I tried drawing it with sf::ConvexShape, but when I do that it connects the first and last point with a line creating a polygon. Well, no surprise there, it is called convexshape after all. I also played around with vertex arrays but I didn't manage to get it to work properly. Does someone have a simple solution for this. Basicly I need the convexshape without it being convex. Oh, and a follow up question. What are the primitives called quads? I get the lines and linestrip, but what are quads?

EDIT: I'm using SFML 2.0 on Windows
« Last Edit: July 05, 2012, 01:47:45 am by Chocolatesheep »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: noob help with drawing shapes and lines
« Reply #1 on: July 05, 2012, 03:58:33 am »
You can easily use a vertex array, just define it as connected lines and then set the points.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything