Create

boilerplate code for creating persona-style ui in overpy.
overpy source is in the snippet.

most of the work is in filling in the arrays and deciding on a formula for the menu items.

features a linear menu and wheel menu (though the wheel doesn't loop back on itself nicely)

if you don't have space for a dummy you will need to shift the menu scrolling to keys that are not the movement keys. if you use the player as the model it will do the walking animation and it'll look bad. you can't root the player or you can't detect its throttle.

how to use

  1. populate the lists of menu items and their corresponding icon lists. you can add as many as you want.
  2. take the following positions as local vectors relative to the model player. order is important, see the following example.
  3. menuCamPos is the position of the camera in each menu screen.
  4. menuLookPos is where the camera looks at in each screen, and where the sparkle effect plays on selection.
  5. menuStripeStarts and menuStripeEnds are the start/end positions of the beam effects for each menu screen. 1 beam will have its direction reversed for style.
  6. menuStripeOffsets is the offset for the 2nd beam relative to the first for each menu screen.
  7. add the in world text generation in the create menu hud rule. you'll need to write a formula (examples are in the code) that will handle the positions of the text objects.
  8. if you added a new menu, make sure to update menuMaxes - this indicates how many menu items you can scroll through before looping back to the start

order example (icon lists are omitted for brevity):
`chickenList = ["wing", "drumstick", "foot", "breast", "soul"]
drinkList = ["fanter", "pilk", "battery acid"]
menuMainList = ["chicken", "drinks"]
menuCamPos = [null, Vector.FORWARD, Vector.UP, Vector.LEFT]
menuLookPos = [null, Vector.BACKWARD, Vector.DOWN, Vector.RIGHT]
menuMaxes = [null, len(menuMainList), len(chickenList), len(drinkList)]

enum MENU:
OFF,
MAIN,
CHICKEN,
DRINK`

this will produce a main menu leading to the chicken and drinks menus.
the main menu's camera will face the front of the character.
the chicken menu's camera will look down towards the character.
the drinks menu's camera will face the left of the character.
the null in the 3 last lists are for the menuState of 0 - MENU.OFF in the enum.

Players | 1 - 12
Categories: Tools, Miscellaneous
Heroes: D.va, Doomfist, Junker Queen, Mauga, Orisa, and 34 more...
Created at:
Last updated:
Current version: 1.0.0

Controls

Jump
select
Interact
open menu or go back
a/d
scroll
select
open menu or go back
a/d
scroll
select
open menu or go back
a/d
scroll
select
open menu or go back
a/d
scroll
select
open menu or go back
a/d
scroll

Snippet

Loading...

Users Also Like

Similar Codes

Join the Workshop.codes Discord