0 votes

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 setlargura
export var altura = 50 setget set
altura

onready var tween = get_node("tween")

func ready():
if get
tree().iseditorhint():
get_node("balao").hide()

func draw():
get
node("balao").largura = largura
get_node("balao").altura = altura

func ontipbodyentered(body):
tween.interpolatemethod(self , "resize" , 0, 1 ,1.0 , Tween.TRANSBOUNCE, Tween.EASE_OUT , 0 )
tween.start()

func ontipbodyexited(body):
tween.interpolatemethod(self , "resize" , 1, 0 , .5 , Tween.TRANSEXPO, Tween.EASE_OUT , 0 )
tween.start()

func resize(val):
getnode("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()

in Engine by (12 points)

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()

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.