How to use MPFwidget in Godot

40 views
Skip to first unread message

William Brown

unread,
Aug 4, 2026, 3:51:37 PMAug 4
to MPF Users
Hello,
I am still trying to figure out Godot, and I am definately missing something.
Right now I am making a test widget to slide on the screen when a target is hit, but nothing is happening. Could someone take a look at this and tell me what I am doning wrong?



widget_player:

    donkey_d_shot_hit:
        test:
            priority: 5000
            action: play
            slide: base1

test_widget.png

Nixco

unread,
Aug 5, 2026, 3:48:15 AMAug 5
to MPF Users
Hey,
to make it work, i did it like this.
- IMPORTANT -> i have one file for each widget.
- I create a "name_of_widget.tscn" in the "widgets" folder, the root node is a "MPFWidget" 
- you put everything you want inside this widget
- then you load it in your MPF mode:

widget_player:
    event_play:
        name_of_widget:
            priority: XXXX (for the depth of display)

if you want to remove it:
widget_player:
    event_remove:
        name_of_widget:
            action: remove

if you want to use custom code when your widget is already loaded:

widget_player:
    event_3:
        name_of_widget:
            action: method
            method: play_an_extra_special_animation

and create a script "name_of_widget.gd" with (for exemple):

func  play_an_extra_special_animation (_settings, _kwargs):
$AnimationPlayer.play(" play_an_extra_special_animation")

Here is my mystery_mode structure:

exemple_1.pngexemple_2.png

William Brown

unread,
Aug 6, 2026, 3:02:55 PMAug 6
to MPF Users
Thanks this willl help me out a lot. I think there needs to be a lot more tutorials and examples of using godot with mpf
Reply all
Reply to author
Forward
0 new messages