interface Renderer { _getImageData( sx: number, sy: number, sw: number, sh: number, ): null | ImageData; _putImageData( imageData: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number, ): void; begin(): void; clear(): void; drawImage( surface: Surface, offsetX: number, offsetY: number, width: number, height: number, destOffsetX: number, destOffsetY: number, ): void; drawSprites( surface: Surface, offsetX: number[], offsetY: number[], width: number[], height: number[], canvasOffsetX: number[], canvasOffsetY: number[], count: number, ): void; end(): void; fillRect( x: number, y: number, width: number, height: number, cssColor: string, ): void; isSupportedShaderProgram(): boolean; opacity(opacity: number): void; restore(): void; save(): void; setCompositeOperation(operation: CompositeOperationString): void; setOpacity(opacity: number): void; setShaderProgram(shaderProgram: null | ShaderProgram): void; setTransform(matrix: number[]): void; transform(matrix: number[]): void; translate(x: number, y: number): void;} Methods
_getImageData
- _getImageData(sx: number, sy: number, sw: number, sh: number): null | ImageData
Parameters
- sx: number
- sy: number
- sw: number
- sh: number
_putImageData
- _putImageData(
imageData: ImageData,
dx: number,
dy: number,
dirtyX?: number,
dirtyY?: number,
dirtyWidth?: number,
dirtyHeight?: number,
): void Parameters
- imageData: ImageData
- dx: number
- dy: number
Optional
dirtyX: numberOptional
dirtyY: numberOptional
dirtyWidth: numberOptional
dirtyHeight: number
Returns void
begin
- begin(): void
Returns void
clear
- clear(): void
Returns void
drawImage
- drawImage(
surface: Surface,
offsetX: number,
offsetY: number,
width: number,
height: number,
destOffsetX: number,
destOffsetY: number,
): void Parameters
- surface: Surface
- offsetX: number
- offsetY: number
- width: number
- height: number
- destOffsetX: number
- destOffsetY: number
Returns void
drawSprites
- drawSprites(
surface: Surface,
offsetX: number[],
offsetY: number[],
width: number[],
height: number[],
canvasOffsetX: number[],
canvasOffsetY: number[],
count: number,
): void Parameters
- surface: Surface
- offsetX: number[]
- offsetY: number[]
- width: number[]
- height: number[]
- canvasOffsetX: number[]
- canvasOffsetY: number[]
- count: number
Returns void
end
- end(): void
Returns void
fillRect
- fillRect(
x: number,
y: number,
width: number,
height: number,
cssColor: string,
): void Parameters
- x: number
- y: number
- width: number
- height: number
- cssColor: string
Returns void
isSupportedShaderProgram
- isSupportedShaderProgram(): boolean
Returns boolean
opacity
- opacity(opacity: number): void
Returns void
restore
- restore(): void
Returns void
save
- save(): void
Returns void
setCompositeOperation
- setCompositeOperation(operation: CompositeOperationString): void
Returns void
setOpacity
- setOpacity(opacity: number): void
Returns void
setShaderProgram
- setShaderProgram(shaderProgram: null | ShaderProgram): void
Parameters
- shaderProgram: null | ShaderProgram
Returns void
setTransform
- setTransform(matrix: number[]): void
Returns void
transform
- transform(matrix: number[]): void
Returns void
translate
- translate(x: number, y: number): void
Returns void
ゲームの描画を行うクラス。
描画は各エンティティによって行われる。通常、ゲーム開発者が本クラスを利用する必要はない。