var Class = require('../utils/Class'); var Components = require('./components'); var GameObject = new Class({ initialize: function GameObject(state, type){ this.state = state; this.type = type; this.name = ''; this.active = true ; this.tabIndex = -1; this.parent; this.renderMask = 15; this.renderFlags = 15; this.state.sys.sortChildrenFlag = true ; } , setActive: function (value){ this.active = value; return this; } , toJSON: function (){ return Components.ToJSON(this); } , destroy: function (){ this.parent.remove(this); this.state = undefined; } } ); module.exports = GameObject;