Sorting out the cursor functionalities.

This commit is contained in:
Devine Lu Linvega
2016-12-18 21:23:53 -07:00
parent f80699271f
commit 87881159af
13 changed files with 151 additions and 24 deletions

View File

@@ -0,0 +1,21 @@
function Mode_Drag()
{
Mode.call(this);
this.name = "Drag";
this.mouse_down = function(event)
{
ronin.drag_start(event); ronin.drag(event);
}
this.mouse_move = function(event)
{
ronin.drag(event);
}
this.mouse_up = function(event)
{
ronin.drag_stop(event);
}
}

View File

@@ -0,0 +1,21 @@
function Mode_Guide()
{
Mode.call(this);
this.name = "Guide";
this.mouse_down = function(event)
{
ronin.overlay.live_draw_start(event);
}
this.mouse_move = function(event)
{
ronin.overlay.live_draw(event);
}
this.mouse_up = function(event)
{
}
}

24
scripts/modes/mode.js Normal file
View File

@@ -0,0 +1,24 @@
function Mode()
{
this.name = "Unknown";
this.widget = function()
{
return this.name;
}
this.mouse_down = function(event)
{
}
this.mouse_move = function(event)
{
}
this.mouse_up = function(event)
{
}
}

View File

@@ -0,0 +1,21 @@
function Mode_Paint()
{
Mode.call(this);
this.name = "Paint";
this.mouse_down = function(event)
{
ronin.brush.draw_start(event); ronin.brush.draw(event);
}
this.mouse_move = function(event)
{
ronin.brush.draw(event);
}
this.mouse_up = function(event)
{
ronin.brush.draw_stop(event);
}
}