@babylonjs/post-processes 5.0.0-beta.9 → 5.0.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,105 +1,107 @@
1
- import { Nullable } from "@babylonjs/core/types";
2
- import { Camera } from "@babylonjs/core/Cameras/camera";
3
- import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture";
4
- import { PostProcess } from "@babylonjs/core/PostProcesses/postProcess";
5
- import { Scene } from "@babylonjs/core/scene";
6
- import "./asciiart.fragment";
7
- /**
8
- * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
9
- *
10
- * It basically takes care rendering the font front the given font size to a texture.
11
- * This is used later on in the postprocess.
12
- */
13
- export declare class AsciiArtFontTexture extends BaseTexture {
14
- private _font;
15
- private _text;
16
- private _charSize;
17
- /**
18
- * Gets the size of one char in the texture (each char fits in size * size space in the texture).
19
- */
20
- get charSize(): number;
21
- /**
22
- * Create a new instance of the Ascii Art FontTexture class
23
- * @param name the name of the texture
24
- * @param font the font to use, use the W3C CSS notation
25
- * @param text the caracter set to use in the rendering.
26
- * @param scene the scene that owns the texture
27
- */
28
- constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
29
- /**
30
- * Gets the max char width of a font.
31
- * @param font the font to use, use the W3C CSS notation
32
- * @return the max char width
33
- */
34
- private getFontWidth;
35
- /**
36
- * Gets the max char height of a font.
37
- * @param font the font to use, use the W3C CSS notation
38
- * @return the max char height
39
- */
40
- private getFontHeight;
41
- /**
42
- * Clones the current AsciiArtTexture.
43
- * @return the clone of the texture.
44
- */
45
- clone(): AsciiArtFontTexture;
46
- /**
47
- * Parses a json object representing the texture and returns an instance of it.
48
- * @param source the source JSON representation
49
- * @param scene the scene to create the texture for
50
- * @return the parsed texture
51
- */
52
- static Parse(source: any, scene: Scene): AsciiArtFontTexture;
53
- }
54
- /**
55
- * Option available in the Ascii Art Post Process.
56
- */
57
- export interface IAsciiArtPostProcessOptions {
58
- /**
59
- * The font to use following the w3c font definition.
60
- */
61
- font?: string;
62
- /**
63
- * The character set to use in the postprocess.
64
- */
65
- characterSet?: string;
66
- /**
67
- * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
68
- * This number is defined between 0 and 1;
69
- */
70
- mixToTile?: number;
71
- /**
72
- * This defines the amount you want to mix the normal rendering pass in the ascii art.
73
- * This number is defined between 0 and 1;
74
- */
75
- mixToNormal?: number;
76
- }
77
- /**
78
- * AsciiArtPostProcess helps rendering everithing in Ascii Art.
79
- *
80
- * Simmply add it to your scene and let the nerd that lives in you have fun.
81
- * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
82
- */
83
- export declare class AsciiArtPostProcess extends PostProcess {
84
- /**
85
- * The font texture used to render the char in the post process.
86
- */
87
- private _asciiArtFontTexture;
88
- /**
89
- * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
90
- * This number is defined between 0 and 1;
91
- */
92
- mixToTile: number;
93
- /**
94
- * This defines the amount you want to mix the normal rendering pass in the ascii art.
95
- * This number is defined between 0 and 1;
96
- */
97
- mixToNormal: number;
98
- /**
99
- * Instantiates a new Ascii Art Post Process.
100
- * @param name the name to give to the postprocess
101
- * @camera the camera to apply the post process to.
102
- * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
103
- */
104
- constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions);
105
- }
1
+ import type { Nullable } from "@babylonjs/core/types.js";
2
+ import type { Camera } from "@babylonjs/core/Cameras/camera.js";
3
+ import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
4
+ import { PostProcess } from "@babylonjs/core/PostProcesses/postProcess.js";
5
+ import type { Scene } from "@babylonjs/core/scene.js";
6
+ import "@babylonjs/core/Engines/Extensions/engine.dynamicTexture.js";
7
+ import "./asciiart.fragment";
8
+ /**
9
+ * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
10
+ *
11
+ * It basically takes care rendering the font front the given font size to a texture.
12
+ * This is used later on in the postprocess.
13
+ */
14
+ export declare class AsciiArtFontTexture extends BaseTexture {
15
+ private _font;
16
+ private _text;
17
+ private _charSize;
18
+ /**
19
+ * Gets the size of one char in the texture (each char fits in size * size space in the texture).
20
+ */
21
+ get charSize(): number;
22
+ /**
23
+ * Create a new instance of the Ascii Art FontTexture class
24
+ * @param name the name of the texture
25
+ * @param font the font to use, use the W3C CSS notation
26
+ * @param text the caracter set to use in the rendering.
27
+ * @param scene the scene that owns the texture
28
+ */
29
+ constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
30
+ /**
31
+ * Gets the max char width of a font.
32
+ * @param font the font to use, use the W3C CSS notation
33
+ * @return the max char width
34
+ */
35
+ private _getFontWidth;
36
+ /**
37
+ * Gets the max char height of a font.
38
+ * @param font the font to use, use the W3C CSS notation
39
+ * @return the max char height
40
+ */
41
+ private _getFontHeight;
42
+ /**
43
+ * Clones the current AsciiArtTexture.
44
+ * @return the clone of the texture.
45
+ */
46
+ clone(): AsciiArtFontTexture;
47
+ /**
48
+ * Parses a json object representing the texture and returns an instance of it.
49
+ * @param source the source JSON representation
50
+ * @param scene the scene to create the texture for
51
+ * @return the parsed texture
52
+ */
53
+ static Parse(source: any, scene: Scene): AsciiArtFontTexture;
54
+ }
55
+ /**
56
+ * Option available in the Ascii Art Post Process.
57
+ */
58
+ export interface IAsciiArtPostProcessOptions {
59
+ /**
60
+ * The font to use following the w3c font definition.
61
+ */
62
+ font?: string;
63
+ /**
64
+ * The character set to use in the postprocess.
65
+ */
66
+ characterSet?: string;
67
+ /**
68
+ * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
69
+ * This number is defined between 0 and 1;
70
+ */
71
+ mixToTile?: number;
72
+ /**
73
+ * This defines the amount you want to mix the normal rendering pass in the ascii art.
74
+ * This number is defined between 0 and 1;
75
+ */
76
+ mixToNormal?: number;
77
+ }
78
+ /**
79
+ * AsciiArtPostProcess helps rendering everithing in Ascii Art.
80
+ *
81
+ * Simmply add it to your scene and let the nerd that lives in you have fun.
82
+ * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
83
+ */
84
+ export declare class AsciiArtPostProcess extends PostProcess {
85
+ /**
86
+ * The font texture used to render the char in the post process.
87
+ */
88
+ private _asciiArtFontTexture;
89
+ /**
90
+ * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
91
+ * This number is defined between 0 and 1;
92
+ */
93
+ mixToTile: number;
94
+ /**
95
+ * This defines the amount you want to mix the normal rendering pass in the ascii art.
96
+ * This number is defined between 0 and 1;
97
+ */
98
+ mixToNormal: number;
99
+ /**
100
+ * Instantiates a new Ascii Art Post Process.
101
+ * @param name the name to give to the postprocess
102
+ * @camera the camera to apply the post process to.
103
+ * @param camera
104
+ * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
105
+ */
106
+ constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions);
107
+ }