Skip to content

Commit

Permalink
example
Browse files Browse the repository at this point in the history
  • Loading branch information
sidorares committed Apr 21, 2018
1 parent e57066f commit 35d2e82
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/fill-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ ntk.createClient( (err, app) => {
var wnd = app.createWindow({ width: 800, height: 600});
var ctx = wnd.getContext('2d');

var text = 'This-is-Test\u2038 test';
var text = 'This is Test test';

var lastx = 0;
var lasty = 0;

wnd.on('expose', (ev) => {
ctx.fillStyle = 'white';
ctx.fillRect(ev.x, ev.y, ev.width, ev.height, 1, 0.5, 0.5, 1);
ctx.font = "190px 'Times New Roman'";
ctx.font = "50px 'Times New Roman'";
var w = ctx.measureText(text).width;
ctx.fillStyle = ctx.createLinearGradient(0, 0, w, 100)
.addColorStop(0, 'red')
.addColorStop(1, 'blue');
ctx.fillStyle = 'rgba(200, 200, 180, 0.7)';
ctx.fillText(text, 750 - w, 250);
.addColorStop(1, 'blue');
ctx.fillStyle = 'red'; //'rgba(200, 200, 180, 0.7)';
ctx.fillText(text, 100, 100);// 750 - w, 250);
});
var shift = 0;
wnd.on('keydown', function(ev) {
Expand Down
17 changes: 17 additions & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "examples",
"version": "1.0.0",
"description": "",
"main": "example-await.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"baboon-image": "^2.1.0",
"bunny": "^1.0.1",
"teapot": "^1.0.0"
}
}

0 comments on commit 35d2e82

Please sign in to comment.