# voxel-tile

> Load google map or open street map style tiles in voxel.js

Latest version **0.1.0** (published 2013-06-22) · 0 weekly downloads

## Install

```sh
npm install voxel-tile
pnpm add voxel-tile
yarn add voxel-tile
bun add voxel-tile
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2013-06-22 |
| First published | 2013-06-22 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Kyle Robinson Young |
| Maintainers | shama |

## Links

- npm: https://www.npmjs.com/package/voxel-tile
- Repository: https://github.com/shama/voxel-tile
- Issues: https://github.com/shama/voxel-tile/issues
- npm.io page: https://npm.io/package/voxel-tile

## Dependencies (3)

- [voxel](https://npm.io/package/voxel.md) ~0.3.1
- [inherits](https://npm.io/package/inherits.md) ~2.0.0
- [voxel-mesh](https://npm.io/package/voxel-mesh.md) ~0.2.1

## Recent versions

- 0.1.0 (latest) — 2013-06-22

## README

# voxel-tile

**WORK IN PROGRESS**

Load google map or open street map tiles into [voxel.js](http://voxeljs.com).

## example

```js
var tile = require('voxel-tile')({
  game: game,

  // Path to tile images
  tilepath: 'textures/heightmap/tiles/',

  // [optional] Load a separate tile for coloring
  // (otherwise it will just use the colors from the heightmap)
  colortilepath: 'textures/colormap/tiles/',

  // [optional] Size of chunks
  size: 32,

  // [optional] Size of tiles
  tilesize: 256,

  // [optional] URL format to tiles
  tileformat: '%z/%x/%y.png',

  // [optional] Maximum zoom level
  zoomax: 6,
  // [optional] Minimum zoom level
  zoomin: 3,

  // [optional] Voxel mesher to mesh with
  mesher: voxel.meshers.greedy,

  // [optional] Boolean whether the tiles should infinitely repeat
  repeat: true,

  // [optional] Boolean whether to render the world flat
  flat: false,

  // [optional] Function to determine height based on color
  heightmap: function(r, g, b, a) {
    return Math.floor(((r * 255 * 255 + g * 255 + b) / 16646655) * 32)
  },
})

// On missing chunk, load up tile for chunk position
game.voxels.on('missingChunk', tile.missingChunk.bind(tile))

// Set zoom level based on the current player height distance
game.on('tick', function() {
  tile.setZoom(player.yaw.position.y)
})
```

## install

With [npm](https://npmjs.org) do:

```
npm install voxel-tile
```

Use [browserify](http://browserify.org) to `require('voxel-tile')`.

## release history
* 0.1.0 - initial release

## license
Copyright (c) 2013 Kyle Robinson Young<br/>
Licensed under the MIT license.

---
_Source: https://npm.io/package/voxel-tile · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
