- Joined
- Mar 28, 2016
- Messages
- 1,623
- Reaction score
- 1,439
- First Language
- French
- Primarily Uses
- RMMV
hi
What are your advices or tricks for new parent assignment to a Sprites and the opportunity to return to the original parent.
example:
to change parent i do this
For the moment I do as like this for keep the original parent sprites.
But I am not sure of the validity of this procedure.
so when delete picture
Is there a way to go back (set Back) to the original parent, without making a total copy, for performance reasons?
Or can you confirm that this is the right ways to do?
thanks in advance for your suggestions
What are your advices or tricks for new parent assignment to a Sprites and the opportunity to return to the original parent.
example:
to change parent i do this
PHP:
Game_Picture.prototype.spine = function(id){
var newParent = SceneManager._scene._spriteset._pictureContainer.children[id-1];
var targetSprite= SceneManager._scene._spriteset._pictureContainer.children[this._PID-1];
targetSprite.parent=newParent;
return this
};
But I am not sure of the validity of this procedure.
PHP:
Game_Picture.prototype.spine = function(id){
var newParent = SceneManager._scene._spriteset._pictureContainer.children[id-1];
var targetSprite= SceneManager._scene._spriteset._pictureContainer.children[this._PID-1];
targetSprite.originalParent = targetSprite.parent; // store Original parent in originalParent , for comeBack if need !
targetSprite.parent=newParent;
return this
};
PHP:
Game_Screen.prototype.erasePicture = function(pId) {
this._pictures[pId] = undefined;
var pictureChild = SceneManager._scene._spriteset._pictureContainer.children[pId-1];
if(pictureChild.originalParent){// reset to original parent // TODO: check other way if possible
pictureChild.parent = pictureChild.originalParent;
}
};
Or can you confirm that this is the right ways to do?
thanks in advance for your suggestions
Last edited:


