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> | |
<meta charset="UTF-8"> | |
<title>Canvas Pony · CodePen</title> | |
<!-- | |
Copyright (c) 2012 ivanpopelyshev, http://codepen.io/ivanpopelyshev | |
Permission is hereby granted, free of charge, to any person obtaining |
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
namespace gobi.core { | |
export class MiniRunner { | |
items: Array<object> = []; | |
private _name: string; | |
run: Function = null; | |
get name() { | |
return this._name; | |
} |
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
PIXI.Ticker.prototype._requestIfNeeded = function() | |
{ | |
if (!this.gsapTick) { | |
//do a research, where is the passed time | |
this.lastTime = performance.now(); | |
this.gsapTick = (event) => { this.update(MILLISECONDS_PASSED_IN_EVENT_I_DONT_KNOW) }; | |
//do a research how to call it after all the other listeners | |
TweenLite.ticker.addEventListener("tick", this.gsapTick); | |
} |
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
vec2 invBilinear( in vec2 p, in vec2 a, in vec2 b, in vec2 c, in vec2 d ) | |
{ | |
vec2 e = b-a; | |
vec2 f = d-a; | |
vec2 g = a-b+c-d; | |
vec2 h = p-a; | |
float k2 = cross2d( g, f ); | |
float k1 = cross2d( e, f ) + cross2d( h, g ); | |
float k0 = cross2d( h, e ); |
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
export const enum GradientInterpolationMethod { | |
RGB = 0, | |
LinearRGB = 1 | |
} | |
function toSRGB(x: number) { | |
if (x < 0.00313080) { | |
return x * 12.92; | |
} | |
return Math.pow(x, 1.0 / 2.4) * 1.055 - 0.055; |
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
// Its a custom renderer, pixi fork, it'll be easy to port on vanilla v5 | |
// Careful: Method names differ from V5. Find appropriate fields. | |
export class Canvas2DSurface implements ISurface, gobi.core.ITextureResource { | |
width: number; | |
height: number; | |
canvas: HTMLCanvasElement; | |
context: CanvasRenderingContext2D; | |
private _regionAllocator: RegionAllocator.IRegionAllocator; |
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
import PathCommand = Shumway.PathCommand; | |
import GradientType = Shumway.GradientType; | |
import GradientSpreadMethod = Shumway.GradientSpreadMethod; | |
import GradientInterpolationMethod = Shumway.GradientInterpolationMethod; | |
import Bounds = Shumway.Bounds; | |
import DataBuffer = Shumway.ArrayUtilities.DataBuffer; | |
import ShapeData = Shumway.ShapeData; | |
import ShapeMatrix = Shumway.ShapeMatrix; | |
import clamp = Shumway.NumberUtilities.clamp; | |
import assert = Shumway.Debug.assert; |
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
import { | |
UtSystem, | |
UtDebug, | |
LDTransform, | |
LDGL, | |
Live2D, | |
Live2DModelWebGL, | |
Live2DModelJS, | |
Live2DMotion, | |
MotionQueueManager, |
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
import { Graphics } from "pixi.js"; | |
const angles = []; | |
export class Progress extends Graphics { | |
_color: number; | |
_tWidth: number; | |
_tHeight: number; | |
_progress: number; | |
public invert: boolean = 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
export class BlitterRenderState implements core.IPreRenderState { | |
constructor(public cache: RuntimeCache) { | |
} | |
visit(node: Node) { | |
const vs = node.rendererObject as pixi.VectorSprite; | |
if (vs && vs.model) { | |
// && vs.model.preferredCache === pixi.CacheType.RuntimeWebGL ? | |
this.cache.foundVectors.push(vs); | |
} |