[SOLVED] Pie wedges / Pie slices / Pie segments

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
nordbjerg
Prole
Posts: 12
Joined: Thu Jun 13, 2013 9:17 pm

[SOLVED] Pie wedges / Pie slices / Pie segments

Post by nordbjerg »

Hey guys!

Could any of you help me out on rendering a pie wedge aka. a pie slice? I don't really know how to go about this. I would like to draw some influence from the C function pieslice(x, y, startAngle, endAngle, radius) for the syntax.

Thanks! :nyu:

TL;DR / Solution
davisdude wrote:love.graphics.arc.()
They have an example of how to draw pacman! :)
Last edited by nordbjerg on Thu Jun 13, 2013 10:57 pm, edited 2 times in total.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Pie wedges / Pie slices

Post by davisdude »

love.graphics.arc.()
They have an example of how to draw pacman! :)
Last edited by davisdude on Thu Jun 13, 2013 10:03 pm, edited 1 time in total.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
veethree
Inner party member
Posts: 875
Joined: Sat Dec 10, 2011 7:18 pm

Re: Pie wedges / Pie slices

Post by veethree »

Perhaps you could use a polygon.
nordbjerg
Prole
Posts: 12
Joined: Thu Jun 13, 2013 9:17 pm

Re: Pie wedges / Pie slices

Post by nordbjerg »

davisdude wrote:Check out the last argument of 'love.graphics.circle' (it's segments, by the way).
I am not sure that we are on the same page. :brows: I need to render something like this:

Image

Basically what I want to do, is make it so I can create nodes from other nodes. Each node has a specific size, which is also reflected in the size of the pie wedge, segment, slice, or whatever. :P
veethree wrote:Perhaps you could use a polygon.
I will definitely look into that. :)
nordbjerg
Prole
Posts: 12
Joined: Thu Jun 13, 2013 9:17 pm

Re: Pie wedges / Pie slices

Post by nordbjerg »

davisdude wrote:love.graphics.arc.()
They have an example of how to draw pacman! :)
Yes! This is what I was looking for :awesome:

Thank you kindly, sir! :ultrahappy:
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: [SOLVED] Pie wedges / Pie slices / Pie segments

Post by davisdude »

No problem! :awesome:
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 9 guests