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
var isNode = (typeof process !== "undefined" && typeof require !== "undefined"); | |
var isNodeWebkit = false; | |
//Is this Node.js? | |
if(isNode) { | |
//If so, test for Node-Webkit | |
try { | |
isNodeWebkit = (typeof require('nw.gui') !== "undefined"); | |
} catch(e) { | |
isNodeWebkit = false; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Device Ready Example</title> | |
<script type="text/javascript" charset="utf-8" src="cordova.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
// Wait for device API libraries to load | |
// |
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
/* | |
* http://stackoverflow.com/posts/13730758/revisions | |
* | |
* @method determineFontHeightInPixels | |
* @param fontStyle {String} | |
* @private | |
*/ | |
PIXI.Text.prototype.determineFontHeightInPixels = function(fontStyle) | |
{ | |
var result = PIXI.Text.heightCache[fontStyle]; |
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
/* @license | |
* pixi.js - v1.5.1 | |
* Copyright (c) 2012-2014, Mat Groves | |
* http://goodboydigital.com/ | |
* | |
* pixi.js is licensed under the MIT License. | |
* http://www.opensource.org/licenses/mit-license.php | |
* | |
* http://stackoverflow.com/users/34441/ellisbben | |
* great solution to the problem! |
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
:: Start | |
Your story will display this passage first. Edit it by double clicking it. | |
[[Passage]] | |
:: Passage | |
[[PassageName]] | |
More text not affected any changes. |
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
Phaser.Plugin.CocoonJSOuyaGamepad.prototype.moved = function(pad, axisId) { | |
var movedAmount = 0; | |
var magitudeLeft = 0; | |
var magitudeRight = 0; | |
if (_gamepads[pad]) { | |
magitudeLeft = Math.sqrt((_gamepads[pad].axes[0] * _gamepads[pad].axes[0]) + | |
(_gamepads[pad].axes[1] * _gamepads[pad].axes[1])); | |
magitudeRight = Math.sqrt((_gamepads[pad].axes[2] * _gamepads[pad].axes[2]) + | |
(_gamepads[pad].axes[3] * _gamepads[pad].axes[3])); | |
if (axisId === "AXIS_0" && _gamepads[pad].axes[0] <= 1) { |
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
// First, create a reference to the Wikifier.createInternalLink function. | |
// (Internally, this is what Twine uses to connect passages together. | |
// It is the last step in parsing double-bracked content into links.) | |
var oldCreateInternalLink = Wikifier.createInternalLink; | |
// Then, create a new function that mimics its functionality. | |
Wikifier.createInternalLink = function(place, title) { | |
// By calling the old function, it returns | |
// the DOM element (the link) it was about to |
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
/* | |
The first thing we are doing here is to create a new | |
display function, oldDisplay, as a reference to the | |
the normal History.display function. | |
(Note: History.display does most of the heavy lifting | |
in Twine. When a link is clicked, it is what | |
grabs the content of the passage from HTML and | |
adds it to the screen as text.) | |
*/ |
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
macros['loadJS'] = | |
{ | |
handler: function(place, object, parameters) | |
{ | |
var se = document.createElement("script"); | |
se.type = 'text/javascript'; | |
se.src = parameters[0]; | |
var hT = document.getElementsByTagName("HEAD")[0]; | |
hT.appendChild(se); | |
if(se.innerText) {eval(se.innerText);} |
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
/* | |
* A Geolocation object | |
* | |
* Note: Uses GPS or similar hardware for data if available through | |
* the browser, but will fall back to using (Google) geolocation | |
* services with current IP address automatically. | |
* | |
* @property {boolean} supported If the geolocation functions are available in the current context | |
* @property {function} onsuccess The function to be called if the geolocation services are successful | |
* @property {function} onerror The function to be called if an error occurs |
NewerOlder