Drag and drop feature for Texture2D not working ...
Asked Answered
R

2

0

I'm trying to create an interconnectable node system and for Sprite it works it doesn't work for Texture2D.
<iframe width="560" height="315" src="" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
Could GUI elements not have position grabbing functions and not be able to drag and drop?
Also this not work:
...
func draw_connector():
curve.clear_points()
if is_instance_valid(node_from) && is_instance_valid(node_to):
#node_from.update()
#node_to.update()
var angle = node_from.get_angle_to(node_to.position)
var distance = node_from.position.distance_to(node_to.position)
...

Rebeca answered 12/3 at 13:0 Comment(0)
J
0

Rebeca Texture2D is not a node. It's a resource. So you cannot assign anything that get_child() will return to a variable of Texture2D type, because that type doesn't inherit Node.

Juliusjullundur answered 12/3 at 14:50 Comment(0)
R
0

... yes, is a resource ... I tested some options : I try to add nodes2D and then Texture2D ... and you can see I add the source code where is the next error:
float get_angle_to(point: Vector2) const
Returns the angle between the node and the point in radians.

I need more to do more learning and research.

Rebeca answered 12/3 at 18:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.