If you can't see the pictures, try reloading the page
How do I make a Button on an MfD that when clicked asks you to enter a text that is then rendered on the MfD until you enter a new text?
1. Create MfD
You can't display anything when there's nothing to display it on. Create a new MfD in the designer and set its Flight Program property to "Custom". Then, click on Edit Flight Program.
2. Create widgets
To show anything on a MfD, you'll first need widgets. In this case, you need:
1. A Rectangle or Ellipse
This will be the Button. Create a rectangle (or, if you want a round Button, an ellipse). It's the first block of the MfD-only blocks (the last tab) I think. Remember setting a name. If necessary, adjust its position and size using other more blocks. Finally, put a Broadcast on click
block at the end. This one requires two inputs: Use the rectangle's (or ellipse's) name in the one that asks what has to be clicked and another (new) name in the Broadcast name.
2. A text
Much easier: Create a label (same block as rectangle/ellipse), if necessary change size, position and font size (or set Auto-Size to true
) and you're finished.
3. The Broadcast
1. A new function
This part will be used when the button is clicked (instead of launch), so it needs its own "function". Find the On recieve message
block and put it ... anywhere. You just have to be able to find it again later. As name, use the same as in the rectangle's last block (the Broadcast... block). All new blocks will now be put under this one (instead of the on start
).
The orange block in the picture under "2. Display"
2. Display
- Create a new variable
- Add a Set variable to user input
block and put your variable in that
- Add a Set label ... text to ...
block and set the label's name to your text's name (the widget) and the text to your variable
This is how the finished program should look like:
@TheVizzyLucky ok