I'm having trouble positioning a Sprite_Character. It seems unaffected by the x and y values, and also doesn't position itself at 0, 0 like you would expect. I originally tried to position the sprite in the middle of a window, but after no luck with that, I tried to isolate the issue. I removed the window entirely and added the Sprite_Character to the scene, same issue. I tried using Sprite which does not have the issue (of course, it will display the entire character sheet, which isn't desirable).
Does anyone know why this is? Am I missing something important that will make the sprite position correctly?
This is the entire code used for the plugin. I call the scene from an event. No other plugins added or modifications made.
Does anyone know why this is? Am I missing something important that will make the sprite position correctly?
This is the entire code used for the plugin. I call the scene from an event. No other plugins added or modifications made.
JavaScript:
class Game_FauxPlayer extends Game_Player {
constructor() {
super(...arguments);
}
initialize(actorData) {
super.initialize();
this.setActorData(actorData);
}
setActorData(actorData) {
this._actorData = actorData;
this.refresh();
}
refresh() {
let actor = this._actorData;
let characterName = actor ? actor.characterName() : "";
let characterIndex = actor ? actor.characterIndex() : 0;
this.setImage(characterName, characterIndex);
this._followers.refresh();
}
}
class Scene_Evolution extends Scene_MenuBase {
constructor () {
super(...arguments);
}
create() {
this.createWindowLayer();
this.createActor();
}
createActor() {
this._fauxActorData = $gameActors.actor($gameParty._actors[1]);
this._fauxActor = new Game_FauxPlayer(this._fauxActorData);
this.addChild(new Sprite_Character(this._fauxActor));
}
}