mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Fix last __dirname and __filename usages
This commit is contained in:
@@ -2,16 +2,16 @@ let widget = require("widget");
|
||||
|
||||
let demo_seconds = 30;
|
||||
|
||||
print("Loading file", __filepath);
|
||||
print("From directory", __dirpath);
|
||||
print("Loading file", __filename);
|
||||
print("From directory", __dirname);
|
||||
|
||||
// addText supports "Primary" and "Secondary" font sizes.
|
||||
widget.addText(10, 10, "Primary", "Example JS widget");
|
||||
widget.addText(10, 20, "Secondary", "Example widget from JS!");
|
||||
|
||||
// load a Xbm file from the same directory as this script.
|
||||
widget.addText(0, 30, "Secondary", __filepath);
|
||||
let logo = widget.loadImageXbm(__dirpath + "/widget-js.fxbm");
|
||||
widget.addText(0, 30, "Secondary", __filename);
|
||||
let logo = widget.loadImageXbm(__dirname + "/widget-js.fxbm");
|
||||
|
||||
// add a line (x1, y1, x2, y2)
|
||||
widget.addLine(10, 35, 120, 35);
|
||||
|
||||
@@ -73,18 +73,18 @@ Transforms a string to lower case.
|
||||
toLowerCase("Example") // "example"
|
||||
```
|
||||
|
||||
## __dirpath
|
||||
## __dirname
|
||||
Path to the directory containing the current script.
|
||||
|
||||
### Examples:
|
||||
```js
|
||||
print(__dirpath); // /ext/apps/Scripts/Examples
|
||||
print(__dirname); // /ext/apps/Scripts/Examples
|
||||
```
|
||||
|
||||
## __filepath
|
||||
## __filename
|
||||
Path to the current script file.
|
||||
|
||||
### Examples:
|
||||
```js
|
||||
print(__filepath); // /ext/apps/Scripts/Examples/path.js
|
||||
print(__filename); // /ext/apps/Scripts/Examples/path.js
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user