0 votes

hello.
I was making a message view like Messenger.
And This is my code.

public void send_message(String data){
    Label m = (Label)Message.Instance();
    m.Text = data;
    M_List.AddChild(m);
    if(m.RectSize.x > Message_Width_Limit){
        m.SetCustomMinimumSize(new Vector2(Message_Width_Limit, 0));
        m.Autowrap = true;
    }
    t.InterpolateProperty(m, "rect_scale", zero, one, 0.5f, Tween.TransitionType.Back);
    t.Start();
}
public void OnVScrollbarMaxValueChanged(){
    ScrollVertical = (int)GetVScrollbar().MaxValue;
}

public override void _Ready() {
    if (Message == null) Message =  GD.Load<PackedScene>("res://Message.tscn");
    if (t == null) t = GetNode<Tween>("Message_List/Tween");
    if (M_List == null) M_List = GetNode("Message_List");
    //GetVScrollbar().Connect("changed", this, "OnVScrollbarMaxValueChanged");
}

When the Object "Message" created on "ScrollViewContainer" inside of "VBoxContainer"(M_List).
"Message" is spawn over the scroll.
So i tried

ScrollVertical = (int)GetVScrollbar().MaxValue;

then Scroll dose follow the "Message" but VScrollBar stop work.
After that line VScrollBar just died and never move and i cant find any debug warnings

GetVScrollbar().Value = (int)GetVScrollbar().MaxValue;

Is also same
can't find what is wrong
help me

Godot version v3.2.2
in Engine by (12 points)

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.

Categories