Adding Button To Main GameMaker Toolbar

D

doberndorf

Guest
Hello,

I would like to add extra functionality to my rooms, and add extra properties to my rooms.

For example, when you add an object to your room, it becomes a new instance. If you select that instance after you create it, it has it's own set of properties in that object menu, for example alpha, rotation, etc...I want to add a new variable/property that I can adjust, OR add a new button to the menu/toolbar that does something.

Does anyone know if this is possible in any version of GM?

Thanks!
 

andev

Member
The room editor in GM1.4 has a "creation code" option on a per instance basis? I'm not sure I fully understand what you're asking though
 
D

doberndorf

Guest
Yeah I know about the creation code.

So, for a better explanation, I’m not talking about in game toolbars. I’m talking about in the actual GM editor. (I know you are talking about in editor, but wanted to be clear for others).

So for example, take any game you are working on, open a room, go to the object menu like you would when adding an object to the room, scroll down and look at the buttons and property variables. I want to add a button there, that does something. Or, I want to add a property that affects each instance. For example, you should see alpha and rotation. Let’s say I wanted to adjust a text variable I’m drawing inside the object, so that each instant has a different word showing. So ineditor I would use this property to set up all the texts, and in game they would show up. It’s a random example, but should give a better idea.

Most software have an ability to add custom buttons to the toolbars. I’m looking for that ability. As an example, in Unity, you can expose variables to edit them in the properties menu.
 
Last edited by a moderator:

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
If you are using GMS2, object editor has a "variables" section that allows to expose variables for editing via room editor.

GMS1.4 editor is fairly hard-coded due to technical limitations, but it isn't too much trouble to do a custom in-game editor with "immediate mode" style UI that saves to JSON or anything - for example, you can have a user event with lines like
Code:
rotation = real_range(rotation, 0, 360);
alpha = real_range(alpha, 0, 1);
text = string_input(text);
then, inside those scripts, you check what value the global variable is (which would be set prior to calling event_user() on instances) and save data/load data/display sliders/etc. You can even make use of inheritance to have objects inherit editable properties from their ancestor.

Attached screenshot is an example of such thing that I've built for some game back in ~2012.
 

Attachments

Z

Zeralith

Guest
I added a couple of buttons to my "Main" GameMaker Toolbar (at the top, under the Menu), so it's possible.

However, the buttons I added are just functionality that already exists, like instead of having to hit CTRL+SHIFT+F for Global Search & Replace (which I often forget), I just hit my "Binoculars" Button.

Other than that, the "Door" Button opens the top-level of the Project in Windows Explorer. I also removed a bunch of silly buttons that I rarely ever click, like Help/Settings/Create Executable:

 

bbbower

Member
Hello,

I would like to add extra functionality to my rooms, and add extra properties to my rooms.

For example, when you add an object to your room, it becomes a new instance. If you select that instance after you create it, it has it's own set of properties in that object menu, for example alpha, rotation, etc...I want to add a new variable/property that I can adjust, OR add a new button to the menu/toolbar that does something.

Does anyone know if this is possible in any version of GM?

Thanks!
If you are using 1.X you can always add a special controller object to every room you make and adjust it's creation code. Then access that object to find the properties specific to that room. For example in one of my projects every room has a o_level object in it and it has flags like canpvp = true; weather = true; in its creation code. I then access them from every where else by checking o_level.weather, o_level.canpvp, ect..
 
Top