Constructor
new CanvasObjectContainer(divID, width, height, rootCanvasObjectContaineropt, floorColorStringopt)
Name | Type | Attributes | Description |
---|---|---|---|
divID |
String | the id attribute value of the HTML div element. |
|
width |
Number | the width of the div. |
|
height |
Number | the height of the div. |
|
rootCanvasObjectContainer |
CanvasObjectContainer |
<optional> |
optional CanvasObjectContainer that should contain this one. |
floorColorString |
String |
<optional> |
the color for the floor CanvasObject of this CanvasObjectContainer, if no floor color is passed a floor CanvasObject is not created. |
Members
constructor
div
The html div that this Class is referencing.
floor
An optional floor CanvasObject that is the bottom child of this class. If no floorColorString is passed during construction a floor CanvasObject is not created.
Methods
addChild(child, x, y) → {HTMLDivElement|CanvasObject}
Adds a html div element or CanvasObject to this CanvasObjectContainer.
Name | Type | Description |
---|---|---|
child |
HTMLDivElement | CanvasObject | |
x |
Number | |
y |
Number |
- Type
- HTMLDivElement | CanvasObject
addChildAt(child, index, x, y) → {HTMLDivElement|CanvasObject}
Ads a HTML div element or CanvasObject to this CanvasObjectContainer at the index and x y location given.
Name | Type | Description |
---|---|---|
child |
HTMLDivElement | CanvasObject | |
index |
Number | the index the child should have in the CanvasObjectContainer lower indexes are beneath other children. |
x |
Number | |
y |
Number |
- Type
- HTMLDivElement | CanvasObject
contains(child) → {Boolean}
Returns true if the CanvasObjectContainer contains the given child.
Name | Type | Description |
---|---|---|
child |
HTMLDivElement | CanvasObject |
- Type
- Boolean
getChildAt(index) → {HTMLDivElement|CanvasObject}
Gets the child that is at the given index.
Name | Type | Description |
---|---|---|
index |
Number |
- Type
- HTMLDivElement | CanvasObject
getChildIndex(child) → {Number}
Returns the index of the child in this CanvasObjectContainer. Call contains to check if the child is a child of this CanvasObjectContainer.
Name | Type | Description |
---|---|---|
child |
HTMLDivElement | CanvasObject |
- Type
- Number
getHeight() → {Number}
Returns the set height of this CanvasObjectContainer.
- Type
- Number
getNumChildren() → {Number}
Returns the number of children that this CanvasObjectContainer has.
- Type
- Number
getWidth() → {Number}
Returns the width of this CanvasObjectContainer
- Type
- Number
init(divID, width, height, rootCanvasObjectContaineropt, floorColorStringopt)
Acts like a super method for inheriting Classes.
Name | Type | Attributes | Description |
---|---|---|---|
divID |
String | the id attribute value of the HTML div element. |
|
width |
Number | the width of the div. |
|
height |
Number | the height of the div. |
|
rootCanvasObjectContainer |
CanvasObjectContainer |
<optional> |
optional CanvasObjectContainer that should contain this one. |
floorColorString |
String |
<optional> |
the color for the floor CanvasObject of this CanvasObjectContainer, if no floor color is passed a floor CanvasObject is not created. |
removeChild(child) → {HTMLDivElement|CanvasObject}
Removes a child from this CanvasObjectContainer.
Name | Type | Description |
---|---|---|
child |
HTMLDivElement | CanvasObject |
- Type
- HTMLDivElement | CanvasObject
setChildIndex(child, index, x, y)
Sets the index of the child to the index given.
Name | Type | Description |
---|---|---|
child |
HTMLDivElement | CanvasObject | |
index |
Number | |
x |
Number | |
y |
Number |