Select and deselect buttons and use a combination of selections to jump to a particular scene

Hello codemasters

Is there a simple function that will allow buttons to be selected (like radio buttons) and deselected? The combination of buttons selected would then determine which scene is jumped to.

Any help would be hugely appreciated.

Thanks

So here are the different ‘input form’ types:

https://walterebert.com/playground/html5/input-types/

Here’s the JavaScript to detect if one of those radio buttons are selected:

var button1 = document.getElementById("button1");
var button2 = document.getElementById("button2");

if (button1.checked){
    alert("radio1 selected");
}else if (button2.checked) {
    alert("radio2 selected");
}

So using that, you can put in your Hype document scene api functions, like:

hypeDocument.showSceneNamed('Scene 2');

Putting it all together, you would need to run a function that does the ‘checking’ and make sure that the radio / input form you place on your Hype scene is within the inner HTML of a rectangle, and not in an HTML widget (which is insulated from the rest of the page + Hype’s JS function system).

Here’s more info on how to add a JS function to Hype: https://tumult.com/hype/documentation/#using-javascript

1 Like

Thank you kind Sir.