dat.gui/controller.js

23 lines
660 B
JavaScript
Raw Normal View History

var Controller = function() {
2011-01-24 02:59:29 +00:00
this.setName = function(n) {
2011-01-24 02:59:29 +00:00
this.propertyNameElement.innerHTML = n;
}
this.setValue = function(n) {
this.object[this.propertyName] = n;
}
2011-01-24 00:15:04 +00:00
this.domElement = document.createElement('div');
2011-01-24 02:59:29 +00:00
this.domElement.setAttribute('class', 'guidat-controller ' + this.type);
2011-01-24 00:50:14 +00:00
this.object = arguments[0];
this.propertyName = arguments[1];
2011-01-24 00:50:14 +00:00
this.propertyNameElement = document.createElement('span');
this.propertyNameElement.setAttribute('class', 'guidat-propertyname');
this.setName(this.propertyName);
2011-01-24 00:50:14 +00:00
this.domElement.appendChild(this.propertyNameElement);
2011-01-24 02:59:29 +00:00
};