Created
March 4, 2014 04:13
-
-
Save jeremyckahn/9340171 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var backcoloractortxt = rekapi.addActor( | |
new Rekapi.Actor({ | |
'render': function (context, state) { | |
context.beginPath(); | |
var titleheight = 40; | |
context.font = titleheight*state.scale+"px Arial"; | |
context.measureText("Bardon Update").width; | |
var w = context.measureText("HomePrezzo").width; | |
context.font = (titleheight/2)*state.scale+"px Arial"; | |
var w2 = context.measureText("Bardon Update").width; | |
if (w2 > w) {w=w2;} | |
w = (w+50)/2; | |
context.strokeStyle = state.color; | |
context.rect(state.x-w,state.y-20,w*2,titleheight*2+20); | |
context.stroke(); | |
context.fillStyle = state.colorback; | |
context.fill(); | |
context.textAlign = "center"; | |
context.textBaseline = "top"; | |
context.fillStyle = state.color; | |
context.font = titleheight*state.scale+"px Arial"; | |
context.fillText("HomePrezzo", state.x, state.y); | |
context.font = (titleheight/2)*state.scale+"px Arial"; | |
context.fillText("Bardon Update", state.x, state.y+titleheight*state.scale); | |
context.closePath(); | |
} | |
}) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment