misty
This commit is contained in:
35
sprite.cm
35
sprite.cm
@@ -3,36 +3,6 @@ var film2d = use('film2d')
|
||||
var sprite_proto = {
|
||||
type: 'sprite',
|
||||
|
||||
set_pos: function(x, y) {
|
||||
this.pos.x = x
|
||||
this.pos.y = y
|
||||
return this
|
||||
},
|
||||
|
||||
set_groups: function(groups) {
|
||||
var old_groups = this.groups
|
||||
this.groups = groups
|
||||
film2d.reindex(this._id, old_groups, groups)
|
||||
return this
|
||||
},
|
||||
|
||||
add_group: function(group) {
|
||||
if (this.groups.indexOf(group) < 0) {
|
||||
this.groups.push(group)
|
||||
film2d.index_group(this._id, group)
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
remove_group: function(group) {
|
||||
var idx = this.groups.indexOf(group)
|
||||
if (idx >= 0) {
|
||||
this.groups.splice(idx, 1)
|
||||
film2d.unindex_group(this._id, group)
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
film2d.unregister(this._id)
|
||||
}
|
||||
@@ -44,7 +14,10 @@ return function(props) {
|
||||
pos: {x: 0, y: 0},
|
||||
image: null,
|
||||
width: 1,
|
||||
height: 1,
|
||||
height: null,
|
||||
fit: 'contain',
|
||||
fit_anchor_x: 0.5,
|
||||
fit_anchor_y: 0.5,
|
||||
anchor_x: 0,
|
||||
anchor_y: 0,
|
||||
flip: {x: false, y: false},
|
||||
|
||||
Reference in New Issue
Block a user