\n","publisher":{"@type":"Organization","name":"MML","url":"https://mml.io"}}MML - Metaverse Markup Language

<m-prompt>

The m-prompt element is used to request a string from the user when the element is clicked in a 3D scene.

<m-prompt
    message="What is your favourite color?"
    placeholder="Write a color"
    prefill="orange"
    id="my-prompt"
    y="2"
>
  <m-cube id="color-cube" color="blue"></m-cube>
</m-prompt>

<m-label id="my-label" y="5" width="10" content="Hello World!" font-size="80" alignment="center" color="#BBB" font-color="#000"></m-label>

<script>
  const mPrompt = document.getElementById("my-prompt");
  const mLabel = document.getElementById("my-label");
  const mCube = document.getElementById("color-cube");

  function handlePrompt(e) {
    const color = e.detail.value;
    mLabel.setAttribute("content", color);
    mCube.setAttribute("color", color);
  }

  mPrompt.addEventListener("prompt", handlePrompt);
</script>
  • The message text to be displayed to the user when the prompt is activated.

  • The hint text displayed in the input field when the prompt is activated.

  • The default text pre-populated in the input field when the prompt is activated.

  • A script expression to be executed when a user submits their input.

    • A boolean that indicates whether the element should be drawn with debug information (e.g. axes helper). Default value is false.

    • The position of the element along the X-axis in meters. Default value is 0.

    • The position of the element along the Y-axis in meters. Default value is 0.

    • The position of the element along the Z-axis in meters. Default value is 0.

    • The rotation of the element around the X-axis in degrees. Default value is 0.

    • The rotation of the element around the Y-axis in degrees. Default value is 0.

    • The rotation of the element around the Z-axis in degrees. Default value is 0.

    • The scale of the element along the X-axis. Default value is 1.

    • The scale of the element along the Y-axis. Default value is 1.

    • The scale of the element along the Z-axis. Default value is 1.

    • Whether the element is visible (true) or hidden (false) in the scene. Default value is true.

    • The name of a bone in the parent element's skeletal mesh to which this element will be attached. If not specified, the element will attach to the origin of its parent.

    • A unique identifier for the element, used for selection and manipulation through scripting. It must be unique within the document.

    • A space-separated list of class names that can be used for scripting purposes.

WEBUNREAL
m-prompt
message
placeholder
prefill
onprompt
debug
x
y
z
rx
ry
rz
sx
sy
sz
visible
socket
id
class