ui
ui copied to clipboard
[Feature request] Add more Slider configurations
Please Describe The Problem To Be Solved
- There are cases when one might need slider to be vertical (changing angle breaks other things)
- Slider does not support steps as described in #37
(Optional): Suggest A Solution
I imagine a type property for slider orientation would do. Then, a step property with default value of 1 to maintain backwards compatibility.
If the team is open to these features, I could create PRs for the things mentioned above.
Hi, @CatchABus. Feel free to make a PR. The progress bar, which is the base for the slider, already supports orientation.
Hi, @CatchABus. Feel free to make a PR. The progress bar, which is the base for the slider, already supports orientation.
Hi @CyberDex . Thanks a lot for the quick response! Is there any example regarding vertical progress bar? I couldn't find anything in the docs.
Hi, @CatchABus. Feel free to make a PR. The progress bar, which is the base for the slider, already supports orientation.
Hi @CyberDex . Thanks a lot for the quick response! Is there any example regarding vertical progress bar? I couldn't find anything in the docs.
It is here: https://pixijs.io/ui/storybook/?path=/story/components-progressbar-usegraphics--use-graphics (check the Controls tab)
Hi, @CatchABus. Feel free to make a PR. The progress bar, which is the base for the slider, already supports orientation.
Hi @CyberDex . Thanks a lot for the quick response! Is there any example regarding vertical progress bar? I couldn't find anything in the docs.
It is here: https://pixijs.io/ui/storybook/?path=/story/components-progressbar-usegraphics--use-graphics (check the Controls tab)
That is the rotation approach which I've already tried. Storybook sample code contains this:
if (vertical)
{
progressBar.rotation = -Math.PI / 2;
view.y += view.height / 2;
}
else
{
view.x += -view.width / 2;
}
Unfortunately this doesn't work very well on Slider. That component uses sprites width and height for calculating slider alignment and rotation doesn't work very well at times.
I'll create a PR for this one just to make the problem more apparent.