Hi there! I made a thing, but if you're not a plugin maker it's not for you. Sorry.
Does anyone here still make plugins?
...No? Dang.
Well let me show you this anyway

That's right, a slider! It's a bar with a cursor on it that you can drag, and it changes the value of the variable bound to the bar.


And it's a plugin that you can also include in your own plugins! The version 2.0.1 of minimap [not available yet] uses this, so what are you waiting for?
How to useWell if you're not a plugin maker it's not for you. Sorry.
But if you are, it's pretty simple:
- Download the attached file Slider.zip
- Uncompress it in your Plugins folder. It should automatically create the subfolders: \Plugins\Resources\YB\slider, and put the 3 included files inside: Slider.gml, slider.png and cursor.png
- In your own plugin, call execute_file(working_directory + "\Plugins\Resources\YB\slider\Slider.gml");
- You can now create an instance: instance_create(0,0,yb_slider.Slider);
Features- Support for other pictures: just change slider.png or cursor.png and you got a brand new look. You could even just remove the pictures, and the plugin would draw plain rectangles instead!
- Opacity: the slider becomes clearer when you hover it! Basic user experience and ergonomics, whoo!
- Independant from the Menu API: the sliders aren't automatically destroyed when you leave a menu! You have to manually place it, and create empty links in your menu to skip a row! That's totally a feature!
Code wise
- Pass xoffset and yoffset directly as x and y when calling instance_create() !
- Change the width, height, minValue and maxValue of the slider!
- Bind a variable to the slider by setting slider.boundVar!
- Execute a script when you set the value of the slider using slider.onChange! The script accepts one argument, the new value of the slider on release!
// Slider for zoom range
menu_addlink("Zoom range:","");
zoomSlider = instance_create(40 + 200, 140 + 7 * 30, yb_slider.Slider);
with(zoomSlider) {
minValue = 0.2;
maxValue = 5;
width = 300;
boundVar = "global.yb_minimap_zoomRange"
onChange = "gg2_write_ini(section, key_yb_minimap_zoomRange, argument0);"
// heh
section = "Plugins";
key_yb_minimap_zoomRange = "yb_minimap_zoomRange";
}