Spawning a 9-patch at the beginning of the layout

0 favourites
  • 5 posts
  • Howdy. Question(s) for ya.

    So I'm looking to create the HUD on the start of a layout.

    It consists of several 9-patches and sprites.

    However, it appears that several of the attributes are lost when creating the object from thin air at the beginning of the layout, including the 9 patch attributes such as margin, whether or not it tiles, and the position of the origin.

    I understand that I can still spawn the item with the correct attributes as long as there is an object of the same type within the layout, but I'd much prefer for there not to be such an object in the layout and instead create the HUD entirely from spawning it at the beginning of the layout.

    So, my question is; is there a workaround for this? Am I missing some obvious feature?

    Thanks!

  • I understand that I can still spawn the item with the correct attributes as long as there is an object of the same type within the layout

    It doesn't need to be on the same layout. A common approach is to create a new unused layout like "Assets" or "ObjectRepository" and place default instances of objects there.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Follow up question, still regarding 9-patches.

    So, it seems regardless of where the origin is, the middle tile always "grows" from the left.

    I was able to get it to grow from the right before, but quite frankly, I cannot replicate it.

    Any ideas? I understand this is super vague but I'd be happy to clarify with pictures.

  • Maybe you could rotate the whole object 180 degrees, then it will grow from the right.

  • Yeah I figured as much and it's definitely a solution but it's more an idle curiosity at this point, and it'd be a bit more efficient otherwise.

    I know it is possible, considering I have done it before, I just lost that and and about an hour of work because the editor froze and I didn't save

    Also, thanks for the answer to the initial question. That's really helpful.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)