-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Added comments to examples
- Loading branch information
Showing
9 changed files
with
73 additions
and
56 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
var pitft = require("../pitft"); | ||
|
||
var fb = pitft("/dev/fb1"); | ||
var fb = pitft("/dev/fb1"); // Returns a framebuffer in direct mode. See the clock.js example for double buffering mode | ||
|
||
// Clear the screen buffer | ||
fb.clear(); | ||
|
||
var xMax = fb.size().width; | ||
var yMax = fb.size().height; | ||
|
||
fb.color(1, 1, 1); | ||
fb.color(1, 1, 1); // Set the color to white | ||
|
||
for (var a=0; a<=90; a+=15) { | ||
fb.font("fantasy", 12, false, a); | ||
fb.text(20, 20, "Rotated text"); | ||
fb.font("fantasy", 12); // Use the "fantasy" font with size 12 | ||
fb.text(20, 20, "Rotated text", false, a); // Draw the text non-centered, rotated _a_ degrees | ||
} | ||
|
||
for (var a=0; a<=180; a+=15) { | ||
fb.font("fantasy", 24, true, a); | ||
fb.text(xMax/2, yMax/2, "Rotated text"); | ||
fb.font("fantasy", 24, true); // Use the "fantasy" font with size 24, and font weight bold | ||
fb.text(xMax/2, yMax/2, "Rotated text", true, a); // Draw the text centered, rotated _a_ degrees | ||
} | ||
|
||
for (var a=180; a<=270; a+=15) { | ||
fb.font("fantasy", 12, false, a); | ||
fb.text(xMax-20, yMax-20, "Rotated text"); | ||
fb.font("fantasy", 12); // Use the "fantasy" font with size 12 | ||
fb.text(xMax-20, yMax-20, "Rotated text", false, a); // Draw the text non-centered, rotated _a_ degrees | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "pitft", | ||
"description": "A NodeJS module that gives you access to the PiTFT framebuffer", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"main": "pitft.js", | ||
"author": "Werner Vesteraas <[email protected]>", | ||
"license": { | ||
|
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
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