1. Dismiss Notice
  2. Within our Resources section we have over 150 Audio files, with room to grow. You may find exactly what you have been looking for. Just CLICK HERE to start your listening adventure.
    Dismiss Notice
  3. Why would you want to upload your resources directly to RMMV.co? It makes it easier for other members to download them. Click HERE for more information.
    Dismiss Notice
  4. Click HERE to see our four new featured resources by TheUnproPro, Starbird, iblamevictoria, and VGM MarkH.
    Dismiss Notice
  5. Here are the The Resource Rules.
    Dismiss Notice
  6. Please read these RULES before posting.
    Dismiss Notice

Need Help: Actor Sprite Location in Battle?

Discussion in 'Javascript Support' started by CT_Bolt, Jan 9, 2019.

  1. #1 CT_Bolt, Jan 9, 2019
    Last edited: Jan 9, 2019
    I could use a bit of help on this one...

    Anyone know how to check X & Y position of the Actor Sprites in that are in battle?

    So far I've got this:

    Code (Javascript):

    BattleManager._spriteset._actorSprites["0"]._homeX
    BattleManager._spriteset._actorSprites["0"]._homeY
     
    Which are found using the properties of the Sprite_Actor Object [Click Here to View Details]

    upload_2019-1-9_12-19-52.png
    upload_2019-1-9_12-25-34.png

    Which is close but not quite... I'm guessing it's something to do with the Offset or Anchor of the sprites?

    Update:
    Using this...
    upload_2019-1-9_14-25-24.png
    Gives me this...
    upload_2019-1-9_14-27-13.png

    Thanks for reading.(cute)
     
  2. I'm pretty sure you're looking for setActorHome in the Sprite_Actor class, which simply uses setHome in the same class but because setActorHome is called somewhere during battle setup it will overwrite your changes, so you will need to directly change this method to suit your needs.

    Code (Javascript):
    Sprite_Actor.prototype.setActorHome = function(index) {
        this.setHome(600 + index * 32, 280 + index * 48);
    };
     
    • Informative Informative x 1
    • List

Share This Page

Loading...