How would I make a menu like this that scrolls like a revolver to quick choose an item/character?

0 favourites
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • I'm really curious, and I can't seem to find any tutorials

  • this is what i'm going for

  • Create a variable that contains a number, create a circle sprite thingy X times, each time you create it, set the sprite on it to like an array entry containing a bit of text, so when you open the menu is creates the entire menu from scratch automatically with the correct labels and sprites, setting the position of each object relative to it's IID, and setting the object's position to a value being the current variable number for the selected top middle position or seomthing and using the sum of used entires as the total and then calculating what percent of that currently is the variable and then setting the position using that value and adding X and Y to the objects relative to that using sin() and cos() because it will transform the number you put into it into a circle from -1 to 1 so it will multiply your X and Y differently because like sin() and cos() are different and one goes for x and the other goes for Y and u also have a variable for the distance.

    then when you want to rotate the menu you can modify the variable that contains the number to use decimals and make it jiggle and spin with gamdev juice by storing the actual variable somewhere else and then using math to make the old one translate to the new one but like cool, and then you can use the one to do something similar with the distance of the objects so that they expand from the middle on like a scale from 0 to 100% and then use can use that percentage to also apply it to the opacity so they fade in whenever u use that code to summon ur revovler menu and then since u have a variable containing the selected object and it'S a number u can use by adding 1 or removing 1 so it spins either clockwise ort counterclockwise and pressing fast adds to that number so you can make the menu spin faster without having to wait for like a timeline or anything to finish because thaT's bad for the user experience and thne when you press enter it changes ur item to array at index variable and u get the string of what it is to like use ur menu to equip an item by that strong or whatever and for closing it you can just blast it all and make it explode with code or whatever u want play a stock explositon sound and send them fucking flying incredible and then delete them or whatever, but then if soemone presses the menu button fast you'lkl have multiple copies so that'S not good so on "menu create" make sure the older menu is gone and if it isnt destroy it I guess lmao

    hope that helps

  • with orbit character on main sprite maybe?

    or action for each little sprite moving clockwise 20*dt for exemple

  • Collapsing menu: dropbox.com/s/3zlh62rlf104hbb/menu_mag.capx

    Revolving menu doesn't make sense if the game using mouse/touch. It will be different story if in your game menu using key/button to navigate.

  • youtu.be/uUpDF7vcaQI

    Is there any way to make this perfect?

  • I still am very much in need of help. I unfortunately can't seem to figure it out.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You won't be able to make it perfect by using a wait. I mean you can calculate how long it will take to rotate with time=(360/sprite.count)/speed, but since things update at 60fps you'll be off by 1/60sec or so which will add up. Plus, wait makes it harder to track what your events will do, which can make it hard to find the reason things aren't working.

    Conceptually you just need to rotate it a set number of degrees and then stop. Maybe with an ease?

    At any rate here is one way. The arrow keys change the goal angle, then the actual angle changes toward that. It will robustly stop at the correct angle.

    dropbox.com/s/d9ljfr2sade5orp/revolver_menu.capx

    There may be a simpler way too, but this should be simple enough to understand so you can use it in your project and customize.

  • it seems to be broken?

  • The order of the actions matter. Set the angle first, then move forward.

  • Oh, thanks! I had assumed that actions happened all at the same time without a wait event or signal event. I appreciate the knowledge drop.

  • You can also use Tween to rotate the wheel to a precise angle. Here is a demo:

    howtoconstructdemos.com/simple-speeding-up-slowing-down-effect-for-the-wheel-of-fortune-c3p

    Of course in your case you will need to rotate to much smaller angles - maybe 30 degrees or so.

  • SO, I'm trying to pin my mask sprite/option sprite to the revolving piece based on a UID. It doesn't work, and the mask sprite just goes off screen.

  • I believe UIDs change at runtime depending on the amount and order of objects. So instead of writing UID 521, which could be anything, write Sprite.UID (replace sprite with the name of the object you're trying to pin it to)

  • It doesn't seem to work- I can't figure this out

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