I'm storing text and a few other other parameters in resource files attached to nodes.
What I'd like is for the resource file to display the text element in the Inspector similar to the text field on the Label node to make editing text easier:
Any idea what code I need to add to my resource script to achieve this?
If you want to have your Resource display its property, you just do it using the
class_name PlayerData extends Resource @export var player_name := "Mario" @export var level := 1 var hidden_var := 999
Now when you create a new
PlayerDataresource in File Manager, and open that .tres file, you can see that property in Inspector.
Unless you are talking about something fancy ie., having a Label node in your Scene that syncs it text automatically to the attached resource.
Thanks for coming back to me, I already have properties displayed in the Resource script which I can edit; I wondered whether there was a way to add some (editor?) code to get the inspector to show a multi-line text editor property box (similar to the one on the Label node), instead of a single line property (as shown above).
The reason is that the strings being stored here will be very long - and editing and testing will be easier to have a larger area to see / read / edit the text in the Inspector.