- 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
import { settings } from '@pixi/settings';
let saidHello = false;
const VERSION = '$_VERSION';
/**
* Skips the hello message of renderers that are created after this is run.
* @function skipHello
* @memberof PIXI.utils
*/
export function skipHello(): void
{
saidHello = true;
}
/**
* Logs out the version and renderer information for this running instance of PIXI.
* If you don't want to see this message you can run `PIXI.utils.skipHello()` before
* creating your renderer. Keep in mind that doing that will forever make you a jerk face.
* @static
* @function sayHello
* @memberof PIXI.utils
* @param {string} type - The string renderer type to log.
*/
export function sayHello(type: string): void
{
if (saidHello)
{
return;
}
if (settings.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf('chrome') > -1)
{
const args = [
`\n %c %c %c PixiJS ${VERSION} - ✰ ${type} ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n`,
'background: #ff66a5; padding:5px 0;',
'background: #ff66a5; padding:5px 0;',
'color: #ff66a5; background: #030307; padding:5px 0;',
'background: #ff66a5; padding:5px 0;',
'background: #ffc3dc; padding:5px 0;',
'background: #ff66a5; padding:5px 0;',
'color: #ff2424; background: #fff; padding:5px 0;',
'color: #ff2424; background: #fff; padding:5px 0;',
'color: #ff2424; background: #fff; padding:5px 0;',
];
globalThis.console.log(...args);
}
else if (globalThis.console)
{
globalThis.console.log(`PixiJS ${VERSION} - ${type} - http://www.pixijs.com/`);
}
saidHello = true;
}