You've already forked PixelDrawr
mirror of
https://github.com/FullScreenShenanigans/PixelDrawr.git
synced 2026-04-28 13:00:21 -07:00
(v0.7.0) Used shenanigans-manager@2 instead of Gulp
This commit is contained in:
+2
-2
@@ -1,8 +1,8 @@
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- "7"
|
||||
- "node"
|
||||
- "5"
|
||||
|
||||
script:
|
||||
node_modules/gulp/bin/gulp.js
|
||||
npm run verify
|
||||
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"editor.tabSize": 4,
|
||||
"editor.trimAutoWhitespace": true,
|
||||
"tslint.alwaysShowRuleFailuresAsWarnings": true,
|
||||
"tslint.autoFixOnSave": true,
|
||||
"typescript.tsdk": "node_modules\\typescript\\lib"
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
require("gulp-shenanigans").initialize(require("gulp"));
|
||||
Generated
+2
-8738
File diff suppressed because it is too large
Load Diff
+67
-34
@@ -1,35 +1,68 @@
|
||||
{
|
||||
"name": "pixeldrawr",
|
||||
"description": "A chained automator for applying and caching transforms.",
|
||||
"version": "0.6.3",
|
||||
"author": {
|
||||
"name": "Josh Goldberg",
|
||||
"email": "joshuakgoldberg@outlook.com"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com:FullScreenShenanigans/PixelDrawr.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/FullScreenShenanigans/PixelDrawr/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"changelinr": "0.6.X",
|
||||
"itemsholdr": "0.6.X",
|
||||
"objectmakr": "0.6.X",
|
||||
"pixelrendr": "0.6.X",
|
||||
"stringfilr": "0.6.X"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-shenanigans": "^0.6.17"
|
||||
},
|
||||
"scripts": {
|
||||
"gulp": "gulp",
|
||||
"test": "gulp test"
|
||||
},
|
||||
"shenanigans": {
|
||||
"name": "PixelDrawr"
|
||||
}
|
||||
}
|
||||
"author": {
|
||||
"email": "joshuakgoldberg@outlook.com",
|
||||
"name": "Josh Goldberg"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/FullScreenShenanigans/PixelDrawr/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"pixelrendr": "^0.7.0"
|
||||
},
|
||||
"description": "A chained automator for applying and caching transforms.",
|
||||
"devDependencies": {
|
||||
"@types/chai": "^4.0.4",
|
||||
"@types/lolex": "^1.5.32",
|
||||
"@types/mocha": "^2.2.44",
|
||||
"@types/sinon": "^4.0.0",
|
||||
"@types/sinon-chai": "^2.7.29",
|
||||
"chai": "^4.1.2",
|
||||
"glob": "^7.1.2",
|
||||
"lolex": "^2.3.0",
|
||||
"mocha": "^4.0.1",
|
||||
"mocha-headless-chrome": "^1.7.1",
|
||||
"requirejs": "^2.3.5",
|
||||
"run-for-every-file": "^1.1.0",
|
||||
"shenanigans-manager": "^0.2.0",
|
||||
"sinon": "^4.1.2",
|
||||
"sinon-chai": "^2.14.0",
|
||||
"tslint": "5.8.0",
|
||||
"typedoc": "^0.9.0",
|
||||
"typescript": "^2.6.2",
|
||||
"webpack": "^3.10.0"
|
||||
},
|
||||
"license": "MIT",
|
||||
"name": "pixeldrawr",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com:FullScreenShenanigans/PixelDrawr.git"
|
||||
},
|
||||
"scripts": {
|
||||
"dist": "npm run dist:webpack",
|
||||
"dist:webpack": "webpack --config webpack.config.js",
|
||||
"docs": "npm run docs:typedoc",
|
||||
"docs:typedoc": "typedoc src/ --out docs/generated",
|
||||
"init": "npm install && npm run setup && npm run verify",
|
||||
"setup": "npm run setup:copy && npm run setup:package",
|
||||
"setup:copy": "npm run setup:copy:default",
|
||||
"setup:copy:default": "run-for-every-file --dot --src \"node_modules/shenanigans-manager/setup/default/\" --file \"**/*\" --run \"mustache package.json {{src-file}} {{file}}\" --dest \".\" --only-files",
|
||||
"setup:package": "shenanigans-manager hydrate-package-json",
|
||||
"src": "npm run src:tsc && npm run src:tslint",
|
||||
"src:tsc": "tsc -p .",
|
||||
"src:tslint": "tslint -c tslint.json --exclude ./node_modules/**/*.ts* -p tsconfig.json -t stylish",
|
||||
"test": "npm run test:setup && npm run test:run",
|
||||
"test:run": "mocha-headless-chrome --file test/index.html",
|
||||
"test:setup": "npm run test:setup:copy && npm run test:setup:html && npm run test:setup:tsc",
|
||||
"test:setup:copy": "npm run test:setup:copy:default",
|
||||
"test:setup:copy:default": "run-for-every-file --dot --src \"node_modules/shenanigans-manager/setup/test/\" --file \"**/*\" --run \"mustache package.json {{src-file}} ./test/{{file}}\" --dest \".\" --only-files",
|
||||
"test:setup:html": "shenanigans-manager generate-test-html",
|
||||
"test:setup:tsc": "tsc -p test",
|
||||
"verify": "npm run src && npm run test && npm run dist && npm run docs",
|
||||
"watch": "run-p \"tsc -p . -w\" \"echo sup\""
|
||||
},
|
||||
"shenanigans": {
|
||||
"name": "PixelDrawr"
|
||||
},
|
||||
"types": "./src/index.d.ts",
|
||||
"version": "0.7.0"
|
||||
}
|
||||
+22
-6
@@ -1,4 +1,21 @@
|
||||
import { IPixelRendr } from "pixelrendr/lib/IPixelRendr";
|
||||
import { IPixelRendr } from "pixelrendr";
|
||||
|
||||
/**
|
||||
* Create a canvas of a given width and height.
|
||||
*
|
||||
* @param width Width of the canvas.
|
||||
* @param height Height of the canvas.
|
||||
* @returns Canvas of the given width and height.
|
||||
*/
|
||||
export type ICreateCanvas = (width: number, height: number) => HTMLCanvasElement;
|
||||
|
||||
/**
|
||||
* Generates a retrieval key for a Thing.
|
||||
*
|
||||
* @param thing Thing to create a key from.
|
||||
* @returns Retrieval key for the Thing.
|
||||
*/
|
||||
export type IGenerateObjectKey = (thing: IThing) => string;
|
||||
|
||||
/**
|
||||
* Boundaries of a drawing area, commonly fulfilled by an IMapScreenr.
|
||||
@@ -95,9 +112,9 @@ export interface IPixelDrawrSettings {
|
||||
boundingBox: IBoundingBox;
|
||||
|
||||
/**
|
||||
* A Function to create a canvas of a given width and height.
|
||||
* Create a canvas of a given width and height.
|
||||
*/
|
||||
createCanvas: (width: number, height: number) => HTMLCanvasElement;
|
||||
createCanvas: ICreateCanvas;
|
||||
|
||||
/**
|
||||
* Whether refills should skip redrawing the background each time.
|
||||
@@ -121,10 +138,9 @@ export interface IPixelDrawrSettings {
|
||||
framerateSkip?: number;
|
||||
|
||||
/**
|
||||
* How to generat ekeys to retrieve sprites from the PixelRendr (by default,
|
||||
* Object.toString).
|
||||
* Generates retrieval keys for Things (by default, toString).
|
||||
*/
|
||||
generateObjectKey?: (thing: IThing) => string;
|
||||
generateObjectKey?: IGenerateObjectKey;
|
||||
|
||||
/**
|
||||
* An arbitrarily small minimum opacity for a Thing to be considered not
|
||||
|
||||
+7
-36
@@ -1,6 +1,4 @@
|
||||
import { IPixelRendr } from "pixelrendr/lib/IPixelRendr";
|
||||
import { ICanvases, SpriteMultiple } from "pixelrendr/lib/SpriteMultiple";
|
||||
import { SpriteSingle } from "pixelrendr/lib/SpriteSingle";
|
||||
import { ICanvases, IPixelRendr, SpriteMultiple, SpriteSingle } from "pixelrendr";
|
||||
|
||||
import { IBoundingBox, IPixelDrawr, IPixelDrawrSettings, IThing } from "./IPixelDrawr";
|
||||
|
||||
@@ -53,21 +51,11 @@ export class PixelDrawr implements IPixelDrawr {
|
||||
*/
|
||||
private readonly generateObjectKey: (thing: IThing) => string;
|
||||
|
||||
/**
|
||||
* The maximum size of a SpriteMultiple to pre-render.
|
||||
*/
|
||||
private readonly spriteCacheCutoff: number;
|
||||
|
||||
/**
|
||||
* Whether refills should skip redrawing the background each time.
|
||||
*/
|
||||
private noRefill: boolean;
|
||||
|
||||
/**
|
||||
* For refillQuadrant, an Array of String names to refill (bottom-to-top).
|
||||
*/
|
||||
private readonly groupNames: string[];
|
||||
|
||||
/**
|
||||
* How often the screen redraws (1 for always, 2 for every other call, etc).
|
||||
*/
|
||||
@@ -89,33 +77,16 @@ export class PixelDrawr implements IPixelDrawr {
|
||||
* @param settings Settings to be used for initialization.
|
||||
*/
|
||||
public constructor(settings: IPixelDrawrSettings) {
|
||||
if (!settings) {
|
||||
throw new Error("No settings object given to PixelDrawr.");
|
||||
}
|
||||
if (typeof settings.pixelRender === "undefined") {
|
||||
throw new Error("No PixelRender given to PixelDrawr.");
|
||||
}
|
||||
if (typeof settings.boundingBox === "undefined") {
|
||||
throw new Error("No boundingBox given to PixelDrawr.");
|
||||
}
|
||||
if (typeof settings.createCanvas === "undefined") {
|
||||
throw new Error("No createCanvas given to PixelDrawr.");
|
||||
}
|
||||
|
||||
this.pixelRender = settings.pixelRender;
|
||||
this.boundingBox = settings.boundingBox;
|
||||
this.createCanvas = settings.createCanvas;
|
||||
|
||||
this.noRefill = !!settings.noRefill;
|
||||
this.spriteCacheCutoff = settings.spriteCacheCutoff || 0;
|
||||
this.groupNames = settings.groupNames || [];
|
||||
this.framerateSkip = settings.framerateSkip || 1;
|
||||
this.framesDrawn = 0;
|
||||
this.epsilon = settings.epsilon || .007;
|
||||
this.epsilon = settings.epsilon || 0.007;
|
||||
|
||||
this.generateObjectKey = settings.generateObjectKey || function (thing: IThing): string {
|
||||
return thing.toString();
|
||||
};
|
||||
this.generateObjectKey = settings.generateObjectKey || ((thing: IThing) => thing.toString());
|
||||
|
||||
this.resetBackground();
|
||||
}
|
||||
@@ -392,9 +363,9 @@ export class PixelDrawr implements IPixelDrawr {
|
||||
break;
|
||||
|
||||
// Corner (vertical + horizontal + corner) sprites must have corners
|
||||
// in "topRight", "bottomRight", "bottomLeft", and "topLeft".
|
||||
// In "topRight", "bottomRight", "bottomLeft", and "topLeft".
|
||||
case "corners":
|
||||
// topLeft, left, bottomLeft
|
||||
// TopLeft, left, bottomLeft
|
||||
diffvert = sprite.topheight ? sprite.topheight : spriteHeight;
|
||||
diffhoriz = sprite.leftwidth ? sprite.leftwidth : spriteWidth;
|
||||
this.drawPatternOnContext(context, canvases.topLeft!, leftReal, topReal, widthDrawn, heightDrawn, opacity);
|
||||
@@ -417,7 +388,7 @@ export class PixelDrawr implements IPixelDrawr {
|
||||
leftReal += diffhoriz;
|
||||
widthReal -= diffhoriz;
|
||||
|
||||
// top, topRight
|
||||
// Top, topRight
|
||||
diffhoriz = sprite.rightwidth ? sprite.rightwidth : spriteWidth;
|
||||
this.drawPatternOnContext(
|
||||
context,
|
||||
@@ -438,7 +409,7 @@ export class PixelDrawr implements IPixelDrawr {
|
||||
topReal += diffvert;
|
||||
heightReal -= diffvert;
|
||||
|
||||
// right, bottomRight, bottom
|
||||
// Right, bottomRight, bottom
|
||||
diffvert = sprite.bottomheight ? sprite.bottomheight : spriteHeight;
|
||||
this.drawPatternOnContext(
|
||||
context,
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from "./IPixelDrawr";
|
||||
export * from "./PixelDrawr";
|
||||
@@ -1,3 +0,0 @@
|
||||
import { mochaLoader } from "../main";
|
||||
|
||||
mochaLoader.it("_", (): void => { });
|
||||
+2
-17
@@ -1,19 +1,4 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"lib": ["dom", "es2015.collection", "es2015.promise", "es5"],
|
||||
"module": "amd",
|
||||
"moduleResolution": "node",
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitReturns": true,
|
||||
"noImplicitThis": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"strictNullChecks": true,
|
||||
"target": "es5"
|
||||
},
|
||||
"include": [
|
||||
"./**/*.ts"
|
||||
]
|
||||
"extends": "../tsconfig.json",
|
||||
"include": ["*.ts"]
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { IPixelDrawr, IPixelDrawrSettings } from "../../src/IPixelDrawr";
|
||||
import { PixelDrawr } from "../../src/PixelDrawr";
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export function mockPixelDrawr(settings: IPixelDrawrSettings): IPixelDrawr {
|
||||
return new PixelDrawr(settings);
|
||||
}
|
||||
+9
-3
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"experimentalDecorators": true,
|
||||
"jsx": "react",
|
||||
"lib": ["dom", "es2015.collection", "es2015.promise", "es5"],
|
||||
"module": "amd",
|
||||
"moduleResolution": "node",
|
||||
@@ -8,12 +10,16 @@
|
||||
"noImplicitReturns": true,
|
||||
"noImplicitThis": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"pretty": true,
|
||||
"strictNullChecks": true,
|
||||
"target": "es5"
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
"node_modules"
|
||||
],
|
||||
"include": [
|
||||
"./src/**/*.ts"
|
||||
"./src/**/*.ts",
|
||||
"./src/**/*.tsx"
|
||||
]
|
||||
}
|
||||
|
||||
+10
-52
@@ -1,56 +1,14 @@
|
||||
{
|
||||
"extends": "tslint:all",
|
||||
"extends": "./node_modules/shenanigans-manager/setup/tslint.json",
|
||||
"rules": {
|
||||
"array-type": [false],
|
||||
"arrow-return-shorthand": [false],
|
||||
"ban-types": [false],
|
||||
"callable-types": [false],
|
||||
"comment-format": [false],
|
||||
"completed-docs": [false],
|
||||
"cyclomatic-complexity": [false],
|
||||
"forin": [false],
|
||||
"linebreak-style": [false],
|
||||
"max-file-line-count": [false],
|
||||
"max-line-length": [true, 140],
|
||||
"member-ordering": [
|
||||
true,
|
||||
"public-before-private",
|
||||
"static-before-instance",
|
||||
"variables-before-functions"
|
||||
],
|
||||
"newline-before-return": [false],
|
||||
"no-any": [false],
|
||||
"no-bitwise": [false],
|
||||
"no-console": [false],
|
||||
"no-default-export": [false],
|
||||
"no-inferrable-types": [false],
|
||||
"no-magic-numbers": [false],
|
||||
"no-redundant-jsdoc": [false],
|
||||
"no-non-null-assertion": [false],
|
||||
"no-object-literal-type-assertion": [false],
|
||||
"no-submodule-imports": [false],
|
||||
"no-require-imports": false,
|
||||
"no-unbound-method": [false],
|
||||
"no-unsafe-any": [false],
|
||||
"no-unused-variable": [false],
|
||||
"no-void-expression": [false],
|
||||
"number-literal-format": [false],
|
||||
"object-literal-key-quotes": [false],
|
||||
"object-literal-shorthand": [false],
|
||||
"object-literal-sort-keys": [false],
|
||||
"only-arrow-functions": [false],
|
||||
"prefer-function-over-method": [false],
|
||||
"prefer-method-signature": [false],
|
||||
"prefer-switch": [false],
|
||||
"prefer-conditional-expression": [false],
|
||||
"prefer-template": [false],
|
||||
"restrict-plus-operands": [false],
|
||||
"space-before-function-paren": [false],
|
||||
"strict-boolean-expressions": [false],
|
||||
"strict-type-predicates": [false],
|
||||
"switch-final-break": [false],
|
||||
"trailing-comma": [false],
|
||||
"typedef": [false],
|
||||
"variable-name": [false]
|
||||
"completed-docs": false,
|
||||
"no-any": false,
|
||||
"no-bitwise": false,
|
||||
"no-magic-numbers": false,
|
||||
"no-non-null-assertion": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-unsafe-any": false,
|
||||
"prefer-function-over-method": false,
|
||||
"strict-boolean-expressions": false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user