Sprite OX/OY in RMMV

Discussion in 'Javascript/Plugin Support' started by Zalerinian, Oct 23, 2015.

  1. Zalerinian

    Zalerinian Jack of all Errors Veteran

    Messages:
    4,695
    Likes Received:
    923
    Location:
    The Internet.
    First Language:
    English
    Primarily Uses:
    N/A
    Sprite Anchor
    [SIZE=14.6667px]With the new sprite type, courtesy of Pixi.js, there is a property used in several locations referring to ‘this.anchor.x’ and ‘this.anchor.y’. Anchor is the origin of the sprite. Therefore, when you used .ox and .oy for a sprite in Ace and below, you would now use .achor.x and .anchor.y.[/SIZE]

    [SIZE=14.6667px]An important notice! The anchor.x and anchor.y values are percents. 0.5 means half way through the sprite. To get a percent from the pixel value you want, you'll need to do something like:[/SIZE]

    Code:
    this.anchor.x = (PointYouWant / this.width)
     
    #1
    Kaelan and nio kasgami like this.
  2. DarknessFalls

    DarknessFalls Rpg Maker Jesus - JS Dev. Veteran

    Messages:
    1,393
    Likes Received:
    209
    First Language:
    English
    thanks for the info that had me stuck for a moment.
     
    #2
    Zalerinian likes this.
  3. Zalerinian

    Zalerinian Jack of all Errors Veteran

    Messages:
    4,695
    Likes Received:
    923
    Location:
    The Internet.
    First Language:
    English
    Primarily Uses:
    N/A
    Yeah, at first I was confused about a lot of differences, but after having it for about a month I figured a lot of it out. I'm trying to post as much as I can and make sure threads aren't filled with false information. Need to make sure MV is one of the best RMs ever. No hidden classes, and script compatibility everywhere!
     
    #3

Share This Page