![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Droxxsp |
I have an error in godot, I used the old version and this line is no longer taking the current version. Error on line 9, up to 11 (func _ready …)
(I don’t speak english, using google translator
tool
extends Area2D
export var largura = 50 setget set_largura
export var altura = 50 setget set_altura
onready var tween = get_node(“tween”)
func _ready():
if get_tree().is_editor_hint():
get_node(“balao”).hide()
func _draw():
get_node(“balao”).largura = largura
get_node(“balao”).altura = altura
func _on_tip_body_entered(body):
tween.interpolate_method(self , “resize” , 0, 1 ,1.0 , Tween.TRANS_BOUNCE, Tween.EASE_OUT , 0 )
tween.start()
func _on_tip_body_exited(body):
tween.interpolate_method(self , “resize” , 1, 0 , .5 , Tween.TRANS_EXPO, Tween.EASE_OUT , 0 )
tween.start()
func resize(val):
get_node(“balao”).largura = largura * val
get_node(“balao”).altura = altura * val
#print(val)
func set_largura(val):
largura = val
update()
func set_altura(val):
altura = val
update()
When you post a question, please make sure that your code is formatted properly (each line has to start with 4 spaces, each additional 4 spaces equal an indentation layer). If you don’t, underscores are interpreted as Markdown and indentation is lost, which makes your script a lot harder to read for others trying to help you.
So: What is the error you’re getting at line 9? I copied your code and didn’t get any error there. However, is_editor_hint
is a function of Engine, not SceneTree:
tool
extends Area2D
export var largura = 50 setget set_largura
export var altura = 50 setget set_altura
onready var tween = get_node("tween")
func _ready():
if Engine.is_editor_hint():
get_node("balao").hide()
func _draw():
get_node("balao").largura = largura
get_node("balao").altura = altura
func _on_tip_body_entered(body):
tween.interpolate_method(self , "resize" , 0, 1 ,1.0 , Tween.TRANSBOUNCE, Tween.EASE_OUT , 0 )
tween.start()
func _on_tip_body_exited(body):
tween.interpolate_method(self , "resize" , 1, 0 , .5 , Tween.TRANSEXPO, Tween.EASE_OUT , 0 )
tween.start()
func resize(val):
get_node("balao").largura = largura * val
get_node("balao").altura = altura * val
#print(val)
func set_largura(val):
largura = val
update()
func set_altura(val):
altura = val
update()
njamster | 2020-06-20 11:20