Créer un curseur #755
KenneyClement
started this conversation in
General
Replies: 1 comment
-
Bonjour, vous disposez dans Synapps Studio d'un acteur "Curseur" qu'il sera je pense bien plus facile d'utiliser pour ce que vous souhaitez faire, il sera ainsi possible de récupérer la valeur de l'acteur à l'aide d'une liaison. Documentation pour l'acteur curseur : https://witsa.github.io/synapps/concepts/actor-types/input-cursor.html |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
J'aimerai créer un curseur et récupérer sa position :
curseur.txt
mais je n'arrive pas à le recréer sur SynApps
SYNAPPS-STUDIO-SCENE|{"config":{"key":"scene4","name":"Scène 4"},"leadActor":{"type":"layout/stack","key":"stack1","children":[{"type":"display/html","key":"html2","properties":{"content":"<!DOCTYPE html>\n<head>\n <style>\n .slider-container {\n width: 500px;\n margin: 50px auto;\n text-align: center;\n }\n\n .slider {\n width: 80%;\n }\n\n .positions {\n display: flex;\n justify-content: space-between;\n margin-top: 10px;\n }\n\n .position {\n width: 6%;\n text-align: center;\n }\n </style>\n</head>\n\n<body>\n <div class=\"slider-container\"> <input type=\"range\" min=\"0\" max=\"14\" value=\"0\" class=\"slider\" id=\"myRange\">\n <div class=\"positions\">\n <div class=\"position\">1</div>\n <div class=\"position\">2</div>\n <div class=\"position\">3</div>\n <div class=\"position\">4</div>\n <div class=\"position\">5</div>\n <div class=\"position\">6</div>\n <div class=\"position\">7</div>\n <div class=\"position\">8</div>\n <div class=\"position\">9</div>\n <div class=\"position\">10</div>\n <div class=\"position\">11</div>\n <div class=\"position\">12</div>\n <div class=\"position\">13</div>\n <div class=\"position\">14</div>\n <div class=\"position\">15</div>\n </div>\n <p>Current Position: <span id=\"currentPosition\">1</span></p>\n </div>\n</body>\n\n</html>"},"events":{"onPropertyChanged":["const slider = document.getElementById('myRange');","const currentPosition = document.getElementById('currentPosition');","slider.addEventListener('input', () => { "," currentPosition.textContent = parseInt(slider.value) + 1; ``});"]}}]}}
Beta Was this translation helpful? Give feedback.
All reactions