I'd like to implement some sort of visual percentage representation in my game. Pie charts are the standard for such data, but I'm not sure how to go about them in RenPy in any way that isn't a little hackey (making a 1/360th of a circle and repeating it, for example). Anyone know a good way to go about this? Could I even just do it in Python using whatever rendering base RenPy uses (OpenGL? I'm actually not sure)?
This is a bit of a challenge, to be sure, but it would be neat to see it done.
pie charts
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
- Regular
- Posts: 159
- Joined: Wed May 09, 2012 2:49 am
- Projects: The Diviner
- Organization: Two Crowns Entertainment
- Location: Now: Charlottesville, VA
- Contact:
pie charts
The more you know
Re: pie charts
I'd like to use it as well! If you find a way how to do this, please share >~<
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: pie charts
There isn't really a good way to do this at the moment. At some point, I'll add support for geometry, but we don't have that yet.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Regular
- Posts: 159
- Joined: Wed May 09, 2012 2:49 am
- Projects: The Diviner
- Organization: Two Crowns Entertainment
- Location: Now: Charlottesville, VA
- Contact:
- fluxus
- Regular
- Posts: 133
- Joined: Thu Jun 19, 2014 8:06 am
- Projects: Animal Anaesthesia (a teaching game)
- Contact:
Re: pie charts
Wouldn't a DynamicDisplayable be able to do this?
I think PyGame has some circle and arc functionality. I'm not entirely sure of how PyGame should be used from inside a DynamicDisplayable, or if there's some explodey potentials in that mix, but offhand it seems like a good idea.
I think PyGame has some circle and arc functionality. I'm not entirely sure of how PyGame should be used from inside a DynamicDisplayable, or if there's some explodey potentials in that mix, but offhand it seems like a good idea.
Re: pie charts
Doesn't look like UDD is going to work (edges are messy, both with circle and polygons approach):fluxus wrote:Wouldn't a DynamicDisplayable be able to do this?
I think PyGame has some circle and arc functionality. I'm not entirely sure of how PyGame should be used from inside a DynamicDisplayable, or if there's some explodey potentials in that mix, but offhand it seems like a good idea.
Best bet is to try and slice predefined images but I am not sure how to go about writing that code atm.
- fluxus
- Regular
- Posts: 133
- Joined: Thu Jun 19, 2014 8:06 am
- Projects: Animal Anaesthesia (a teaching game)
- Contact:
Re: pie charts
Hmm. I see what you mean. And yes, sorry, I did mean userdefined displayable.xela wrote:Doesn't look like UDD is going to work (edges are messy, both with circle and polygons approach)fluxus wrote:Wouldn't a DynamicDisplayable be able to do this?
Strange thing with the blurred edges though.
Winter Wolves, in Loren, displayed hit points and mana points with circular-style bars.
Maybe they know something we don't :]
You could always.. rotate and crop a semicircle, then livecomposite with another (or well, the same) semicircle depending on whether you want more or less than 180 degrees.xela wrote: Best bet is to try and slice predefined images but I am not sure how to go about writing that code atm.
Not the most elegant solution, I'm sure :]
Re: pie charts
I think they just used conditioned images in Loren or a custom bar(less likely). I coded a two images bar one of which rotated over the other similar to that for someone on this forum few month back. There is a pretty full circle bar in a game I worked on for a bit made out of 110 images.
I have no idea why udd comes out like that. That was rendered using polygons but even a circle seems to come out edged a bit.
There is no reason for a 'hacky' way not to work. You can even recolor the segment in renpy.
I have no idea why udd comes out like that. That was rendered using polygons but even a circle seems to come out edged a bit.
There is no reason for a 'hacky' way not to work. You can even recolor the segment in renpy.
Who is online
Users browsing this forum: No registered users