Adding the ability to set the player's color outline via the scripting API
(currently not shared with the other players yet)
This commit is contained in:
parent
e086f6dac0
commit
90f7287860
11 changed files with 282 additions and 9 deletions
36
maps/tests/Outline/outline.php
Normal file
36
maps/tests/Outline/outline.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<script src="<?php echo $_SERVER["FRONT_URL"] ?>/iframe_api.js"></script>
|
||||
<script>
|
||||
WA.onInit().then(() => {
|
||||
console.log('After WA init');
|
||||
const setOutlineButton = document.getElementById('setOutline');
|
||||
const removeOutlineButton = document.getElementById('removeOutline');
|
||||
const redField = document.getElementById('red');
|
||||
const greenField = document.getElementById('green');
|
||||
const blueField = document.getElementById('blue');
|
||||
|
||||
setOutlineButton.addEventListener('click', () => {
|
||||
console.log('SETTING OUTLINE');
|
||||
WA.player.setOutlineColor(parseInt(redField.value), parseInt(greenField.value), parseInt(blueField.value));
|
||||
});
|
||||
|
||||
removeOutlineButton.addEventListener('click', () => {
|
||||
console.log('REMOVING OUTLINE');
|
||||
WA.player.removeOutlineColor();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
red: <input type="text" id="red" value="0" /><br/>
|
||||
green: <input type="text" id="green" value="0" /><br/>
|
||||
blue: <input type="text" id="blue" value="0" /><br/>
|
||||
|
||||
<button id="setOutline">Set outline</button>
|
||||
|
||||
<button id="removeOutline">Remove outline</button>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue