The padding class stores one number for each of four directions, thus describing the padding around a 2D object.

### Hierarchy

- EventDispatcher
  - Padding

## Index

### Constructors

- constructor

### Properties

- bottom
- left
- right
- top

### Methods

- addEventListener
- clone
- copyFrom
- dispatchEvent
- dispatchEventWith
- get_bottom
- get_left
- get_right
- get_top
- hasEventListener
- removeEventListener
- removeEventListeners
- setTo
- setToSymmetric
- setToUniform
- set_bottom
- set_left
- set_right
- set_top

## Constructors

### constructor

- new Padding(left?: number, right?: number, top?: number, bottom?: number): Padding

- Overrides EventDispatcher.constructor

  - Defined in lib/starling/utils/Padding.d.ts:11

  Creates a new instance with the given properties.

  #### Parameters

  - ##### Optional left: number

  - ##### Optional right: number

  - ##### Optional top: number

  - ##### Optional bottom: number

  #### Returns Padding

## Properties

### bottom

bottom: number

- Defined in lib/starling/utils/Padding.d.ts:47

The padding towards the bottom.

### left

left: number

- Defined in lib/starling/utils/Padding.d.ts:32

The padding on the left side.

### right

right: number

- Defined in lib/starling/utils/Padding.d.ts:37

The padding on the right side.

### top

top: number

- Defined in lib/starling/utils/Padding.d.ts:42

The padding towards the top.

## Methods

### addEventListener

- addEventListener(type: string, listener: Function): void

- Inherited from EventDispatcher.addEventListener

  - Defined in lib/starling/events/EventDispatcher.d.ts:32

  Registers an event listener at a certain object.

  #### Parameters

  - ##### type: string

  - ##### listener: Function

  #### Returns void

### clone

- clone(): Padding

- - Defined in lib/starling/utils/Padding.d.ts:29

  Creates a new instance with the exact same values.

  #### Returns Padding

### copyFrom

- copyFrom(padding: Padding): void

- - Defined in lib/starling/utils/Padding.d.ts:26

  Copies all properties from another Padding instance. Pass `null` to reset all values to zero.

  #### Parameters

  - ##### padding: Padding

  #### Returns void

### dispatchEvent

- dispatchEvent(event: Event): void

- Inherited from EventDispatcher.dispatchEvent

  - Defined in lib/starling/events/EventDispatcher.d.ts:45

  Dispatches an event to all objects that have registered listeners for its type. If an event with enabled 'bubble' property is dispatched to a display object, it will travel up along the line of parents, until it either hits the root object or someone stops its propagation manually.

  #### Parameters

  - ##### event: Event

  #### Returns void

### dispatchEventWith

- dispatchEventWith(type: string, bubbles?: boolean, data?: any): void

- Inherited from EventDispatcher.dispatchEventWith

  - Defined in lib/starling/events/EventDispatcher.d.ts:50

  Dispatches an event with the given parameters to all objects that have registered listeners for the given type. The method uses an internal pool of event objects to avoid allocations.

  #### Parameters

  - ##### type: string

  - ##### Optional bubbles: boolean

  - ##### Optional data: any

  #### Returns void

### Protected get_bottom

- get_bottom(): number

- - Defined in lib/starling/utils/Padding.d.ts:48

  #### Returns number

### Protected get_left

- get_left(): number

- - Defined in lib/starling/utils/Padding.d.ts:33

  #### Returns number

### Protected get_right

- get_right(): number

- - Defined in lib/starling/utils/Padding.d.ts:38

  #### Returns number

### Protected get_top

- get_top(): number

- - Defined in lib/starling/utils/Padding.d.ts:43

  #### Returns number

### hasEventListener

- hasEventListener(type: string, listener?: any): boolean

- Inherited from EventDispatcher.hasEventListener

  - Defined in lib/starling/events/EventDispatcher.d.ts:55

  If called with one argument, figures out if there are any listeners registered for the given event type. If called with two arguments, also determines if a specific listener is registered.

  #### Parameters

  - ##### type: string

  - ##### Optional listener: any

  #### Returns boolean

### removeEventListener

- removeEventListener(type: string, listener: Function): void

- Inherited from EventDispatcher.removeEventListener

  - Defined in lib/starling/events/EventDispatcher.d.ts:35

  Removes an event listener from the object.

  #### Parameters

  - ##### type: string

  - ##### listener: Function

  #### Returns void

### removeEventListeners

- removeEventListeners(type?: string): void

- Inherited from EventDispatcher.removeEventListeners

  - Defined in lib/starling/events/EventDispatcher.d.ts:39

  Removes all event listeners with a certain type, or all of them if type is null. Be careful when removing all event listeners: you never know who else was listening.

  #### Parameters

  - ##### Optional type: string

  #### Returns void

### setTo

- setTo(left?: number, right?: number, top?: number, bottom?: number): void

- - Defined in lib/starling/utils/Padding.d.ts:16

  Sets all four values at once.

  #### Parameters

  - ##### Optional left: number

  - ##### Optional right: number

  - ##### Optional top: number

  - ##### Optional bottom: number

  #### Returns void

### setToSymmetric

- setToSymmetric(horizontal: number, vertical: number): void

- - Defined in lib/starling/utils/Padding.d.ts:22

  Sets left and right to `horizontal`, top and bottom to `vertical`.

  #### Parameters

  - ##### horizontal: number

  - ##### vertical: number

  #### Returns void

### setToUniform

- setToUniform(value: number): void

- - Defined in lib/starling/utils/Padding.d.ts:19

  Sets all four sides to the same value.

  #### Parameters

  - ##### value: number

  #### Returns void

### Protected set_bottom

- set_bottom(value: number): number

- - Defined in lib/starling/utils/Padding.d.ts:49

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_left

- set_left(value: number): number

- - Defined in lib/starling/utils/Padding.d.ts:34

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_right

- set_right(value: number): number

- - Defined in lib/starling/utils/Padding.d.ts:39

  #### Parameters

  - ##### value: number

  #### Returns number

### Protected set_top

- set_top(value: number): number

- - Defined in lib/starling/utils/Padding.d.ts:44

  #### Parameters

  - ##### value: number

  #### Returns number

Generated using TypeDoc