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: 3 months ago
JSON representation
Half-Life in WebGL
- Host: GitHub
- URL: https://github.com/skyrim/hlviewer.js
- Owner: skyrim
- License: mit
- Created: 2013-11-06T20:51:48.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2025-02-25T18:00:59.000Z (4 months ago)
- Last Synced: 2025-04-03T14:13:13.291Z (3 months ago)
- Topics: goldsrc, half-life, halflife, javascript, threejs, webgl
- Language: TypeScript
- Homepage: https://skyrim.github.io/hlviewer.js/
- Size: 11.9 MB
- Stars: 156
- Watchers: 11
- Forks: 31
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- RAWR - hlviewer.js - Half-Life in WebGL. ([Website](https://skyrim.github.io/hlviewer.js/)) (Gaming / GoldSrc / Source - Web tools)
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 ##

## 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')
```