dorkhub

hlviewer.js

Half-Life in WebGL

skyrim
TypeScript17534 forksMITupdated 3 days ago
visit the demogit clone https://github.com/skyrim/hlviewer.js.gitskyrim/hlviewer.js

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

Screenshot

Screenshot

Example Usage

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

<link rel="stylesheet" href="your/path/to/hlviewer.style">
<script src="your/path/to/hlviewer.min.js"></script>

or use a CDN

<link rel="stylesheet" href="https://unpkg.com/hlviewer.js@0.8.3/dist/hlviewer.js.css">
<script src="https://unpkg.com/hlviewer.js@0.8.3/dist/hlviewer.min.js"></script>

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

<div id="hlv-target" style="width:800px; height:600px"></div>

This code will initialize the state.

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).

hlv.load('some_file.dem')

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

hlv.load('some_file.bsp')

more like this

lottery

🎉🌟✨🎈年会抽奖程序,基于 Express + Three.js的 3D 球体抽奖程序,奖品🧧🎁,文字,图片,抽奖规则均可配置,😜抽奖人员信息Excel一键导入😍,抽奖结果Excel导出😎,给你的抽奖活动带来全新酷炫体验🚀🚀🚀

JavaScript4.6k

search

search projects, people, and tags