This is a single-sprite slider control with several configuration settings: - Slider scale Max & Min - Slider bar length (currently changes X and Y size. See Notes.) - XY position of slider bar - Initial value of slider (and corresponding pointer position). It works best in the player. In the editor, the slider value only updates after you release the pointer. Dragging the pointer in the Y direction also often produces strange behavior. The slider returns whole numbers. To get decimals, use a Min and Max that are 10 or 100 times farther apart than the range you actually need, then divide the result by 10 or 100. If you set Min and Max so that the range between them is greater than the slider bar length setting (SliderSizePix), the pointer won't be able to be set for every number in the range. Some numbers will be skipped, so keep this in mind if you'd like your user to be able to select every number between Min and Max. You can either use a narrower range or a longer slider bar.
Original Project by AonymousGuy. The original and this remix are good examples of single-sprite programming using clones with very different looks and behaviors. Several enhancements to the initial project: - pointer grows when you mouse over it - slider control object can be positioned anywhere - Min and Max slider values can be set independent of slider bar size - pointer jumps directly to max or min when you drag off the scale - streamlined the scripts in a few places - slider size can be changed - zero mark clone shows zero position - slider value variable appears while sliding pointer Future enhancements: - grow slider bar only in the X direction (see below) - grow pointer based on slider bar size Changing the slider bar size is currently done using the [Set Size to ( ) %] block. We're working on a way to only grow the bar in the X direction. The slider bar costume is 120 pixels long. This should allow you to pick bar lengths of 1/2, 1/3, 1/4, 1/5, 1/6, 1/8, 1/10, 1/12, etc. of the original length and still get clean graphics. This hasn't been tested much, but initial results are encouraging. When setting the displayed length greater than 120, you should be able to get clean graphics at (120 plus multiples of 10, 12, or 16). For example, a SliderSizePix value of 136 (120+16) should look pretty good. This hasn't been a high priority among all the things we're working on and testing, so please post your results. A current quirk is that you can pick up the pointer if you hold the mouse button down and then drag the mouse across the pointer. An escapement could be added to handle this behavior if it becomes a problem.