How do I correctly set 9-patch x, y?

0 favourites
  • 7 posts
From the Asset Store
The collection includes pre-categorized selections that can be the definitive tone setting backdrop to gameplay.
  • http://imgur.com/a/6hEtf

    I got a bit of a problem I'm not sure how is even happening. I've got a bar that moves to a position on the title screen to select what option you want to do: New game, Load, Save etc. It works all fine. It's a regular old sprite. But then I realized when you select options I want to adjust the size of the bar to border new options that pop-up. that's all nice. But the sprite looks kinda ugly stretched so I changed it to a 9-patch instead. Little did I know that it wouldn't work anymore.

    In the picture you can see the Y is set to the "title_"s which worked fine before but now my 9patch appears in new places.

    All of the ys are meant to be: 325, 360, 395, 430, 465, 500 (corresponding to the "title_" text objects)

    But are instead the Y is being set to: 77.5, 81, 84.5, 88, 91.5, 95.

    The weird part is in the de-bugger the Y's of all my text objects are correct (325, 360, etc) Yet it's setting the Y to (77.5, 81, 84.5, etc)

    I thought that initially the hot-spot for my 9-patch was wrong to then realize it doesn't have one. I see a correlation of 3.5 when it's meant to be 35 between all the Ys, but I don't get where the values are being pulled from? I have no other objects with that Y value,

    I even changed out "title_newgame.Y" to 325 but it still wants to be set at 77.5?

    Thanks, Conra

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Did you try changing the 9-patch hot spot in the object properties menu?

  • Still sets to: 77.5, 81, 84.5, 88, 91, 95.

  • The problem is where the actual sprite is positioned, it's the actual x,y of the 9-patch itself, my menu is at the lower half of the screen, where as the 9-patch is setting it's y value to overlap the title screen icon itself

  • It's hard to tell what it could be without the capx. Have you tried sizing the 9patch based on the menus bboxtop, boboxleft etc

  • It was a mistake on my part, in my previous object I had "set position" when I changed to my new 9-patch I had selected set y without realizing, so 50 was meant to be my X not my starting position for the y value since lerp requires (first position, seconds position, duration)

  • Cool. I'm glad you got it figured out.

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