Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created July 9, 2017 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goofmint/aadb4b166dbb24d1dbe60e4db7331c6b to your computer and use it in GitHub Desktop.
Save goofmint/aadb4b166dbb24d1dbe60e4db7331c6b to your computer and use it in GitHub Desktop.
var HelloClass = h5.cls.RootClass.extend(function (super_) {
return {
// クラス名(完全修飾名)
name: 'HelloClass',
// クラスのフィールド定義
field: {
_name: null,
_scale: {
defaultValue: 0
},
_read: {
defaultValue: "This is read only"
}
},
accessor: {
accessible: null,
scale: {
get: function() {
return this._scale;
},
set: function(val) {
this._scale = val * 100;
}
},
read: {
get: function() {
return this._read;
}
}
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment