Last active
October 12, 2018 20:19
-
-
Save peterflynn/1a5e1917c7c55038a777a08c507304c5 to your computer and use it in GitHub Desktop.
XD Starter Plugin
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
/* | |
* Sample plugin code for Adobe XD. | |
* | |
* Visit http://adobexdplatform.com/ for API docs and more sample code. | |
*/ | |
var {Rectangle, Color} = require("scenegraph"); | |
function createRectangle(selection) { | |
// Insert a red square in the current artboard or group/container | |
var shape = new Rectangle(); | |
shape.width = 100; | |
shape.height = 100; | |
shape.fill = new Color("#f00"); | |
selection.insertionParent.addChild(shape); | |
} | |
module.exports = { | |
commands: { | |
myPluginCommand: createRectangle | |
} | |
}; |
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
{ | |
"name": "Starter Plugin Sample", | |
"id": "YOUR_ID_HERE", | |
"version": "1.0.0", | |
"description": "Sample plugin code for Adobe XD, providing starter project scaffolding.", | |
"host": { | |
"app": "XD", | |
"minVersion": "13.0.0" | |
}, | |
"uiEntryPoints": [ | |
{ | |
"type": "menu", | |
"label": "Plugin Hello World", | |
"commandId": "myPluginCommand" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment