How: 9-patch menu windows?

0 favourites
  • 5 posts
From the Asset Store
A well commented template with list menus and shops to use in your top-down RPGs or metroidvania games!
  • Objects involved: 9-patch, Sprite, SpriteFont

    What I'm trying to accomplish: 9-patch as the menu holder, able to be moved around (by dragging an on-screen icon around). Sprite has various animation frames, each is a different "skill" icon. SpriteFont will spawn next to the skill icon sprite, and depending on the animation frame (or if I need to specify) what that skill's level currently is.

    Description: I want to make menu windows using the 9-patch plugin, so it can be various windows holding various objects that can be moved about on the screen.

    My first try is a skills menu, and it either needs various pages or a method to scroll up and down while keeping the contents of the menu on itself. The menu needs to be a list consisting of another object.

    MOCKUP:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tend to make mockups of teh menu in illustrator, then import the mockup as a sprite, then I import just the background menu graphic, and each of the icons separately. I add the menu background as a sprite (in your case 9 patch) and then in a throw away layout, I put the Menu in place and use the mockup to decide where to put the image points. Each image point represents where my icons will show up. I align them and get them where I need them. Then whenever I call up my menu, my logic simply creates an instance of the menu background, then pins the icon sprites to the image points to make my menu. There may be simpler ways, but this gives me much control over the menu layout.

  • Well the good news is that might work for me, because I need control. I intend on updating my game later, adding new skills, changing algorithms of current skills, etc. The ability to choose where everything goes is important because of that, and it's the general direction I've been heading.

    I guess I'll experiment some more with how I want to do it all.

    EDIT:

    Forgot all about "pin" option. I was able to pin things to the main 9-patch window and now it's pretty easy getting all the items where I need them to be. As long as things are on screen in the editor it seems to work perfectly fine.

  • Awesome, glad it was useful! One easy way to do it is import the mockup as your menu sprite, place all the image points where they need to be and then replace the mockup image with the actual menu graphic in your menu.

  • What I did instead was put on the grid and snap to grid option, arranged my icons and the likes how I wanted them, gave it the "pin" behavior and everything worked out fine. I wish I could show it off but I have tons to do before the game is ready for demonstration.

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