MX.Text = MX.Object3D.extend({ init: function (ops) { this.type = "Text" this.type = "Image" this.media = ops.media this.width = 0 this.height = 0 this.x = ops.x || 0 this.y = ops.y || 0 this.z = ops.z || 0 this.scale = ops.scale || 1 this.backface = ops.backface || false this.scale = ops.scale || 1 this.width = ops.media.width this.height = ops.media.height this.x = ops.x || 0 this.y = ops.y || 0 this.z = ops.z || 0 this.rotationX = ops.rotationX || 0 this.rotationY = ops.rotationY || 0 this.rotationZ = ops.rotationZ || 0 ops.className && this.el.classList.add(ops.className) this.backface && this.el.classList.add("backface-visible") this.el.classList.add("mx-text") this.el.classList.add("mx-scenery") this.inner = document.createElement("div") this.inner.classList.add("inner") this.el.appendChild(this.inner) this.load(ops) }, load: function(ops){ if (ops.color) this.el.style.color = ops.color; if (ops.fontFamily) this.el.style.fontFamily = "'" + ops.fontFamily + "',sans-serif"; if (ops.fontSize) this.el.style.fontSize = ops.fontSize + "px"; this.inner.innerHTML = marked( ops.media.description || "" ) }, setText: function(text){ this.inner.innerHTML = marked( text || "" ) }, })