forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
three-canvasrenderer.d.ts
58 lines (49 loc) · 2.02 KB
/
three-canvasrenderer.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Type definitions for three.js (CanvasRenderer.js)
// Project: https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js
// Definitions by: Satoru Kimura <https://github.com/gyohk>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="./three.d.ts" />
declare module THREE {
export interface SpriteCanvasMaterialParameters extends MaterialParameters{
color?: number;
program?: (context: any, color: Color) => void;
}
export class SpriteCanvasMaterial extends Material {
constructor(parameters?: SpriteCanvasMaterialParameters);
color: Color;
program(context: any, color: Color): void;
clone(): SpriteCanvasMaterial;
}
export interface CanvasRendererParameters {
canvas?: HTMLCanvasElement;
devicePixelRatio?: number;
}
export class CanvasRenderer implements Renderer {
constructor(parameters?: CanvasRendererParameters);
domElement: HTMLCanvasElement;
autoClear: boolean;
sortObjects: boolean;
sortElements: boolean;
info: { render: { vertices: number; faces: number; }; };
supportsVertexTextures(): void;
setFaceCulling(): void;
getPixelRatio(): number;
setPixelRatio(value: number): void;
setSize(width: number, height: number, updateStyle?: boolean): void;
setViewport(x: number, y: number, width: number, height: number): void;
setScissor(): void;
enableScissorTest(): void;
setClearColor(color: Color, opacity?: number): void;
setClearColor(color: string, opacity?: number): void;
setClearColor(color: number, opacity?: number): void;
setClearColorHex(hex: number, alpha?: number): void;
getClearColor(): Color;
getClearAlpha(): number;
getMaxAnisotropy(): number;
clear(): void;
clearColor(): void;
clearDepth(): void;
clearStencil(): void;
render(scene: Scene, camera: Camera): void;
}
}