Options for collision
This commit is contained in:
@@ -16,7 +16,10 @@
|
||||
the camera at anytime by clicking on the reset button.
|
||||
</p>
|
||||
<button id="reset" style="margin-bottom:10px">Reset camera</button>
|
||||
<button id="fullarrow" style="margin-bottom:10px">Full arrow</button>
|
||||
<input type="checkbox" id="fullarrow" style="margin-bottom:10px">
|
||||
<label for="fullarrow">Full arrow</label>
|
||||
<input type="checkbox" id="collisions" style="margin-bottom:10px" checked>
|
||||
<label for="collisions">Collisions</label>
|
||||
<div style="border-width:1px; border-style: solid;" id="container"></div>
|
||||
#
|
||||
</section>
|
||||
|
||||
17
prototype/js/main.js
vendored
17
prototype/js/main.js
vendored
@@ -22,19 +22,18 @@ function init() {
|
||||
// Add the listener on the button
|
||||
document.getElementById('reset').onclick = function() { cameras.mainCamera().reset(); };
|
||||
var fullarrow = document.getElementById('fullarrow');
|
||||
fullarrow.onclick = function() {
|
||||
if (fullarrow.innerHTML === 'Full arrow') {
|
||||
fullarrow.innerHTML = "Half arrow";
|
||||
} else {
|
||||
fullarrow.innerHTML = "Full arrow";
|
||||
}
|
||||
|
||||
fullarrow.onchange = function() {
|
||||
cameras.map(function(camera) {
|
||||
if (camera instanceof FixedCamera) {
|
||||
camera.fullArrow = !camera.fullArrow;
|
||||
camera.fullArrow = fullarrow.checked;
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
var collisions = document.getElementById('collisions');
|
||||
collisions.onchange = function() {
|
||||
cameras.mainCamera().collisions = collisions.checked;
|
||||
}
|
||||
|
||||
// on initialise le moteur de rendu
|
||||
container = document.getElementById('container');
|
||||
|
||||
Reference in New Issue
Block a user