mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Inline and added create methods
This commit is contained in:
parent
ceb466748a
commit
e2dbbcdbb0
1 changed files with 17 additions and 1 deletions
|
@ -115,7 +115,7 @@ var DOMElement = new Class({
|
||||||
this.node = target;
|
this.node = target;
|
||||||
|
|
||||||
target.style.zIndex = '0';
|
target.style.zIndex = '0';
|
||||||
target.style.display = 'block';
|
target.style.display = 'inline';
|
||||||
target.style.position = 'absolute';
|
target.style.position = 'absolute';
|
||||||
|
|
||||||
if (this.parent)
|
if (this.parent)
|
||||||
|
@ -130,6 +130,22 @@ var DOMElement = new Class({
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
createFromCache: function (key, elementType)
|
||||||
|
{
|
||||||
|
return this.createFromHTML(this.scene.sys.cache.text.get(key), elementType);
|
||||||
|
},
|
||||||
|
|
||||||
|
createFromHTML: function (html, elementType)
|
||||||
|
{
|
||||||
|
if (elementType === undefined) { elementType = 'div'; }
|
||||||
|
|
||||||
|
var element = document.createElement(elementType);
|
||||||
|
|
||||||
|
element.innerHTML = html;
|
||||||
|
|
||||||
|
return this.setElement(element);
|
||||||
|
},
|
||||||
|
|
||||||
setText: function (text)
|
setText: function (text)
|
||||||
{
|
{
|
||||||
if (this.node)
|
if (this.node)
|
||||||
|
|
Loading…
Reference in a new issue