kloot
January 28, 2024, 2:19pm
1
Godot Version
4.2.1
Question
When my node is selected, I’d like the editor to show the same widget that is shown when selecting a CollisionPolygon2D to edit my Vector2 array:
Does anybody know how this can be achieved?
I tried attaching a script to my node and expose a Vector2 array. Though the field shows up in the editor, the widget isn’t shown in the editor.
Do I have to create a custom node? If so, what extra steps are needed to show the widget?
Thanks a bunch!
It’s a built-in EditorPlugin
that is not exposed to external code. If you want the same functionality you have to write your own version of this EditorPlugin.
/**************************************************************************/
/* abstract_polygon_2d_editor.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
This file has been truncated. show original
kloot
January 29, 2024, 10:49am
3
I see, thanks for the response.
Sad panda that we can’t easily make it show up for our custom nodes, but at least now I know