topical media & game development
mobile-query-three-plugins-virtualjoystick-examples-index.htm / htm
<!doctype html><title>Minimal tQuery Page</title>
<script src="../../../build/tquery-bundle.js"></script>
<script src="../vendor/virtualjoystick.js"></script>
<body><script>
var world = tQuery.createWorld().boilerplate().start();
var object = tQuery.createTorusKnot().addTo(world);
world.removeCameraControls();
var joystick = new VirtualJoystick({
//container : document.body,
container : world.tRenderer().domElement,
mouseSupport : true
});
world.loop().hook(function(delta, now){
var displacement = 1 * delta;
if( joystick.up() ) object.translateZ(-displacement)
if( joystick.down() ) object.translateZ( displacement)
if( joystick.left() ) object.translateX(-displacement)
if( joystick.right() ) object.translateX( displacement)
});
</script></body>
(C) Æliens
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.