Filling drawn circles

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I'm building a game at the moment, which sees the player drawing circles, which will then erase anything within those circles.

    Is there any convenient way of doing this without using extensions. I've tried one approach, but it isn't so accurate.

    My method involves checking for an overlap in lines (lines connect points spread as the mouse key is down) and if the user lets go and there is an overlap, long bars come in from each edge and stop when they reach one of the lines/points. This creates a rectangular shape which I can check position in comparison to, but it's really not that accurate (rectangle, rather than the circular shapes that can be drawn).

    Is there any other ways?

  • I think you could have bumped your old thread...

    My Please login to see this link. (which I actually use), my Please login to see this link. (which I mostly don't use), and my Please login to see this link. (which I don't use anymore pretty much at all really). If there are awards for "'highest number of long forum posts", then I'd have probably won at least 1 by now. XD

  • That was helpful. How exactly does the user draw the circles? Dragging a circle with the mouse? Or drawing it paint style?

    There's ten or so points, which have lines scaled and rotated between them to connect them all. While the user is holding down the mouse key, every few milliseconds, it places one of these down and once the user lets go, they all move back to where they were.

    But the problem is that the player can draw a really wide circle and it will act rectangular, so objects which are clearly outside the circle will be included.

  • Can't you find the centre point of the circle based on the positions of the 10 or so points, then loop through the objects and delete any that fall within the radius of the circle? Use this:

    Sqr(((A.x - B.x)*(A.x - B.x)) + ((A.x - B.x)*(A.x - B.x)))

    to find the distance between the two points (A being the circle's centre point, B being the current object in the loop. This is completely off the top of my head, although thanks to this article Please login to see this link. for the equation :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!