• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Scroll of Title of game - better understand how it works ?

Scheduled Pinned Locked Moved Help and Support
esthemetext scrollingtheme edit
13 Posts 4 Posters 2.0k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    DjDiabolik
    last edited by 23 Mar 2021, 18:20

    let's start by saying that I'm trying with the current default skin "CARBON" right ?

    I have created a sample title to test of it's works the scrool of game title.. i have created this:

    	<game>
    		<path>./mame2003-plus/cvs.zip</path>
    		<name>ZZZZZ: 59 caratteri example test AFGG DSGW EGE GSREZDG EWTE</name>
    		<playcount>1</playcount>
    		<lastplayed>20210323T181200</lastplayed>
    	</game>
    

    I have restart ES and I tried to see what happens.
    The title appears CUTTED and the end... the title does not start scrolling.

    At this point i have exited from emulationstation. i added some characters and restart ES.
    Now the title start to scrolling correctly........

    now i wonder:
    how many characters are actually shown?
    is there some sort of gap to make the title scroll begin?

    D 1 Reply Last reply 24 Mar 2021, 01:48 Reply Quote 3
    • D
      DavidDraper @DjDiabolik
      last edited by 24 Mar 2021, 01:48

      @djdiabolik good question. Thanks for asking. I'd love to know how this works too.

      David

      1 Reply Last reply Reply Quote 0
      • L
        Lolonois
        last edited by 25 Mar 2021, 22:12

        Looks like a royale brain twister on a first sight.
        It it defined in a header file / template class: TextListComponent.h.

        The decision to scroll is made at this line.

        It might be tempting to assume the wrong decision is caused either by a theme or is caused by a few fixed characters off but the rabbit hole goes deeper:
        I discovered that game titles with L, F, T aso. are significantly shorter measured by sizeText() than those with less of those characters?!
        It turned out that the sizeText() is feeded with the gametitle "as-is" from the gamelist.xml (usually mixed upper/lowercase), but to measure the x-dimension right the theme's <forceUppercase> must be honored before calling sizeText().

        Small change. But with that each title scrolls even if it is only a few pixels too long. :)

        diff --git a/es-app/src/components/TextListComponent.h b/es-app/src/components/TextListComponent.h
        index bd1520d..f1a8efb 100644
        --- a/es-app/src/components/TextListComponent.h
        +++ b/es-app/src/components/TextListComponent.h
        @@ -304,7 +304,8 @@ void TextListComponent<T>::update(int deltaTime)
                        mMarqueeOffset2 = 0;
         
                        // if we're not scrolling and this object's text goes outside our size, marquee it!
        -               const float textLength = mFont->sizeText(mEntries.at((unsigned int)mCursor).name).x();
        +               auto name = mEntries.at((unsigned int)mCursor).name;
        +               const float textLength = mFont->sizeText(mUppercase ? Utils::String::toUpper(name) : name).x();
                        const float limit      = mSize.x() - mHorizontalMargin * 2;
         
                        if(textLength > limit)
        
        

        Please test the proposed patch on your installation and report back. Then a PR could be filed.

        Thanks for challenging this guys, you helped to squish an annoying, old (might be 7yrs old) bug which must be around since <forceUppercase> was introduced for themes.

        D 1 Reply Last reply 30 Mar 2021, 16:10 Reply Quote 0
        • D
          DjDiabolik @Lolonois
          last edited by 30 Mar 2021, 16:10

          @lolonois said in Scroll of Title of game - better understand how it works ?:

          Looks like a royale brain twister on a first sight.
          It it defined in a header file / template class: TextListComponent.h.

          The decision to scroll is made at this line.

          It might be tempting to assume the wrong decision is caused either by a theme or is caused by a few fixed characters off but the rabbit hole goes deeper:
          I discovered that game titles with L, F, T aso. are significantly shorter measured by sizeText() than those with less of those characters?!
          It turned out that the sizeText() is feeded with the gametitle "as-is" from the gamelist.xml (usually mixed upper/lowercase), but to measure the x-dimension right the theme's <forceUppercase> must be honored before calling sizeText().

          Small change. But with that each title scrolls even if it is only a few pixels too long. :)

          diff --git a/es-app/src/components/TextListComponent.h b/es-app/src/components/TextListComponent.h
          index bd1520d..f1a8efb 100644
          --- a/es-app/src/components/TextListComponent.h
          +++ b/es-app/src/components/TextListComponent.h
          @@ -304,7 +304,8 @@ void TextListComponent<T>::update(int deltaTime)
                          mMarqueeOffset2 = 0;
           
                          // if we're not scrolling and this object's text goes outside our size, marquee it!
          -               const float textLength = mFont->sizeText(mEntries.at((unsigned int)mCursor).name).x();
          +               auto name = mEntries.at((unsigned int)mCursor).name;
          +               const float textLength = mFont->sizeText(mUppercase ? Utils::String::toUpper(name) : name).x();
                          const float limit      = mSize.x() - mHorizontalMargin * 2;
           
                          if(textLength > limit)
          
          

          Please test the proposed patch on your installation and report back. Then a PR could be filed.

          Thanks for challenging this guys, you helped to squish an annoying, old (might be 7yrs old) bug which must be around since <forceUppercase> was introduced for themes.

          Lol... I am absolutely not an expert :)
          plus English is not my mother tongue :)

          I don't have understand how i need to modify... my actual gamelist.xml ?
          Or some file of "carbon" theme ? :)

          L S 2 Replies Last reply 1 Apr 2021, 20:37 Reply Quote 0
          • L
            Lolonois @DjDiabolik
            last edited by 1 Apr 2021, 20:37

            @djdiabolik you asked for

            1. Scroll of Title of game - better understand how it works ?
            2. how many characters are actually shown?
            3. is there some sort of gap to make the title scroll begin?

            Ad 1: I guess I layed out how it works: The name contains the game's name. If you study sizeText() of the Font class, note how the linewidth is summed up by each glyph of name This width is returned to textLength and compared to the limit (see next).

            Ad 2: In the <gamelist> element in the carbon.xml file, see: <textlist name="gamelist"> in the childelement <size>0.489 0.794</size> defines the available x - width and y - height in percentage of the total screen dimension (e.g. 1920x1080) . (The size may even be smaller due to other settings of the theme.) This x value is the space (the limit) you have for the game name. How many characters this is depends on the font and fontsize in use and if a character is lower or uppercase.

            Ad 3: No. If textLength > limit it scrolls, else not. Period.

            TL;DR: It can neither be fixed by editing the gamelist.xmlnor by editing any theme file.

            D 1 Reply Last reply 6 Apr 2021, 11:26 Reply Quote 0
            • S
              sleve_mcdichael @DjDiabolik
              last edited by 1 Apr 2021, 21:57

              @djdiabolik I think what they're saying is, this is not something you can fix in a config file. You'd have to modify the code yourself, and recompile it.

              L 1 Reply Last reply 2 Apr 2021, 21:18 Reply Quote 0
              • L
                Lolonois @sleve_mcdichael
                last edited by 2 Apr 2021, 21:18

                @sleve_mcdichael no need to talk to me with an royal we. (-; RetroPie and Emulationstation is open for all to learn/modify/extend.

                But yes, you are right. A fix is only possible by changing the code.

                However, you can do a workaround by displaying the game names without being modified to UPPERCASE:

                Get a copy of the carbon theme (if not present already, else skip right to step 2):

                1. ssh to your pi as user pi.
                cd .emulationstation
                mkdir themes
                cd themes
                git clone https://github.com/RetroPie/es-theme-carbon.git carbon
                cd carbon
                
                1. ssh to your pi
                • Edit carbon.xml in the folder /home/pi/.emulationstation/themes/carbon
                • Locate this line and change the 1 to an 0.
                • And locate also this line and do the same.
                • Save. Then restart Emulationstation.
                • Now the scrolling should only start iff it does not fit into its limits.
                1 Reply Last reply Reply Quote 2
                • L
                  Lolonois
                  last edited by 4 Apr 2021, 20:05

                  Submitted PR#742.

                  1 Reply Last reply Reply Quote 2
                  • D
                    DjDiabolik @Lolonois
                    last edited by DjDiabolik 4 Jun 2021, 14:38 6 Apr 2021, 11:26

                    @lolonois

                    I told you that I am all less than an expert on the case... I thought it was easier.

                    If i need to recompile ( as it say @sleve_mcdichael )the source/code of default 'carbon' theme it's time for me to roll up my sleeves and start studying ;)

                    If I wanted to make an alternate copy of stock 'carbon' theme for testing some all modification i can use this:

                    git clone https://github.com/RetroPie/es-theme-carbon.git carbon-alt
                    

                    it's correct ?

                    EDIT
                    i am trying to learn.... i have turned on my pi4 right now.
                    I have connected by ssh and reach it:

                    pi@retropie:~ $ cd .emulationstation
                    pi@retropie:~/.emulationstation $ ls
                    collections  es_input.cfg  es_input.cfg.bak  es_log.txt  es_log.txt.bak  es_settings.cfg  es_temporaryinput.cfg  gamelists  scrapers  tmp
                    
                    

                    there's no exist a folder called themes..... i have created and made the carbon.
                    I have made all modification as you have correctly listed.
                    Restart ES and apparently there's no difference.

                    I should perhaps apply this ex-novo theme ?

                    EDIT 2nd part
                    Is working :)

                    pi@retropie:~/.emulationstation $ mkdir themes
                    pi@retropie:~/.emulationstation $ cd themes
                    pi@retropie:~/.emulationstation/themes $ git clone https://github.com/RetroPie/es-theme-carbon.git carbon-alt
                    Cloning into 'carbon-alt'...
                    
                    
                    

                    To edit carbon.xml after i thinks it's a good alternative using a sftp client connected as Pi user.
                    Whit it i can use notepad++ to edit files......

                    the problem is that it gives me this error:

                    fatal: unable to access 'https://github.com/RetroPie/es-theme-carbon.git/': Failed to connect to github.com port 443: Connection timed out
                    
                    

                    I've heard about this problem elsewhere before...... i can ping www.github.com whitout any problems.
                    My Pi4 it's connected by wifi..... problably need to see the port 443.....

                    EDIT 3rd part
                    Problably it's ok:

                    pi@retropie:~/.emulationstation/themes $ git clone http://github.com/RetroPie/es-theme-carbon.git carbon-alt
                    Cloning into 'carbon-alt'...
                    warning: redirecting to https://github.com/RetroPie/es-theme-carbon.git/
                    remote: Enumerating objects: 1301, done.
                    remote: Total 1301 (delta 0), reused 0 (delta 0), pack-reused 1301
                    Receiving objects: 100% (1301/1301), 3.82 MiB | 3.74 MiB/s, done.
                    Resolving deltas: 100% (247/247), done.
                    
                    

                    Using http instead https.....now time to modify all it's need.

                    EDIT 4rd part
                    Ok all modification it's done.
                    After i have created the folder "carbon-alt" i have need to select it directly from ES.
                    I have restart ES after select it and try to see the result... apparently there's no difference respect the stock carbon.

                    there is something I did not understand :)

                    Edit part 5
                    and anyway... i have modify all

                    <forceUppercase>0</forceUppercase>
                    

                    I have restart ES and chose this "carbon-alt" theme but there's somethings strange because i continue to see al names in uppercase anyway.
                    I have check the gamelist.xml for my nes collection..... i have pick this as example:

                    	<game id="1791" source="ScreenScraper.fr">
                    		<path>./A/Advanced Dungeons &amp; Dragons - Dragons of Flame (Japan).zip</path>
                    		<name>Advanced Dungeons &amp; Dragons - Dragons of Flame (Japan)</name>
                    		<desc>Set in between the SSI's AD&amp;D Dragonlance action games Heroes of the Lance and Shadow Sorcerer. This game follows the tradition of Heroes of the Lance with a side-scrolling, action-oriented view, a breakaway from the standard GoldBox RPGs.  Plot-wise, it also takes place between those two games, following closely the novel/game modules written by Weiss/Hickman.
                    
                    You take control of one character at a time, with each hero having different abilities.</desc>
                    		<releasedate>19920221T000000</releasedate>
                    		<developer>Pony Canyon</developer>
                    		<publisher>U.S. Gold</publisher>
                    		<genre>Role playing games</genre>
                    		<players>1</players>
                    		<image>./media/images/A/Advanced Dungeons &amp; Dragons - Dragons of Flame (Japan).png</image>
                    		<genreid>768</genreid>
                    	</game>
                    

                    The name it's not all in uppercase.. but on ES it's show as uppercase anyway and it's out at left and no scroll.
                    seems not to be these changes stuff for me.....

                    Final EDIT for moment
                    nothing guys :) is not in my skills modify this.
                    I have made another some test and restart ES about five time but i continue to see al title in uppercase on my alternative copy of carbon theme.
                    There must be something that escapes me.....

                    Look at this another example.... i have download another different name from ES. it's pixel-metadata.
                    This is nes title:
                    look this. out of screen at right. All uppercase instead it's setted at 0 and not scrolling

                    The gamelist.xml it's not contain name in uppercase....
                    If i scroll upper on europe virtual console of same games.... look here:
                    it's scroll whitout any issue

                    and here:
                    it's scroll

                    It's screen it's setted in 1080p... it's retropie setting to force all name in uppercase instead it's not setted on theme ?
                    I don't really undestand where could the problem be.... but probably it's my limit knowledge.

                    L 1 Reply Last reply 8 Apr 2021, 06:39 Reply Quote 1
                    • L
                      Lolonois @DjDiabolik
                      last edited by 8 Apr 2021, 06:39

                      @djdiabolik thanks for the verbose reply. I guess you are almost there with the workaround. Some hints from the distance:

                      If I wanted to make an alternate copy of stock 'carbon' theme for testing some all modification i can use this:

                      git clone https://github.com/RetroPie/es-theme-carbon.git carbon-alt
                      

                      it's correct ?

                      While it is not explicitly stated in the guide the <folder name> of the theme and the <theme>.xml must have the same name, so in your case it should look like

                      carbon-alt/carbon-alt.xml

                      and not

                      carbon-alt/carbon.xml

                      I assume this is it, which left you stranded with your quote "There must be something that escapes me....."

                      For the meta-pixel theme (never used it, but some ideas which may cause the "still in uppercase" effect):

                      1. If you haven't done yet: Copy the whole meta-pixel folder to your PC (with sftp/winscp or alike) and use notepad++ to find any occurence of <forceUppercase>1. From my memory there is a search option Find in files within notepad++ (set file Filter to *.xml and Search from folder meta-pixel downwards).
                        Rationale: Each XML <text> element can be overwritten by platform (=the folders nes/, amiga/ and so on) specific formatting so on some platforms the theme designer may have choosen to display games in uppercase, even if it is set to 0 in the "global" theme setting (i.e. in carbon-alt.xml or meta-pixel.xml).
                      2. Edit all occurences and copy the tree back to the Raspberry Pi.

                      If this does not help: Some Fonts only provide uppercase Glyphs for every character even if the game name consists of mixed case characters. In this case the <forceUppercase> has no visible effect. :/

                      1. To verify: Search for *.ttf files within the theme folder. Copy them to Windows. On windows double click on the found font filename to see sample text of that font (no need to install it). If there are no lowercase characters shown the font only provides uppercase.

                      Hope this helps.

                      D 1 Reply Last reply 9 Apr 2021, 17:06 Reply Quote 0
                      • D
                        DjDiabolik @Lolonois
                        last edited by 9 Apr 2021, 17:06

                        @lolonois
                        mmmmm... i tried to install other themes just for testing :)
                        But i'm back to use the stock and default "carbon" because basically I like it and it is essential :)

                        For made all possibly test the "alternative" carbon it's now cloned here:
                        /opt/retropie/configs/all/emulationstation/themes/carbon-alt/

                        In this folder there's present a file called carbon.xml and not a file called carbon-alt.xml.... do you think I should maybe rename the file itself?

                        I have tryed to look on theme.xml and there's this:

                        <theme>
                        	<formatVersion>4</formatVersion>
                            <include>./carbon.xml</include>
                        

                        this should mean that the name carbon.xml it's right :)

                        The carbon theme use this:

                        <fontPath>./art/Cabin-Bold.ttf</fontPath>
                        

                        I have copyed this cabin-bold.ttf on windows.
                        I can also confirm this cabin-bold.ttf not contain only uppercase text but it's contain all this caracter:
                        I have load a preview here

                        At this point i have also see... inside "nes" folder there's a theme.xml but there's no contain a strings like forceuppercase or similar.

                        maybe it's emulationstation that has some default option turned on?

                        I need to check......

                        L 1 Reply Last reply 11 Apr 2021, 16:32 Reply Quote 0
                        • L
                          Lolonois @DjDiabolik
                          last edited by 11 Apr 2021, 16:32

                          @djdiabolik If the carbon-alt theme works (ie. your changes to files in that folder do have an effect in ES) with the carbon.xml as filename there is no need to change it. However, if you (have to) change it to carbon-alt.xml make sure to rename also all references in to the carbon.xml inside the xml (as you noted above). I must say I have not spent much time on themes in general, so my hint is an educated guess.

                          Anyhow, I guess you can stop fiddling with themes. My pull request (https://github.com/RetroPie/EmulationStation/pull/742) has been accepted to the development version of Emulationstation. You may run this version by yourself:

                          1. Quit Emulationstation.
                          2. ssh to your RetroPie
                          3. Start sudo ~/RetroPie-Setup/retropie_setup.sh, select Manage experimental packages, scroll down to almost the end (see screenshot), to entry 198 emulationstation-dev then select Install from source.
                            screenshot.png
                          4. Let the compile finish
                          5. Restart Emulationstation

                          PS: If you want to revert to stable Emulationstation navigate in the retropoe setup to Manage packages -> Manage core packages -> 199 emulationstation . But from my experience the development version is kept pretty stable from the project maintainers.

                          D 1 Reply Last reply 20 Apr 2021, 17:14 Reply Quote 0
                          • D
                            DjDiabolik @Lolonois
                            last edited by 20 Apr 2021, 17:14

                            @lolonois said in Scroll of Title of game - better understand how it works ?:

                            Anyhow, I guess you can stop fiddling with themes

                            Lol... fiddling with themes... lol.. at the end it's fun for me :)

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post

                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.

                              This community forum collects and processes your personal information.
                              consent.not_received