Importing Blackprint
Load modules from CDN
<!-- If you're going to use Sketch, the framework need to be loaded before the engine -->
<script src="https://cdn.jsdelivr.net/npm/scarletsframe@0.35.x"></script>
<!-- If you're not going to use Sketch, you can also load the engine only -->
<script src="https://cdn.jsdelivr.net/npm/@blackprint/engine@0.6.x" crossorigin="anonymous"></script>
<!-- Load Sketch after the Engine -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@blackprint/sketch@0.6.x//dist/blackprint.sf.css">
<script src="https://cdn.jsdelivr.net/npm/@blackprint/sketch@0.6.x/dist/blackprint.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@blackprint/sketch@0.6.x/dist/blackprint.sf.js" crossorigin="anonymous"></script>
Installing package
$ composer install blackprint/engine
PHP
Blackprint for PHP is using namespace to make it easier to register nodes/interface. Please visit the repository instead.
require_once('../vendor/autoload.php');
// This can be called on different PHP libraries
\Blackprint\registerNamespace(__DIR__.'/BPNode');
Installing package
$ go get https://github.com/Blackprint/engine-go
Golang
package main
import (
"log"
Blackprint "github.com/blackprint/engine-go/blackprint"
"github.com/blackprint/engine-go/engine"
"github.com/blackprint/engine-go/types"
)
// class HelloNode extends engine.Node
type HelloNode struct {
*engine.Node
}
// This will be registered as Node definition
func main() {
Blackprint.RegisterNode("Example/Hello", func(instance *engine.Instance) any {
// ...
}
}
Last updated