Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/skyrim/hlviewer.js

Half-Life in WebGL
https://github.com/skyrim/hlviewer.js

goldsrc half-life halflife javascript threejs webgl

Last synced: about 18 hours ago
JSON representation

Half-Life in WebGL

Awesome Lists containing this project

README

        

# [hlviewer.js](http://skyrim.github.io/hlviewer.js)

HLViewer is a simple to use javascript library for viewing maps
and playing replays of GoldSrc engine based games entirely in browser.

## Demo ##

You can check out the live demo [here](http://skyrim.github.io/hlviewer.js)

## Screenshot ##

![Screenshot](res/screenshot.jpg)

## Example Usage ##

Download the library from __dist__ directory and include it in your html.
```html

```
or use a CDN
```html

```

Create a target element where viewer will later be created.
Width and height MUST be set.

```html


```

This code will initialize the state.

```javascript
var hlv = HLViewer.init('#hlv-target', {
// paths where files are stored on your server
paths: {
base: '/',
replays: 'res/replays',
maps: 'res/maps',
wads: 'res/wads',
skies: 'res/skies',
sounds: 'res/sounds'
}
})
```

This will load both the replay and the map of that replay (and wad files).

```javascript
hlv.load('some_file.dem')
```

This will only load the map (and wad files).

```javascript
hlv.load('some_file.bsp')
```