Progress on Retina/OS X migration.
This commit is contained in:
@@ -1,24 +1,8 @@
|
||||
function Keyboard()
|
||||
{
|
||||
this.is_locked = false;
|
||||
|
||||
this.lock = function()
|
||||
{
|
||||
this.is_locked = true;
|
||||
interface.actions_panel.style.color = "red";
|
||||
}
|
||||
|
||||
this.unlock = function()
|
||||
{
|
||||
this.is_locked = false;
|
||||
interface.actions_panel.style.color = "black";
|
||||
}
|
||||
|
||||
this.listen_onkeyup = function(event)
|
||||
{
|
||||
if(this.is_locked === true){ return; }
|
||||
|
||||
if(event.keyCode == 9) this.key_tab();
|
||||
console.log(event.which);
|
||||
switch (event.key) {
|
||||
case "Enter": this.key_enter(); break;
|
||||
case " " : this.key_space(); break;
|
||||
@@ -31,6 +15,12 @@ function Keyboard()
|
||||
case ";": if (event.shiftKey) this.key_colon(); break;
|
||||
case "Escape": this.key_escape(); break;
|
||||
}
|
||||
|
||||
switch(event.which)
|
||||
{
|
||||
case 13: this.key_enter(); break;
|
||||
case 186: this.key_colon(); break;
|
||||
}
|
||||
|
||||
// Passive
|
||||
commander.passive(commander.element_input.value);
|
||||
|
||||
@@ -35,10 +35,12 @@ function Canvas(rune)
|
||||
var canvas_pixels = ronin.canvas.element.toDataURL("image/png");
|
||||
var pixels_rect = new Rect(this.element.width+"x"+this.element.height);
|
||||
|
||||
this.element.setAttribute('width',rect.width+"px");
|
||||
this.element.setAttribute('height',rect.height+"px");
|
||||
this.element.width = rect.width * 2;
|
||||
this.element.height = rect.height * 2;
|
||||
this.element.style.left = (window.innerWidth/2)-(rect.width/2);
|
||||
this.element.style.top = (window.innerHeight/2)-(rect.height/2);
|
||||
this.element.style.width = rect.width+"px";
|
||||
this.element.style.height = rect.height+"px";
|
||||
|
||||
ronin.widget.element.style.left = (window.innerWidth/2)-(rect.width/2);
|
||||
ronin.widget.element.style.top = (window.innerHeight/2)+(rect.height/2);
|
||||
@@ -51,6 +53,7 @@ function Canvas(rune)
|
||||
|
||||
if(!position){ position = new Position("0,0");}
|
||||
ronin.canvas.context().drawImage(base_image, -position.x, -position.y, pixels_rect.width, pixels_rect.height);
|
||||
ronin.canvas.context().scale(2,2);
|
||||
}
|
||||
|
||||
this.context = function()
|
||||
|
||||
@@ -103,10 +103,13 @@ function Overlay(rune)
|
||||
|
||||
this.resize = function(rect)
|
||||
{
|
||||
this.element.setAttribute('width',rect.width+"px");
|
||||
this.element.setAttribute('height',rect.height+"px");
|
||||
this.element.width = rect.width * 2;
|
||||
this.element.height = rect.height * 2;
|
||||
this.element.style.left = (window.innerWidth/2)-(rect.width/2);
|
||||
this.element.style.top = (window.innerHeight/2)-(rect.height/2);
|
||||
this.element.style.width = rect.width+"px";
|
||||
this.element.style.height = rect.height+"px";
|
||||
this.context().scale(2,2);
|
||||
}
|
||||
|
||||
this.context = function()
|
||||
|
||||
Reference in New Issue
Block a user