Forum rules - please read before posting.

Changing the options on a UI Template?

Hi everyone! I'm new to Adventure Creator and Unity itself, and this is my first time posting(I hope it's the right category too!)

Now, I don't know a lick about coding, which is part of why I was interested in Adventure Creator to begin with haha. And using Adventure Creator has gone pretty well for me so far!

My current project is a 2D game that works in a 16 x 9 aspect ratio (default it is 1280 x 720). I prefer to play games in a windowed mode and I like when my window doesn't take up the whole screen, hence the size. However, I know that's not everyone's cup of tea and so I wanted an option to make it full screen for players who prefer that.

I downloaded the "UI template: Graphic Options" from the downloads page here: [ https://adventurecreator.org/downloads ] since I saw it had that full screen toggle I had been looking for! In unity/the game it appears exactly as advertised: (https://adventurecreator.org/sites/default/files/2022-10/downloads-graphicoptions.png) And when I made a test build, it could full screen and go back to windowed mode with no problem!

However, I ONLY want the full screen toggle. Things like antialiasing options might not work for future art styles I plan to use in my projects.

I thought that maybe I could just delete the other options from the prefab, but when I did that and rebuilt a test build, attempting to use the full screen toggle did nothing. I could check the checkbox, but it wouldn't affect anything. I re-imported the template and it worked again when I had all the default options back.

Is there a way to remove the other options without breaking the full screen toggle? If not, I'll either just deal with it or just keep my game in permanent windowed mode--but I thank you for any help or advice you're able to provide in advance!

Comments

  • edited May 2023

    Welcome to the community, @arcadekitten.

    The Graphic Options template is actually an extension of this tutorial, which covers the process of adding a custom option through custom script.

    The template's Graphic Options component requires that all of the provided options remain on the prefab - though they don't necessarily have to be visible.

    I'll look to see if this behaviour can be changed, as you raise a good point.

    In the meantime, it might be a bit hacky, but you could feasibly move the unwanted options far off-screen so that they're not shown.

    If your game's UI is controlled directly (i.e. keyboard/controller, no mouse), then you'll probably also want to adjust the "Navigation" settings of each option's UI Button components, so that they can't be accessed off-screen.

  • Thanks so much for your reply @ChrisIceBox !

    Luckily my game only uses point-and-click mouse control so I didn't have to adjust any navigation settings. With your advice I moved the menu elements off screen and was able to get the menu to look like this! [ https://imgur.com/a/K0orPWT ]

    For anyone else reading this and wondering how I did it, I moved the tglFullScreen and BottomButtons objects to be directly under txtGraphicOptions in the prefab hierarchy. I then clicked on "Panel" and went to the Inspector tab. I made sure that under Content Size Fitter, I changed Horizontal Fit and Vertical Fit to both be unconstrained. I then edited the Panel with the Rect Tool to fit just around the options I needed. After, I unchecked Vertical Layout Group as it locked the buttons into place on the X and Y axis.

    After that, I went into the objects like Resolution, Quality Preset, so on and so forth and changed all their Y positions to be way under the visible space of the game (I did -900 just to be safe haha)

    I tested it both in-engine and with a test build and it looks and works just as I need it to, so I don't mind having to do it the "hacky" way. Thanks so much!

  • edited May 2023

    Glad to hear it!

    If you'd like to make it slightly less hacky: I've updated the template's package on the Downloads page, to allow for unwanted UI objects to be removed completely.

    To remove "missing element" warnings in the Console, you'd also have to delete their corresponding elements in the Menu's properties - but it should still work either way.

  • @ChrisIceBox Awesome, I'll check it out! Thanks again! ✰

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.