Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miss aligned text in game selection menu #22

Open
uberdisko opened this issue Nov 10, 2021 · 26 comments
Open

miss aligned text in game selection menu #22

uberdisko opened this issue Nov 10, 2021 · 26 comments

Comments

@uberdisko
Copy link

uberdisko commented Nov 10, 2021

im not sure why i cant get this right i have tried to modify about everything in layouts but i keep having my Game Name Text in all my system menus miss aligned please let me know if there is a easy way to fix this im sure its because im trying to run this theme in 4:3 (640x480)

Screenshot (19)

@Rydra
Copy link

Rydra commented Nov 13, 2021

Same problem here. I just updated my retropie and the text was misaligned. A pity since this is my favourite theme by far.

@uberdisko
Copy link
Author

Same problem here. I just updated my retropie and the text was misaligned. A pity since this is my favourite theme by far.

i did kinda fix it by writing a repositioning in the base.xml but then i noticed only 6 of the games listed show up so the bottom entry is blank too

@tonylepsie
Copy link

I just finished a fresh install of retropie and snes-mini theme and I had the same issue. Any workaround ?

@makoffee
Copy link

makoffee commented Nov 29, 2021

I've been able to resolve the issue on my local machine. After reading the Emulation station documentation, it seems to be an issue with how the latest EmulationStation handhelds y co-ordinates for textlist parameters. For the snes-mini theme using the 1080p layout I was able to adjust the settings to get acceptable results. Your mileage may vary, however this file seems to be the issue. It's effecting a number of themes so either the themes need to be updated or ES should put out a fix.

Anyhow - I was able to update /themes/snes-mini/layouts/1920x1080.xml as such (may work in other resolutions):

pos = ${listx} 0.19537037037037
size = ${listWidth} 0.62962962962963
selectorHeight = 0.0814814814814815
selectorOffsetY = -0.0111111111111111

Hope that saves someone else the trouble of sorting it out.

@makoffee
Copy link

makoffee commented Nov 29, 2021

Added a pull request here (2nd UPDATE):
#26

@uberdisko
Copy link
Author

does this fix the missing final game listed?

@Rydra
Copy link

Rydra commented Dec 6, 2021

@uberdisko I can confirm that @makoffee fix solves all the listing issues. Bear in mind though that he targets specifically at a resolution of 1920x1080.

Thanks @makoffee for the work :D

@makoffee
Copy link

makoffee commented Dec 6, 2021

@Rydra - No worries. It's true I only targeted the 1080p resolution as that was my target test device (raspberry Pi on HDTV). After a cursory review of the other layout files. It would seem this issue will also negatively impact the other resolutions as well.

I'll do a second pass and update all the effected resolutions and post a more comprehensive pull-request.

@makoffee
Copy link

makoffee commented Dec 6, 2021

Ok,
I've added a new pull request with a more comprehensive fix, updates the y sizes and offsets of all resolutions:
#26

@uberdisko - Can you test my branch at https://github.com/makoffee/es-theme-snes-mini/tree/makoffee-patch to test and see if my fix works on 640x480?

@uberdisko
Copy link
Author

sure thing

@uberdisko
Copy link
Author

fixed for 480p, you are a god thank you

IMG_20211206_183713

@makoffee
Copy link

makoffee commented Dec 7, 2021

@uberdisko - Your screenshot makes me very happy! Glad to see it working for you.

@ViperAcidZX
Copy link

ViperAcidZX commented Dec 19, 2021

Ok, I've added a new pull request with a more comprehensive fix, updates the y sizes and offsets of all resolutions: #24

@uberdisko - Can you test my branch at https://github.com/makoffee/es-theme-snes-mini/tree/makoffee-patch to test and see if my fix works on 640x480?

Anyone else getting Emulation Station crashes with these fixes? I've tried your fork of this theme and Emulation Station has been crashes with the fixed offsets. I'm using a Raspberry Pi Model 3B+ with the latest RetroPie updates at 1920x1080 (although my display maxes out at 4K).

@makoffee
Copy link

makoffee commented Dec 19, 2021

@ViperAcidZX - I've been noticing memory issues related to this theme that seem to cause random ES crashes when pre-loading the UI on start. A few things I've tried is deleting the game lists meta data from the scraper. Increasing the GPU memory, and playing with the vram-limit settings.

Try removing my offset-patch and reboot a few times to confirm. Though I'm not sure why different offset values could cause a memory overflow.

@makoffee
Copy link

makoffee commented Dec 19, 2021

@ViperAcidZX - I think I might be understanding what could be causing the issue.
Looking at the height values for the sizes from the original 1080p layout. if you take Ruckage's original value "0.5481481481481481" and multiply it by the height of 1080px you get a nice whole number of "592". If you take my value of "0.63" and multiply it by 1080 you get a float of "680.4".

I'm going to speculate that if I update the values to calculate as nice whole numbers multiplied by the screen height, at each resolution then it may represent a possible variable type miss-match. I'm just pulling at straws here, but I'm going to give it a shot. And if it works I'll update my branch and post a new pull request.

Stay frosty!

@makoffee
Copy link

makoffee commented Dec 19, 2021

@ViperAcidZX - Ok I think I've sorted things out I've added a new pull request on my branch.
#26

Please try cloning that branch.

Regarding the crashing Emulation Station on startup. I think by setting the vram-limit to 120mb in EmulationStation seems to make this theme more stable, along with the new whole number calculations for offsets. Raising it too high or too low affected stability. I've also got my GPU-Split set to 256gb. Please give it a try and let me know if it's working any better for you.

Main Menu > Other Settings > VRAM-Limit > 120mb
or in /home/pi/.emulationstation/es_settings.cfg
int name="MaxVRAM" value="120"

I also have my GPU-Split set to 256 in:
/boot/config.txt > gpu_mem=256

@ViperAcidZX
Copy link

ViperAcidZX commented Dec 20, 2021

@ViperAcidZX - Ok I think I've sorted things out I've added a new pull request on my branch. #26

Please try cloning that branch.

Regarding the crashing Emulation Station on startup. I think by setting the vram-limit to 120mb in EmulationStation seems to make this theme more stable, along with the new whole number calculations for offsets. Raising it too high or too low affected stability. I've also got my GPU-Split set to 256gb. Please give it a try and let me know if it's working any better for you.

Main Menu > Other Settings > VRAM-Limit > 120mb or in /home/pi/.emulationstation/es_settings.cfg int name="MaxVRAM" value="120"

I also have my GPU-Split set to 256 in: /boot/config.txt > gpu_mem=256

I've cloned the branch, I've tried setting my Pi's GPU Split to 256MB, and set the VRAM limit in Emulation Station to 120MB and it crashes every now and then when booting my Pi 3B+ but sometimes it does work. I'm not sure if it also has to do with the fact that I'm using using RetroFlag's SuperPi case with CRCerror's forked script for the shutdown/reset functions or the slight tweak I made from these instructions to the UI to make it resemble a Super Nintendo Classic more closely.

@uberdisko
Copy link
Author

im still crashing with vram set to 120

@makoffee
Copy link

Ok interesting. Seems a similar issue is reported here:
https://retropie.org.uk/forum/topic/12583/snes-mini-theme/921

I'll roll back, start testing the values on at a time to see where it breaks, and report back. Thanks for all the help testing. I just love this theme and really want to help get it working well for everyone.

@ViperAcidZX
Copy link

ViperAcidZX commented Dec 21, 2021

Ok interesting. Seems a similar issue is reported here: https://retropie.org.uk/forum/topic/12583/snes-mini-theme/921

I'll roll back, start testing the values on at a time to see where it breaks, and report back. Thanks for all the help testing. I just love this theme and really want to help get it working well for everyone.

I have a feeling it could be the newer build of EmulationStation is at fault here because I tried other themes and those cause EmulationStation to crash the same way. I wish there was a way to roll back to an older (and working) version of EmulationStation while keeping the newer updates of RetroPie. I tried one method outlined here but for some stupid reason I can't even use it because of an user rights error or something.

Follow-up report: It appears that Threaded Loading in EmulationStation's settings appears to be the cause of the crash in my case after reporting it to one of the RetroPie staff members from the forum. Try and see if turning this off in es_settings.cfg may help on the EmulationStation build from RetroPie v4.7.19:

<bool name="ThreadedLoading" value="true" />
Set this value to false and reboot the Pi and see if that changes anything.

@makoffee
Copy link

makoffee commented Jan 3, 2022

@ViperAcidZX - great find! I will try this out myself today and report back. Nice to see this issue is somewhat unrelated to layout.

@ViperAcidZX
Copy link

@ViperAcidZX - great find! I will try this out myself today and report back. Nice to see this issue is somewhat unrelated to layout.

pjft was the one who helped me narrow down the cause of the cause of the crashes in this thread where was I reporting the issue with newer versions of RetroPie.

@jimmybrancaccio
Copy link

jimmybrancaccio commented Feb 28, 2022

Hey folks, I found this wonderful theme from a Reddit post, and then I ran into these text misalignment issue which brought me to this issue in GitHub. It looks like it's been fixed, but only for the default resolutions.

I am currently running the theme on my RetroPie Raspberry Pi (4B+ 4GB I believe) and at 4k.

snes-mini-4k

I took that screenshot and scaled it down (at 4k it was like 12MBs or something). As you can see we have the wonderful text misalignment issue. Would anyone be able to help me fix it?

I also just realized, in my situation would it be using the 1920x1080 XML layout file since none exists for a 4k resolution? If so, could I then just try applying the above fix?

Thank you all!

Update (2022-03-08): Ok, so I tried out the update provided here but it did not work and none of the titles were showing up. I then noticed from that comment:

size = ${listWidth} .0.62962962962963

I noticed in the PR it's actually not that, note the prepended . so it should be 0.62962962962963 and not .0.62962962962963.

Using the entry from the PR does work on my 4k display, so thank you @makoffee for providing the fix!

snes-mini-4k-fixed

@thias
Copy link

thias commented Apr 21, 2022

I have a similar issue using Batocera. For some reason, the updated values don't fix it. Poking around, here are the ones that worked for me for the 1920x1080 layout (no need for any OffsetY anymore):

                        <pos>${listx} 0.216</pos>
                        <size>${listWidth} 0.578</size>
                        <lineSpacing>1.375</lineSpacing>
                        <selectorHeight>0.078</selectorHeight>

This is all black magic to me, and I have no idea about what differences in the Batocera EmulationStation fork could explain this, nor how to calculate correct values for all possible layouts.

This was referenced Apr 21, 2022
@makoffee
Copy link

makoffee commented May 9, 2022

@thias - There's no black magic going on there it's really just some simple math. Take the pixel x/y position that you want to achieve and divide it by the width or height of your target resolution. That's how we end up with a floating point number or a "percentage".

Your values would give:
listY: 233.28px
size listHeight: 624.24px

This would create sub-pixeling. I would try to hit some whole number pixel values for the best look with this theme. I actually just loaded up all the UI assets in photoshop to help me find what pixel coordinates I was trying to hit.

You have to play with the line height a bit, but I believe it is a multiplier of the selector height or the font height.

@makoffee
Copy link

makoffee commented May 9, 2022

@jimmybrancaccio

I noticed in the PR it's actually not that, note the prepended . so it should be 0.62962962962963 and not .0.62962962962963.

Good catch. I updated the comment and removed that typo. Glad it worked out for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants