Author Topic: Corrupted GUI after changing resolution [Solved]  (Read 201 times)

Yesterday I accidentally changed the resolution of the game in General Settings (from 320x200 to 1980x1080), while agreeing to reformat the GUI.

I tried to change everything back, but now my GUI "shrank" like this:


I tried to create a second project to look at the width-height parameters of each element and manually rewrite them into the main project, but still many settings are knocked down (the buttons are clickable in the corners, the text is shifted, and so on)


Can you tell me how to fix this?
« Last Edit: 23 Feb 2021, 15:28 by Licht61 »

Re: Corrupted GUI after changing resolution
« Reply #1 on: 23 Feb 2021, 10:20 »
If you have a project backup then you may try doing export/import GUI (or return to backup version). Same export/import may be used if your project just uses GUI from template without much changes.

Otherwise, only by hand.

I am not fully certain what do you mean "buttons clickable in the corners", if you mean only small part of button is clickable - that usually means their real Width/Height is still smaller than the graphic.

Re: Corrupted GUI after changing resolution
« Reply #2 on: 23 Feb 2021, 10:39 »
Didn't know that GUI could be imported. Thanks!

But when I trying to import and run the build - this error shows:

Re: Corrupted GUI after changing resolution
« Reply #3 on: 23 Feb 2021, 11:00 »
I don't know what exactly did you do, have you deleted previous GUI? where did you export new GUI from?
The error means simply that lblOverHotspot no longer exists.

Re: Corrupted GUI after changing resolution
« Reply #4 on: 23 Feb 2021, 11:28 »
I created a project with the Sierra preset, exported the GUI from there, went to my main project, deleted the old GUIs (which were broken due to a change in resolution), imported the GUIs saved from the new project and assigned them the same ID that the deleted ones had.

Re: Corrupted GUI after changing resolution
« Reply #5 on: 23 Feb 2021, 11:59 »
I created a project with the Sierra preset, exported the GUI from there, went to my main project, deleted the old GUIs (which were broken due to a change in resolution), imported the GUIs saved from the new project and assigned them the same ID that the deleted ones had.

Well, if your project had something different (more GUIs, more controls on them) than in Sierra template, then there will be mismatches, that you'd have to fix yourself.

Unless you saved more times after that you could try restore old guis by renaming Game.agf.bak file to Game.agf in your project folder, then try different approach (you'd have to close Editor without saving for that).
If you saved more than 1 time then Game.agf.bak already contains new changes probably.

Don't you have any backup of your project to which you could revert, or import guis from?

Re: Corrupted GUI after changing resolution
« Reply #6 on: 23 Feb 2021, 15:28 »
Found source of problem.

Some GUIs have buttons inside: for example gIconbar has btnIconWalk. This button has own setting\properties and script name (btnIconWalk).

When importing, which I described above (with deleting of "compressed" old GUIs), for some reason, I have these names with "2" in the end (btnIconWalk2). So game was crashing on launch, because I didn't see that new "2" in names.

I just deleted this number, saved project and everything work fine now.