# BitmapSkin

#### new BitmapSkin(idnon-null, renderernon-null)

Create a new Bitmap Skin.

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | int | The ID for this Skin.
`renderer` | RenderWebGL | The renderer which will use this skin.

### Extends

- Skin

### Members

#### (non-null) _costumeResolution :int

##### Type:

- int

#### _id :int

Inherited From:
  - Skin#_id

##### Type:

- int

#### (non-null) _renderer :RenderWebGL

##### Type:

- RenderWebGL

#### _rotationCenter :Vec3

Inherited From:
  - Skin#_rotationCenter

##### Type:

- Vec3

#### _texture :WebGLTexture

##### Type:

- WebGLTexture

#### _textureSize :Array.<int>

##### Type:

- Array.<int>

#### (private) _uniforms :Object.<string, *>

Inherited From:
  - Skin#_uniforms

The uniforms to be used by the vertex and pixel shaders. Some of these are used by other parts of the renderer as well.

##### Type:

- Object.<string, *>

#### id

Inherited From:
  - Skin#id

#### rotationCenter

Inherited From:
  - Skin#rotationCenter

#### size

Overrides:
  - Skin#size

### Methods

#### (private, static) _getBitmapSize(bitmapData) → {Array.<int>}

##### Parameters:

Name | Type | Description
--- | --- | ---
`bitmapData` | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | bitmap data to inspect.

##### Returns:

the width and height of the bitmap data, in pixels.

Type
  Array.<int>

#### calculateRotationCenter() → {Array.<number>}

Inherited From:
  - Skin#calculateRotationCenter

Get the center of the current bounding box

##### Returns:

the center of the current bounding box

Type
  Array.<number>

#### dispose()

Overrides:
  - Skin#dispose

Dispose of this object. Do not use it after calling this method.

#### getTexture(scale) → {WebGLTexture}

Overrides:
  - Skin#getTexture

##### Parameters:

Name | Type | Description
--- | --- | ---
`scale` | Array.<number> | The scaling factors to be used.

##### Returns:

The GL texture representation of this skin when drawing at the given scale.

Type
  WebGLTexture

#### getUniforms(scale) → {object.<string, *>}

Inherited From:
  - Skin#getUniforms

Update and returns the uniforms for this skin.

##### Parameters:

Name | Type | Description
--- | --- | ---
`scale` | Array.<number> | The scaling factors to be used.

##### Returns:

the shader uniforms to be used when rendering with this Skin.

Type
  object.<string, *>

#### setBitmap(bitmapData, costumeResolutionopt, rotationCenteropt)

Set the contents of this skin to a snapshot of the provided bitmap data.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`bitmapData` | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement |  |  | new contents for this skin.
`costumeResolution` | int | <optional> | `1` | The resolution to use for this bitmap.
`rotationCenter` | Array.<number> | <optional> |  | Optional rotation center for the bitmap. If not supplied, it will be calculated from the bounding box

##### Fires:

- Skin.event:WasAltered

#### setRotationCenter(x, y)

Inherited From:
  - Skin#setRotationCenter

Set the origin, in object space, about which this Skin should rotate.

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | number | The x coordinate of the new rotation center.
`y` | number | The y coordinate of the new rotation center.

##### Fires:

- Skin.event:WasAltered