[GUI] GUI element sprite change leads to errors - [SOLVED]

Started by ArachnidTea, Sun 16/06/2024 17:49:07

Previous topic - Next topic

ArachnidTea

MAIN Q: HOW DO I UPSCALE GUI ELEMENTS TO 1920p?

I wanted to create a 1920x1080[16:9] game so I changed the resolution to such.
This unfortunately resulted in the GUI elements such as the buttons to be small, as their original resolution is small. That is ok, I can just remake them to the proper sizing artistically. So--

I did some math and figure out the correct button resolution in accordance to my new resolution. As a test, I copied one of the verb's icon (the btnIconWalk) and made a new bigger one in Photoshop. I then export the file as .png into a new folder called 'Sprite' inside the directory where I am making the game.

I then used the 'replace sprite from file..." function and replace btnIconWalk with the new sprite which is also renamed to be similar to the original name for btnIconWalk (2100)

-the new sprite has the same name as the original
-the new sprite aspect ratio is the same as the original

I run the game to test and had gotten this error:

I tried to figure this out myself but I have no idea how to open acrsprset.spr

I am not here to ask the dev to fix the error, I am just requesting the proper method to upscale the GUI to 1920p but when I scoured the Module, Template and Forums I did not see anyone specifically asking this question.

ArachnidTea


https://imgur.com/a/fNiaUfG
for some reason the image does not show up in the original post

Crimson Wizard

#2
This error is not related to GUI upscaling. According to the error message, some other process have locked one of the game files, and Editor is unable to save it after changes.

Try restarting AGS Editor and repeat the sprite replacement. If that does not work, maybe try restarting operating system and repeat this action.

If this problem persists, maybe you have an antivirus or a program like Windows Defender blocking AGS Editor from performing file operations.

ArachnidTea

restarting my operating system and reinserting the image source again seems to work  (nod)

But is there already a method that automatically upscale GUIs
or are there Templates, Modules out there that had already done this?

if there isn't,

what is the best way to manually change all the GUI element from their default?
I tried to reach the directory that was mentioned in the error and manually change the file there but they are either .tmp files or .spr

Crimson Wizard

I am afraid there's no simple way to do this at the moment.

The two available methods are:
- resize the sprites and reimport them, like you did;
- use dynamic sprite API and resize sprites programmatically at runtime, then reassign them to all gui and buttons. This method has a number of downsides, the major being extra runtime memory consumption and larger game saves, as dynamic sprites are kept in memory at all times, and also stored in saves. This problem may be somewhat mitigated by scripting your own "sprite manager", but I don't think it's worth it for this particular case.

There will be a GUI dynamic scaling support in the next major version of AGS (4.0), but it's currently in experimental stage.

ArachnidTea

Thank you Crimson Wizard for helping me! :>
who knows when the next updated AGS version would come out so in the meantime I would just make a high-res version

since no one else had made them (either due to no demand or the ones that do know had already made it themselves) I would later post mine on the uhh appropriate forum which would hopefully (maybe?) help the next person

Snarky

Quote from: ArachnidTea on Sun 16/06/2024 19:14:51But is there already a method that automatically upscale GUIs
or are there Templates, Modules out there that had already done this?

There is now.

SMF spam blocked by CleanTalk