Great tutorial! You explain things clearly and efficiently. Is there a way to have the list show the variables stored and not what the first one in the list is? (For example in your list, you have a volume setting. If you were to change it to 60%, close the list by deleting the object, then reopening the object, it would state "100%" instead of "60%") Sorry i'm not the best at clarity
Yes, you can do that. Let's say the music volume is applied to the variable global.musicVolume. You would want that variable to hold a numeric value, and not a string. So you wouldn't apply the option's value ("60%") to it, but rather its SELECTED value (which is the number of that item in the values array). So depending on which value was selected, global.musicLevel can be 0, 1, 2, 3, or more. Now when you populate your list in create_list(), you can set that option's SELECTED value to the value in global.musicLevel. To recap: you save the SELECTED value to a variable, and then use that when you populate your list again. Now if you have a variable that needs to hold the actual value from the values array, and not the SELECTED value, then it makes it harder to re-populate the list with the saved value. Because then, you don't have a simple array slot ID to use, but the actual value. So then, you have to create a function to get the array slot ID by passing in the actual value, much like the ds_list_find_index() function. Then you can apply its result to the SELECTED parameter of an option.
When you put the mouse exactly between two values (1 pixel precision) you are hovering both values and you can change both values at the time how do u fix
When you take mouse input, you use point_in_rectangle, where the rectangle is the list item (with the coords x1, y1, x2, y2). In that function, subtract 1 from y2. So you'll be passing in "y2 - 1". This should fix the issue.
Hello, I have a question about game maker I would like to know if it is possible to make an interface / window system that displays long texts and images, and that contains a scroll bar to be able to show the entire text. As if it were a website, for example from wikipedia (besides being something that would also resemble the text document system of Resident Evil and Silent Hill). However, it wouldn't run in a specific room, it would actually be a window that appears during the game when the player presses a button. I would also like to know if it is possible to create a notepad system too, something very simple that the player can annotate a text and that will be saved for him to check later And lastly, is it possible to create a music player? a GUI that allows the player to choose songs and has play, restart and etc buttons. If possible, can you give me a reference for me to search for please? and another question, is this kind of functionality too advanced for a beginner or unstable for the game maker to run? (The idea of the game involves a lot of reading texts and taking notes)
i keep getting this error: ERROR in action number 1 of Draw event for object oList: Push :: Execution Error - Variable Index [2] out of range [2] - -7.(100207,2) at gml_Object_oList_Draw_64 (line 15) - var _vals = _arr[PR.VALUES]; please help :)
How do I actually make the volume work?
Thank you, I'm using this as the base for my setting/options screen
You are doing too modest a service. Keep it up.
Thank you for this tutorial! I have tried practicing the settings menu and... i have been getting hang out of it!
Great tutorial! You explain things clearly and efficiently. Is there a way to have the list show the variables stored and not what the first one in the list is? (For example in your list, you have a volume setting. If you were to change it to 60%, close the list by deleting the object, then reopening the object, it would state "100%" instead of "60%") Sorry i'm not the best at clarity
Yes, you can do that. Let's say the music volume is applied to the variable global.musicVolume. You would want that variable to hold a numeric value, and not a string. So you wouldn't apply the option's value ("60%") to it, but rather its SELECTED value (which is the number of that item in the values array).
So depending on which value was selected, global.musicLevel can be 0, 1, 2, 3, or more.
Now when you populate your list in create_list(), you can set that option's SELECTED value to the value in global.musicLevel.
To recap: you save the SELECTED value to a variable, and then use that when you populate your list again.
Now if you have a variable that needs to hold the actual value from the values array, and not the SELECTED value, then it makes it harder to re-populate the list with the saved value.
Because then, you don't have a simple array slot ID to use, but the actual value.
So then, you have to create a function to get the array slot ID by passing in the actual value, much like the ds_list_find_index() function. Then you can apply its result to the SELECTED parameter of an option.
ok , now how to show the options , only after clicking on button Options ?
This is great. I wonder how different the implementation would be with all the new features that have been added to GMS.
When you put the mouse exactly between two values (1 pixel precision) you are hovering both values and you can change both values at the time
how do u fix
When you take mouse input, you use point_in_rectangle, where the rectangle is the list item (with the coords x1, y1, x2, y2). In that function, subtract 1 from y2. So you'll be passing in "y2 - 1". This should fix the issue.
My mouse isent scrolling the options. No errors at all. Also some of the options arent turning the colors when you hover over them.
Hello, I have a question about game maker
I would like to know if it is possible to make an interface / window system that displays long texts and images, and that contains a scroll bar to be able to show the entire text.
As if it were a website, for example from wikipedia (besides being something that would also resemble the text document system of Resident Evil and Silent Hill). However, it wouldn't run in a specific room, it would actually be a window that appears during the game when the player presses a button.
I would also like to know if it is possible to create a notepad system too, something very simple that the player can annotate a text and that will be saved for him to check later
And lastly, is it possible to create a music player? a GUI that allows the player to choose songs and has play, restart and etc buttons.
If possible, can you give me a reference for me to search for please? and another question, is this kind of functionality too advanced for a beginner or unstable for the game maker to run? (The idea of the game involves a lot of reading texts and taking notes)
That is a looong question lol! Please join the Discord server given in the description, you can discuss this there.
i keep getting this error:
ERROR in
action number 1
of Draw event
for object oList:
Push :: Execution Error - Variable Index [2] out of range [2] -
-7.(100207,2)
at gml_Object_oList_Draw_64 (line 15) - var _vals = _arr[PR.VALUES];
please help :)
alright i fixed it
solution:
i forgot the last 2 brackets on this line ds_list_add(list, ["Close", -1, []]);
Just a quick question, what's the difference between the Clean Up and Destroy events, as both run when the instance is destroyed?
I think Clean Up runs when the room ends, where Destroy doesn't. manual.yoyogames.com/#t=The_Asset_Editors%2FObject_Properties%2FObject_Events.htm
@@GameMakerStation Yeah okay so it both triggers when the instance is destroyed, _and_ when the room ends
It's too awesome to not be posted on the forum too.
Yep, first thing I did ;)
I still enjoy these, LOL.
not trying to be offensive, but your voice sounds like text-to-speech 💀
some much stuff to do just give us the code bro
isn't that what he's doing