Skip to content

Commit

Permalink
more work on virtualjoystick
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeetienne committed Dec 29, 2011
1 parent ffa187e commit 06588aa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions css/osd.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
position : absolute;
top : 0;
left : 0;
z-index : 10;
}

#osdContainer .subContainer {
Expand Down
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<link rel='stylesheet' href="css/main.css" />
<link rel='stylesheet' href="css/osd.css" />
<link rel='stylesheet' href="css/virtualjoystick.css" />
<link rel='stylesheet' href="css/pageLandingMain.css" />
<link rel='stylesheet' href="css/embedded.css" />

Expand All @@ -30,7 +31,7 @@
******************************************************************************** -->
<div id="canvasContainer"></div>
<!-- *****************************************************************************
canvasContainer
virtualjoystickContainer
******************************************************************************** -->
<div id="virtualjoystickContainer"><div class="subContainer">
</div></div>
Expand Down
2 changes: 1 addition & 1 deletion js/pageGameMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Marble.PageGameMain = function()
osdLayer = new Marble.OsdLayer();
osdLayer.livesSet( this._playerLives );

if( true || !VirtualJoystick.touchScreenAvailable() ){
if( true || !VirtualJoystick.touchScreenAvailable() ){
this._virtualJoystick = new VirtualJoystick({
mouseSupport : true
});
Expand Down
11 changes: 6 additions & 5 deletions vendor/virtualjoystick.js/virtualjoystick.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ var VirtualJoystick = function(opts)
this._$onMouseDown = __bind(this._onMouseDown , this);
this._$onMouseUp = __bind(this._onMouseUp , this);
this._$onMouseMove = __bind(this._onMouseMove , this);
this._container.addEventListener( 'mousedown' , this._$onMouseDown , true );
this._container.addEventListener( 'mouseup' , this._$onMouseUp , true );
this._container.addEventListener( 'mousemove' , this._$onMouseMove , true );
this._container.addEventListener( 'mousedown' , this._$onMouseDown , false );
this._container.addEventListener( 'mouseup' , this._$onMouseUp , false );
this._container.addEventListener( 'mousemove' , this._$onMouseMove , false );
}
}

Expand All @@ -49,8 +49,8 @@ VirtualJoystick.prototype.destroy = function()
this._container.removeEventListener( 'touchend' , this._$onTouchEnd , false );
this._container.removeEventListener( 'touchmove' , this._$onTouchMove , false );
if( this._mouseSupport ){
this._container.removeEventListener( 'mouseup' , this._$onMouseUp , false );
this._container.removeEventListener( 'mousedown' , this._$onMouseDown , false );
this._container.removeEventListener( 'mouseup' , this._$onMouseUp , false );
this._container.removeEventListener( 'mousemove' , this._$onMouseMove , false );
}
}
Expand Down Expand Up @@ -166,7 +166,8 @@ VirtualJoystick.prototype._onMouseDown = function(event)
{
var x = event.clientX;
var y = event.clientY;
return this._onDown(x, y);
//return
this._onDown(x, y);
}

VirtualJoystick.prototype._onMouseMove = function(event)
Expand Down

0 comments on commit 06588aa

Please sign in to comment.