New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

kami-batch2

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kami-batch2

sprite batching for kami

latest
Source
npmnpm
Version
2.0.4
Version published
Maintainers
1
Created
Source

kami-batch

unstable

A fast and efficient 2D sprite batcher based loosely on LibGDX's implementation.

Usage

NPM

See examples folder for details. A full program could look like this:

//setup a canvas
var gl = require('webgl-context')({
    width: 512,
    height: 512
});

//an opaque white texture, useful for tinting lines and rectangles
var tex = require('kami-white-texture')(gl);

//create a sprite batcher
var batch = require('kami-batch')(gl);

batch.begin();

//tint the vertex attributes
batch.setColor(1,0,0);

//draw some sprites
batch.draw(tex, 0, 0, 256, 256);
batch.draw(tex, 5, 5, 12, 51);

//submit to GPU
batch.end();

//add to DOM
document.body.appendChild( gl.canvas );

Planned Changes

  • use projection matrices instead of a vector
  • support rotation on the fly

License

MIT, see LICENSE.md for details.

Keywords

webgl

FAQs

Package last updated on 18 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts