Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert scene to node? #25867

Closed
Shadowblitz16 opened this issue Feb 14, 2019 · 9 comments
Closed

convert scene to node? #25867

Shadowblitz16 opened this issue Feb 14, 2019 · 9 comments
Labels

Comments

@Shadowblitz16
Copy link

Godot version: 3.0.6

I was just wondering if something like this could be implemented..
#3077

or at least something similar.

I think it's as great idea and I was actually trying to look for a way to make custom controls this way.
maybe having the ability to show the child nodes in the inspector too?

image

@groud
Copy link
Member

groud commented Feb 14, 2019

This is already possible in 3.1 with the class_name keyword.

@groud groud added the archived label Feb 14, 2019
@groud groud closed this as completed Feb 14, 2019
@Shadowblitz16
Copy link
Author

awesome thankyou

@Shadowblitz16
Copy link
Author

actually please reopen this.
I mean convert scene to node not script to node

@groud
Copy link
Member

groud commented Feb 14, 2019

This is the same, to do so you need to add a script to your node, use class_name, and the attached node will act as any other built-in node.

@Shadowblitz16
Copy link
Author

Shadowblitz16 commented Feb 14, 2019

I mean on clicking on a node in the tree and and converting it to a node.
also how would multiple child nodes be serialized in the inspector?

@groud
Copy link
Member

groud commented Feb 14, 2019

Honestly, it is really unclear what you mean by "converting to a node". If you need to reuse a node and its children just make a scene. If you need to have a scene looking like a built-in node, you can use class_name and even choose an icon. So basically everything is already here to transform a scene into "a node".

also how would multiple child nodes be serialized in the inspector?

Like any other child node in a scene I guess.

@Shadowblitz16
Copy link
Author

I mean having something similar to a scene template but with the ability to hide and show child nodes and their properties in the inspector, and being able to add a custom icon for the scene.

@groud
Copy link
Member

groud commented Feb 14, 2019

I mean having something similar to a scene template but with the ability to hide and show child nodes and their properties in the inspector

This can be done by enabling "editable children" on the instantiated scene.

being able to add a custom icon for the scene.

This can be done via the class_name keyword

@Shadowblitz16
Copy link
Author

Shadowblitz16 commented Feb 14, 2019

image

example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants