Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/skyrim/hlviewer.js
- Owner: skyrim
- License: mit
- Created: 2013-11-06T20:51:48.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-09-18T12:22:24.000Z (7 days ago)
- Last Synced: 2024-09-19T21:32:16.722Z (6 days ago)
- Topics: goldsrc, half-life, halflife, javascript, threejs, webgl
- Language: TypeScript
- Homepage: https://skyrim.github.io/hlviewer.js/
- Size: 11.9 MB
- Stars: 147
- Watchers: 11
- Forks: 26
- Open Issues: 6
-
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)
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')
```