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 Thx
@lafario Fixed! Tagged you in the fix
@TheVizzyLucky Here is the craft!
@lafario Can you send me your craft?
@TheVizzyLucky Fixed it but still the same issue.
@TheVizzyLucky Were both clumbsy😂
@lafario For the rectangle you used two slightly different names ("Button" and "button"). Took me a while to find this 😂
@TheVizzyLucky
Still wont let me type even after fixing the mistake
@TheVizzyLucky oh silly me lol!😂
@lafario There's a typo in "receive btnClicked with data". You typed "btnCliked" instead of "btnClicked". But that's the only mistake I think.
@TheVizzyLucky
The Image
@TheVizzyLucky ok
@lafario I'll need pictures of your program
@TheVizzyLucky I did that but nothing happens when I click the box.
@TheVizzyLucky I did that but nothing happens when I click the box.
@lafario Video, the button will be on the left (first) MfD, the text on the right (second).
@TheVizzyLucky ok
@lafario Sorry, I currently don't have enough time. I'll try to add some later
@TheVizzyLucky sorry to be a pain but can you show it on pictures.
@lafario For multiple Displays: Move the
Create Label
block and the whole second part (everything under the second orange block) to the MfD that should render the text and replace the text in that orange block with a new name. Then, go to the MfD with the Button and put a newreceive message with data
. Replacemessage
withbtnClicked
(or whatever name you use). Finally, put aBroadcast message with data 0 to craft
under that and replacemessage
with the name you used in the MfD that shows the text. Once your done, the MfD with the button should contain: 1. The same first part as before (except for theCreate Label
) and 2. This (Important: I accidentally usedBroadcast showText with data 0
in this picture, you need to useBroadcast showText with data 0 to Craft
instead). The MfD that shows the text should contain 1. theCreate Label
block you moved there from the other MfD and 2. the second part you moved there from the other MfD (visually: The picture under 3. Broadcast).This probably all seems quite complicated (especially because I currently can barely add any pictures), so try following this step by step - read one sentence, do that and then read the next sentence - I hope this helps
For a better Button: You can only change the rectangle's position, size, color and rotation. For anything else, you have to use other widgets (like Ellipses).
@TheVizzyLucky how to a make the rectangle into rectangular boarder instead of a chunky rectangle, Also how do I make it so the text box is on one multi display screen and the text is on the other, Basically like a computer.
So whatever you type on the rectangle on one multi display screen, Transfers the text to the other.
@TheVizzyLucky ty.
@lafario Pictures added
@TheVizzyLucky ok
@lafario I'm currently quite busy because of Easter, I don't know if I can add the pictures today. Gonna try my best though!