JavaScript LMP (QPic) Canvas library

Locked
SiPlus
Posts: 1
Joined: Sat Jul 02, 2011 6:13 am

JavaScript LMP (QPic) Canvas library

Post by SiPlus »

Wrote a JS library yesterday.
It allows to load LMP files (QPic) from Quake and Half-Life in a web browser using HTML5 Canvas features.
To use it, link the library somewhere, create new canvas element and write

Code: Select all

<script type="text/javascript">LMPOpen(LMPFileName,LMPTarget,LMPX,LMPY,LMPPaletteFilename,LMPSubX,LMPSubY,LMPSubW,LMPSubH)</script>
where:
  • LMPFileName: file name (relative to HTML path, must be on the same domain).
  • LMPTarget: id of target canvas.
  • LMPX, LMPY: offset of LMP file (optional).
  • LMPPaletteFilename: palette path (relative to HTML path, must be on the same domain, optional, palette.lmp by default).
  • LMPSubX, LMPSubY, LMPSubW, LMPSubH: cropping (optional).
Download: https://skydrive.live.com/#!/?cid=65b4d ... =documents
Locked