Properties
Protected horizontalFlip
horizontalFlip: boolean = false
Protected horizontalTiles
horizontalTiles: number = 1
keepAspectRatio
keepAspectRatio: boolean = true
Protected shema
shema: object
streamTexture
streamTexture: any = null
Protected verticalFlip
verticalFlip: boolean = false
Protected verticalTiles
verticalTiles: number = 1
Class SpriteTextureComponent extends TextureComponent and override main method drawComponent. We need to keep tiles system working! Objective: Store and manipulate with image texture data. Render element - Tile, flip void ctx.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight); JavaScript syntax: context.drawImage(img,sx,sy,swidth,sheight,x,y,width,height); Parameter Values Parameter Description Play it img Specifies the image, canvas, or video element to use sx Optional. The x coordinate where to start clipping sy Optional. The y coordinate where to start clipping swidth Optional. The width of the clipped image sheight Optional. The height of the clipped image x The x coordinate where to place the image on the canvas y The y coordinate where to place the image on the canvas width Optional. The width of the image to use (stretch or reduce the image) height Optional. The height of the image to use (stretch or reduce the image)