Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Pie Charts & Decision Wheels With blink0k's Shader

Author
Message
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 23rd Nov 2020 20:06 Edited at: 24th Nov 2020 10:07
Credit goes to blink0k for helping out and creating the pie chart shader for me, as well as providing a mini demo on how to use it. Thank you.

I've taken that project and tried to create some sample projects showing how to use it for a pie chart and a decision wheel. I have to admit I got a bit lazy with the pie chart so the legends for the pie charts aren't produced in the function that creates the pie chart.

These are as basic as they can get, and if you were to use them you'd need to do a bit of work with them to get them how you want, but they do work. For example the labels on the decision wheel would need rotating if you're going to add longer labels. You may also want to check that it hasn't stopped right in the middle of two, and if it has move it a fraction more.

The random spin duration and speed was also made up on the fly just to see it spin and stop. It may need longer and faster spins.

Lastly, both of these create the circles at position -1000,-1000 because I wanted it to be created in a place where you're highly unlikely to ever have anything behind the circles. Any background image or elements behind the circles as they are being created will be saved in the final image/sprite. Which you won't want. The only problem with creating them in these positions is that you need to jump to the position for Render to work with SetViewOffset, and then back again. This causes a brief flicker as the image appears and disappears before its centred on the screen. Maybe there's a better way to do it.

The reason for the pie chart being half done is because I really only wanted the shader to use for decision wheels. But thought I'd have a go at the pie chart anyway in case it's useful

EDIT: Forgot to attach the project files. Attached now
EDIT 2: New version of decision wheel on the next post
OryUI - A WIP AGK2 UI Framework

Attachments

Login to view attachments
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 23rd Nov 2020 22:35 Edited at: 23rd Nov 2020 22:36
The decision wheel had a few bugs that I didn't see or properly test for. New version attached. You can now set the text direction as horizontal or vertical. I can't get the text to align in the centre of the segment when text direction is vertical. If anyone knows the correct angle and sin/cos math for it then please share.
OryUI - A WIP AGK2 UI Framework

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 23rd Nov 2020 22:47
Nice work on the text

Login to post a reply

Server time is: 2024-04-23 21:57:07
Your offset time is: 2024-04-23 21:57:07