May 22, 2022, 06:50:03 am

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Due to a rise in bot activity, new posters need to be approved before posting.

Join the community Discord server!

Pages: [1]

Author Topic: [META] Slider  (Read 941 times)

[FR]YB

  • 2013 Haxxy Award Winner
  • *
  • Karma: 28
  • Offline Offline
  • Posts: 642
  • There are 11 people playing holy sh
[META] Slider
« on: June 10, 2015, 04:28:47 pm »

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 use

Well 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!

(click to show/hide)
« Last Edit: June 10, 2015, 04:29:49 pm by [FR]YB »
Logged

ZaSpai

  • Ray Bann's Minion
  • *
  • Karma: 14
  • Offline Offline
  • Posts: 2239
  • "Eeh?! We're just allies!"
Re: [META] Slider
« Reply #1 on: June 10, 2015, 05:28:44 pm »

This actually looks really promising for setting adjustments, thanks for making it :z5:
Logged
Right behind you when you most expect it | classicwell master race

notarctic

  • just arctic, what gives?
  • ******
  • Karma: 8
  • Offline Offline
  • Posts: 4904
  • 👎👀 bad aim ba̷̶ ԁ aIm 👎 thats❌ some bad 👎👎aim
    • arcticland
Re: [META] Slider
« Reply #2 on: June 10, 2015, 06:00:08 pm »

I've always thought this would come in handy but been too lazy to make it so nice job
Logged
[1:37:51 PM] Derpduck: arctic u need to quote ppl that make shit posts in case they edit them
[4:20:15 PM] Rubeus Hashgrid: i cant discover anything fuck you imageshack

Pages: [1]
 

Page created in 0.038 seconds with 36 queries.