1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Menu Framework?

Discussion in 'Programming' started by Amon, Feb 11, 2020.

  1. Amon

    Amon Member

    Joined:
    Sep 13, 2016
    Posts:
    303
    Anybody have one or can help me with some pseudo code so that I can develop my own?

    I have 4 games complete. Just need to rap them up within a framework e.g.

    LogoScreen >> Fade >>> TitleScreen >>> Fade >>> Options Screen <<< fade <<< Title Screen >>> fade >>> GameScreen
     
  2. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    7,140
    Sounds like you know what you want so just do it! :)

    Create a new project with placeholder art for the logos and buttons and stuff, then start planning it out as you require. Fades are easy, as you can simply use an object with a low draw depth to draw a black rectangle over everything using alpha, and you can use a global variable to say which menu is to be shown. Like from the logo you'd set "global.menu_state" to "titles" and then in the fade object you'd have it fade from 0 alpha to 1, and when it reaches 1 it checks the global menu state and goes to the appropriate room (you can make the object persistent and then in the room start event set an alarm or something to fade from 1 to 0 again).

    You can then export the project as a Local Asset Package (omitting the sprites and rooms) which can be imported into any project in the future.

    I'm not sure what else to tell you... the question is a bit vague, although I would say that if you are making a framework like this, you will need to ensure that all your games conform to the same initial room structure and use the same names for sprites and rooms (like every game will have to have a sprite "spr_Logo" or "spr_Titles" and a room "rm_Logo", etc...).

    Hope that helps a little at least!
     
    Amon likes this.
  3. Amon

    Amon Member

    Joined:
    Sep 13, 2016
    Posts:
    303
    Took your advice, Nocturne, and, it's almost finished. :)
     
    Nocturne likes this.
  4. Mool

    Mool Member

    Joined:
    Nov 6, 2016
    Posts:
    127

Share This Page