Blackprint
  • Home
  • Importing Blackprint
  • Editor
    • Getting Started
    • Example
    • Remote module server
  • Engine
    • This Engine section currently out of date
    • Create Custom Nodes
    • Register Interface
      • Interface Event
    • Register Node
    • Create New Instance
Powered by GitBook
On this page

Was this helpful?

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 module

# You can use PNPM or NPM when installing packages
$ pnpm i @blackprint/engine

JavaScript

let Blackprint = require("@blackprint/engine");

Blackprint.registerNode("...", class extends Blackprint.Node { ... });

Load module from CDN

import Blackprint from 'https://cdn.skypack.dev/@blackprint/engine@0.6';

Blackprint.registerNode("...", class extends Blackprint.Node { ... });

Installing package

$ composer install blackprint/engine

PHP

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 {
       // ...
    }
}

PreviousHomeNextGetting Started

Last updated 3 years ago

Was this helpful?

Blackprint for PHP is using namespace to make it easier to register nodes/interface. Please visit instead.

the repository