Code Monkey home page Code Monkey logo

node-skia's Introduction

node-skia

This node module allows you to draw with skia on a native EGL window.

Build

Linux

# make

API

  • Spawn a native EGL window to draw on
var skia = require("skia");
var Window = skia.Window;

var win = new Window(1280, 720);
win.start();
win.stop();
win.release();
  • Draw at each frame directly on canvas :
var skia = require("skia");
var Window = skia.Window;

var win = new Window(1280, 720);
win.setDrawHandler(function(canvas) {
    canvas.drawColor(0xFFFFFFFF);
    canvas.drawText(0xFF000000, 100, 100, "Hello World !");
});
win.start();
win.stop();
win.release();
  • Use asynchronous view system :
var skia = require("skia");
var Window = skia.Window;
var View = skia.View;

var View = new View(0xFFFFFFFF);
var win = new Window(1280, 720);
win.setView(view);
win.start();
view.update({
    style : {
        color : 0xFF000000,
        x: 100,
        y: 100,
        fontSize : 30
    },
    children : [],
    content: "Hello World !"
});
win.stop();
win.release();

TODO

We have a basic POC today, but to have a complete library we need to :

  • be fully CSS 3 compliant
  • implement a real layout engine
  • implement transforms
  • implement transitions
  • add support for media element : audio, video, MSE

Other ideas :

  • DRM support through EME
  • Develop a framework with more complex elements

node-skia's People

Contributors

binouz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.