mirror of
https://github.com/photonstorm/phaser
synced 2025-01-11 04:38:51 +00:00
36 lines
785 B
TypeScript
36 lines
785 B
TypeScript
|
/// <reference path="../Game.ts" />
|
||
|
/// <reference path="../cameras/Camera.ts" />
|
||
|
/// <reference path="IRenderer.ts" />
|
||
|
|
||
|
module Phaser {
|
||
|
|
||
|
export class HeadlessRenderer implements Phaser.IRenderer {
|
||
|
|
||
|
constructor(game: Game) {
|
||
|
this._game = game;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* The essential reference to the main game object
|
||
|
*/
|
||
|
private _game: Game;
|
||
|
|
||
|
public render() {}
|
||
|
|
||
|
public renderSprite(camera: Camera, sprite: Sprite): bool {
|
||
|
|
||
|
// Render checks (needs inCamera check added)
|
||
|
if (sprite.scale.x == 0 || sprite.scale.y == 0 || sprite.texture.alpha < 0.1)
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
|
||
|
}
|
||
|
|
||
|
// Add Tilemap, ScrollZone, etc?
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|