Is there a way to add exported variables to a group?

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

For example, the sprite node has this piece of code:

ADD_GROUP("Region", "region_");

enter image description here

Which creates the Region group, with it’s child variables Enabled, Rect and Filter Clip

Is there a way to accomplish a similar result using GDScript?

:bust_in_silhouette: Reply From: jovansystem

Hi, as far as I can tell, in 3.0 there is no simple way to do this, although there seems to have been some discussion about adding this functionality.

It is possible, though, as described by Bojidar Marinov in a post to this thread:

Here is a slightly different implementation I use based on the same technique:


extends Object

var properties = {}
func add(name, type, default_value):
	properties[name] = {
		"name": name,
		"type": type,
		"value": default_value 

func get(name):
	return properties[name].value

func set(name, value):
    if properties.has(name):
	    properties[name].value = value
func _init(list):
	for prop in list:
		add(prop[0], prop[1], prop[2])

And then, in your scripts you can do:

extends Spatial

const PropertyList = preload("res://Scripts/")

var property_list =[

func _get(property):
	return property_list.get(property)
func _set(property, value):
	property_list.set(property, value)

func _get_property_list():

Is it possible to set the type as Texture this way?
Like the TexturedButton groups it’s textures under Textures category?

hedin_hiervard | 2018-11-21 12:08