How should i go about making a tool or plugin for helping me design levels?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lincolnpepper

I want to create a little in-editor tool to let me quickly create objects at my mouse’s position. The plan is to make a popup menu appear when i right click with a list of all the objects, then creates the object i select at the position i right clicked. But I’m having a hard time finding the right resources for learning how to make plugins or tool scripts like this. Can someone help me learn the steps i might take to implement this or something similar?

:bust_in_silhouette: Reply From: RoniPerson

You could get the mouse input over the viewport with this method.

Then to draw an overlay where you can select an object you can use
EditorPlugin.forward_canvas_draw_over_viewport(overlay). This method is currently not described in the online documentation but you can find an example in the class ref xml.

:bust_in_silhouette: Reply From: Mrpaolosarino

I don’t know if this is the actual app that you want to create or a part of your game but.
You want to create a scene, add a popup(this is where you will add your menu) and script it like this – 'if you click the right mouse button, you want to set the popup position to your global mouse position and then do a popup(). This will manage the mechanics of right click.
for the object etc., Create different buttons that represent the objects you want to add. and add it to the popup. After that, each button has an export (PackedScene) of your object and then if you click that button you will just instance that object into your scene. and add it as a child. done