When the pos property of a <slider> within a <sidebar> is set via code, both the background blue graphic and the selection cursor on the slider should move (or expand/shrink in the background's case) to match the new value.
Current Behavior
The background of the slider changes to show the new value, but the selection cursor on the slider resets position to 0.
Steps to Reproduce (for bugs)
Create a <slider> within a <sidebar> and add it to the state
Set the onChange function of the slider to update a variable containing, for example, volume for music
Set the pos property of the slider once the sidebar has been shown via .show()
Expected Behavior
When the
pos
property of a<slider>
within a<sidebar>
is set via code, both the background blue graphic and the selection cursor on the slider should move (or expand/shrink in the background's case) to match the new value.Current Behavior
The background of the slider changes to show the new value, but the selection cursor on the slider resets position to 0.
Steps to Reproduce (for bugs)
<slider>
within a<sidebar>
and add it to the stateonChange
function of the slider to update a variable containing, for example, volume for musicpos
property of the slider once the sidebar has been shown via.show()
Media
https://user-images.githubusercontent.com/79861976/154064869-0f9a628c-bd59-4ec5-bd03-48e303ecf5c1.mp4
Test app / minimal test case
PlayState.hx:
sliderTest.xml:
Context
Trying to keep my game's music volume in a variable and set the slider to the right position when the sidebar menu is hidden and shown.
Your Environment