# SVGSkin

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

Create a new SVG skin.

##### Parameters:

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

### Extends

- Skin

### Members

#### _id :int

Inherited From:
  - Skin#_id

##### Type:

- int

#### _renderer :RenderWebGL

##### Type:

- RenderWebGL

#### _rotationCenter :Vec3

Inherited From:
  - Skin#_rotationCenter

##### Type:

- Vec3

#### _svgRenderer :SvgRenderer

##### Type:

- SvgRenderer

#### _texture :WebGLTexture

##### Type:

- WebGLTexture

#### (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

#### 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, *>

#### setRotationCenter(x, y)

Overrides:
  - 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.

#### setSVG(svgData, rotationCenteropt)

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

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`svgData` | string |  | new SVG to use.
`rotationCenter` | Array.<number> | <optional> | Optional rotation center for the SVG. If not supplied, it will be calculated from the bounding box

##### Fires:

- Skin.event:WasAltered