Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
load1n9 committed Feb 27, 2022
1 parent 49ac90f commit b498002
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Neko 🐈
caviar's twin frame buffer deno module built on top of mini_fb


### Usage

#### Using Methods

```typescript
import { World, Neko } from "https://deno.land/x/neko/mod.ts";

const width = 800;
const height = 600;

const neko = new Neko({
title: "Neko",
width,
height,
});
const frame = new Uint8Array(width * height * 4).fill(0x000000);
class Instance extends World {
update() {
frame[Math.round(Math.random() * frame.length)] = Math.round(Math.random() * 0xffffff);
neko.setFrameBuffer(frame);
}
}

new Instance().start(neko, 60);
```
#### Using Functions
```typescript
import { World, Neko } from "https://deno.land/x/neko/mod.ts";

const width = 800;
const height = 600;

const neko = new Neko({
title: "Neko",
width,
height,
});
const frame = new Uint8Array(width * height * 4).fill(0x000000);
new World().start(neko, {
fps: 60,
update: () => {
frame[Math.round(Math.random() * frame.length)] = Math.round(Math.random() * 0xffffff);
neko.setFrameBuffer(frame);
}
});
```

0 comments on commit b498002

Please sign in to comment.