Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Brandon Hustus | |
Old Version | Published before Godot 3 was released. |
Hi all-
I’ve created a custom resource plugin so I can keep a palette of colors that can be modified in one location and effect everywhere relevant. But when I try to export
it with the type hint, BlockColors
, it returns an error: error(17,7): Export hint not a type or resource.
Here are my files:
res://addons/block_colors/plugin.cfg
[plugin]
name="BlockColors"
description="A custom resource which holds a color for each Tetromino type"
author="Brandon Hustus"
version="1.0"
script="block_colors_plugin.gd"
res://addons/block_colors/block_colors_plugin.gd
tool
extends EditorPlugin
func _enter_tree():
add_custom_type(\
"BlockColors",\
"Resource",\
preload("block_colors.gd"),\
preload("res://Blocks/Tetris Block.png")\
)
func _exit_tree():
remove_custom_type("BlockColors")
res://addons/block_colors/block_colors.gd
extends Resource
export(Color) var I_block_color
# More to be added later
When I try to export(BlockColors)
in another script, it returns the error listed above. I have enabled the plugin and am able to create a resource of the BlockColors type. Have I done anything wrong, or is it just not possible to export
a plugin resource type?