Page 1 of 2

Draw a Resizeable Circle?

PostPosted: Fri Dec 17, 2010 10:46 pm
by YetAnotherSuperhero
Hi, maybe this was asked before.

But, I need to draw a circle that wont get fuzzy/pixelated no matter what size. And it needs to VERY big so I can't prerender it and shrink it down.

I thought I could do this with the canvas object, But I can't find it. And I remember in earlier builds of Construct a Circle.FX which might work.

Any help?

Re: Draw a Resizeable Circle?

PostPosted: Fri Dec 17, 2010 11:05 pm
by QuaziGNRLnose
if its an outline of a circle you want, you can use a canvas object, if you want a filled circle, your going to make some custom code with distort maps and stuff. how BIG does it have to be, and whats the intended use?

Re: Draw a Resizeable Circle?

PostPosted: Fri Dec 17, 2010 11:13 pm
by YetAnotherSuperhero
[quote:1mvhoz63]how BIG does it have to be?[/quote:1mvhoz63]

Um, that's the thing HUGE. And I mean huge big. Thousands of pixels across, If the player comp can handle it. (It is a settable preference in the game)

[quote:1mvhoz63]and whats the intended use?[/quote:1mvhoz63]

An area of influence between objects so the player can monitor the strength.

Re: Draw a Resizeable Circle?

PostPosted: Fri Dec 17, 2010 11:57 pm
by newt
That kind of rules out canvas, it can only draw when its on screen.
Plus it can take up a lot of ram.

Does the player actually have to see the hole?

If so you could apply the colored outline fx to a pre rendered sprite. It has an alpha setting that should help when you get a little "jaggy".

If you don't need to see it, you could always go with distance(x1,y1,x2,y2).
Where x1,y1 are the center of the object, and x2,y2 are the other objects.

Re: Draw a Resizeable Circle?

PostPosted: Sat Dec 18, 2010 12:00 am
by Arima
If you can't get decent performance, you might want to do what starcraft 2 does with the range of siege tanks instead or as a fallback it it hits the framerate. I can't find a screenshot atm but it puts a ring of sprites around the range instead of a solid ring.

Re: Draw a Resizeable Circle?

PostPosted: Sat Dec 18, 2010 6:11 pm
by QuaziGNRLnose
As is said, if you want only an outline, the canvas will work perfectly, you just need to use a loop and do a bit of trig, and the canvas can stay the same size on screen (full window) it doesn't need to be bigger

Re: Draw a Resizeable Circle?

PostPosted: Sat Dec 18, 2010 8:14 pm
by newt
[quote="QuaziGNRLnose":1jm57wrl]As is said, if you want only an outline, the canvas will work perfectly, you just need to use a loop and do a bit of trig, and the canvas can stay the same size on screen (full window) it doesn't need to be bigger[/quote:1jm57wrl]

Not sure what you mean. Are you talking about a portion of the circle?

Here's this till someone figures out a trig version.
[url:1jm57wrl]http://dl.dropbox.com/u/666516/circle.cap[/url:1jm57wrl]

Re: Draw a Resizeable Circle?

PostPosted: Sun Dec 19, 2010 2:10 am
by Yarfapet
Do you want something like this?
http://dl.dropbox.com/u/10316081/circle.cap

You will need
Disk Effect: tulamide
viewtopic.php?f=29&t=5703
Alpha Inverse effect: Made just for this
http://dl.dropbox.com/u/10316081/Alpha%20Inverse.fx

Re: Draw a Resizeable Circle?

PostPosted: Sun Dec 19, 2010 5:13 am
by R0J0hound
Here is a cap with some additional ways to make a circle with the canvas object:
1. Filled circle.
2. Polyline circle. (the trig way)
3. Graph of a circle.
[url:3qm5py8i]http://dl.dropbox.com/u/5426011/examples3/circle.cap[/url:3qm5py8i] made in 0.99.96.

Re: Draw a Resizeable Circle?

PostPosted: Sun Dec 19, 2010 8:55 am
by newt
Haha, now that's service.

Question tho, is anyone else getting lines across the bottom of the filed circle?