Exemple #1
0
        public override Node2D GenerateOn(CanvasItem node)
        {
            node.QueueFreeChildren();
            ObstacleAppearance appearance = ObstacleAppearance.New();

            node.AddChild(appearance);
            appearance.SetAppearance(id);
            appearance.Position = OFFSET;
            return(appearance);
        }
Exemple #2
0
        public override Node2D GenerateOn(CanvasItem node)
        {
            node.QueueFreeChildren();
            CharacterAppearance appearance = CharacterAppearance.New();

            node.AddChild(appearance);
            appearance.data     = this;
            appearance.Position = OFFSET;
            return(appearance);
        }
Exemple #3
0
    public async void Add(CanvasItem newNode, float delay = 0)
    {
        // Fade-in effect
        Tween tween = new Tween();

        tween.InterpolateProperty(newNode, "modulate", Colors.Transparent, Colors.White, 0.5f,
                                  Tween.TransitionType.Linear, Tween.EaseType.InOut, delay);
        tween.Connect("tween_all_completed", tween, "queue_free");
        newNode.AddChild(tween);
        newNode.Modulate = Colors.Transparent;
        container.AddChild(newNode); // We actually add the thing here
        tween.Start();

        // Wait for the scrollbar to recalculate and scroll to the bottom
        await ToSignal(GetTree(), "idle_frame");

        scroll.ScrollVertical = (int)scroll.GetVScrollbar().MaxValue;
    }