Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Foone Turing
committed
Oct 26, 2017
0 parents
commit e8bf30c
Showing
7 changed files
with
810 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
== Sierra Death Screen Generator | ||
|
||
This creates GAME OVER/YOU DIED screens as seen in Sierra Online's SCI engine. | ||
Right now, it only supports Police Quest 2 | ||
|
||
== Creating a new font == | ||
|
||
This is mainly a guide for me so I don't forget. | ||
|
||
1. Extract the font file from the game using one of the SCI viewers, like SCI Companion or SCI Viewer | ||
2. Run sci-font-extract.py to generate the font file + json file | ||
3. Edit the json file to add the height/origin/box/null-character fields | ||
4. Screenshot a game over in the game, crop the death screen, then edit out the text | ||
|
||
== TODO == | ||
|
||
* Actually support games other than PQ2? | ||
* Add a twitter-safe saving option, for death screens that aren't inherently twitter-safe | ||
* Add options to adjust scaling. | ||
* Let you change the titlebar text? | ||
* Add custom backgrounds, not just the error box? | ||
|
||
=== Other games to add === | ||
* Every SCI game | ||
* AGI games? | ||
* SimCity 2000 (YOU CAN'T CUT BACK ON FUNDING YOU WILL REGRET THIS!) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<!DOCTYPE html> | ||
<title>Police Quest 2 Death Generator</title> | ||
<style> | ||
img.source{ | ||
display: none; | ||
} | ||
textarea{ | ||
font-family: monospace; | ||
} | ||
</style> | ||
<script src="jquery-3.2.1.min.js"></script> | ||
<img src="pq2-blank.png" id="template" class="source"/> | ||
<img src="pq2-font.png" id="font" class="source"/> | ||
<canvas id=death >No canvas!</canvas> | ||
<p> | ||
<textarea cols=40 rows=5 id=sourcetext> | ||
Thank you for playing Police | ||
Quest 2. Next time, be a little more | ||
careful. | ||
</textarea> | ||
</p> | ||
<script> | ||
var scale = 2 | ||
var canvas = document.querySelector('canvas') | ||
var context = canvas.getContext('2d') | ||
var baseImage = document.querySelector('img#template') | ||
var fontImage = document.querySelector('img#font') | ||
var fontInfo=null | ||
|
||
function renderText(){ | ||
var origin=fontInfo.origin | ||
var bx=fontInfo.box.x,by=fontInfo.box.y | ||
var text = document.querySelector("textarea#sourcetext").value.split('\n') | ||
context.drawImage(baseImage, 0, 0, baseImage.width*scale, baseImage.height*scale) | ||
var y=origin.y | ||
for (let line of text){ | ||
var x=origin.x | ||
for(var i=0;i<line.length;i++){ | ||
var info=fontInfo[line.charCodeAt(i)] | ||
if(info==null){ | ||
info=fontInfo[fontInfo["null-character"]] | ||
} | ||
context.drawImage(fontImage,info.x,0,bx,by,x*scale,y*scale,bx*scale,by*scale) | ||
x+=info.w | ||
} | ||
y+=fontInfo.height | ||
} | ||
} | ||
$('#sourcetext').keyup(function(){ | ||
if(fontInfo != null){ | ||
renderText() | ||
} | ||
}) | ||
$(window).on('load', function(){ | ||
context.canvas.width = baseImage.width * scale | ||
context.canvas.height = baseImage.height * scale | ||
context.imageSmoothingEnabled = false; | ||
$.getJSON("pq2.json",function(data){ | ||
fontInfo = data | ||
renderText() | ||
}) | ||
}); | ||
</script> |
Large diffs are not rendered by default.
Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.