Modding Help How can I tell where an item will be anchored?

Discussion in 'Starbound Modding' started by The Observer, Oct 28, 2014.

  1. The Observer

    The Observer Phantasmal Quasar

    What it says on the tin. I've started dabbling with dungeons, and everything seems to be going fine, but I'd like to know how to properly anchor objects on the objects layer. How do I know where on an object the corresponding anchoring tile will be to place the pixel? On a 2x3 object? On a 2x2 object? The keys provided are quite unhelpful, as they appear to be all over the place.
     
  2. The Orientations key.
    Code:
     "orientations" : [
        {
          "leftImage" : "cFarm.png:default",
          "rightImage" : "cFarm.png:default",
    
          "imagePosition" : [-16, 0],
          "frames" : 1,
          "animationCycle" : 0.5,
    
          "spaceScan" : 0.1,
          "anchors" : [ "bottom" ]
    
        }
      ],
    Not sure how that "isn't helpful" as it tells you that the anchor is on the bottom. How clearer can it get?
     
  3. The Observer

    The Observer Phantasmal Quasar

    What I meant is, let's say I have a 2x3 object like so:

    XXX
    XXX

    How do I know which tile it is anchored to? Is it

    XXX XXX XXX
    OXX XOX XXO

    ?

    Since I am to place one pixel to represent the whole object, that it's anchored on the bottom doesn't really tell me which of the three tiles on the bottom the object is going to anchor to when I place down the pixel on the dungeon image.
     
  4. Oh. I get you now. That would be the imagePosition key. Each block is 8 pixels (if i remember correctly). So if the offset is (-16,0) it would be 2 blocks to the right from the bottom left of the image. The origin is always the bottom left of the image. The offset keys will shift the image of the object relative to that point.

    So in your example... the first one wpuld be offsets of (0,0), (-8,0), and (-16,0) repectively.
     
    Last edited: Oct 28, 2014
    The | Suit and The Observer like this.

Share This Page