Get Element Earth ▶
Support this channel ▶

Follow me on Facebook ▶
Follow me on Instagram ▶
Follow me on Twitter ▶
Follow me on Google+ ▶

▼ More ▼
General Game Maker Playlist ▶
Game Maker Networking ▶

In this video I’ll show you how to code vertical slider bars from scratch. The fun thing about this code is that it’s abstract enough to work with any length and size slide bar sprites you supply it 😀 Catch part 2 for horizontal slider bars.

Part 2 ▶

▼ Useful Links and Resources ▼
Studio Project File ▶
GM 8 Project File ▶

Happy Coding 😀

Nguồn: https://shaarique.com/

Xem thêm bài viết khác: https://shaarique.com/game/

16 Comments

Shanth Narayanan

June 29, 2020

Hey. Nice video. I'm working on a Mining-Simulation game. Is there a way to make the game run automatically at startup? Your guidance would be appreciated. Btw, I'm using GM 8.

Reply

Justin Mazza

June 29, 2020

This was a very helpful tutorial although I'm trying to figure out how to get it to work on the Draw GUI layer. That's where I have the rest of my UI. I can tell the bar/slider to Draw_self(); on the the Draw GUI event and it tracks just fine with the rest of the UI in the view however, I am then unable to interact with it as the instance still sits on the main room layers. Any advice would be appreciated 🙂

Reply

Magic3Frogs

June 29, 2020

Hey! Thanks for the tutorial! I'd like to make both slider and bar objects follow the view's position relative to the room. I got the x coordinates working and the y coordinate of the bar, but the y coordinate of the slider is giving me a tough time… got any leads on that? Thanks!

Reply

Benoz

June 29, 2020

I think the best thing is that you allow us to download your templates. Kee up the good work!

Reply

Meister Channel

June 29, 2020

Guys i was following the same code as the video until this error came up PLLEEASSSE!! HELPPP MEE!!!!!
_________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_vslidebar:

Variable obj_vslidebar.barLength(100007, -2147483648) not set before reading it.
at gml_Object_obj_vslidebar_DrawEvent_1 (line 5) – draw_text (x, y+70, "Bar Length: " + string(barLength));
############################################################################################

Reply

RunNGun/SushiiZ

June 29, 2020

ehhhhhh I'm not sonic please slow down just a bit holy crap

Reply

Purple Ice

June 29, 2020

Lol, "why I give it away for free" Because you like sharing what you've got instead of selling what you've got even if it's complete garbage.

Reply

Xác Ướp

June 29, 2020

eh what is the password for your file?

Reply

Sakexz

June 29, 2020

how do i hook this up to my sound?

Reply

Caleb Owens

June 29, 2020

Do you have to have the percentage code for the slider to work properly?

Reply

Blu3yo

June 29, 2020

I'm slightly confused at aprox 7:00. I may just be understanding it wrong, but don't you set the top limit to half the size above the top of the bar and the bottom limit to halfway down the bar? I might be missing something, maybe you move your bar sprite upwards at another time?

Reply

Christopher Mickey

June 29, 2020

Slasher failed his exam

Reply

SangoProductions213

June 29, 2020

This always confuses me, and I've not seen anyone explain it yet. When do you assign your "a" as var, or not? What happens when you do or don't? Are you like, creating a new class? Do you already have a video explaining this?

Reply

SangoProductions213

June 29, 2020

woot. Time for a tutorial binge.

Reply

Lucifer School

June 29, 2020

Awesome tutorial, thanks a lot ;D

Reply

Larry tesla spacex boring Lawrence

June 29, 2020

thank you for good tutorial

Reply

Leave a Reply