Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

holdingjason@gmail.com

7
Posts
3
Topics
A member registered Apr 23, 2018

Recent community posts

(6 edits)

* OK FOR NOW IGNORE THIS.  Appears the update did not take last time and so now I see the changes.  Sorry about that stupid unity said it was on the latest version but some of the files apparently did not take.  Fixing and will let you know if there are any issues.

WORKING AS DESIGNED NOW.  Again sorry.


Here is the exact text.  You can see there is no space at all at the end character '。'  Actual text is included at the bottom.

Toggling off and on the hyphen made no difference.  Thanks for the help going to take a look as well inside the code.

Also using a true type font so not sure if that has something to do with it???  Though it does appear to be working sometimes with ! inside of text ie not at the end.

Oh another oddity "linebreakUnfriendlyCharacters" could not find this while searching the code.   But I can find linebreakFriendlyChars so that seems odd.  Going to check if the update did not take at some point or if my custom changes interfered with that.

<c=green><a=center><i>ウキウキモード 起動</i></a></c><d=20>

全可動部 機能ヲ確認<d=20> 有機生命体ニ感謝シマス。

(1 edit)

Hi great product.  Using it on Critter Cove which is coming out on steam shortly.  Having this same issue with our Japanese translator and it appears to now work without issue with ! but not with periods as shown here.  So is there something I am doing wrong?  See the stranded Japanese . at the end of the sentence.

If its something we need to expand ourselves just point me in the right direction.  Basically our biggest issue right now is just grabbing the character previous to the punctuation and putting the line break before that so that we do not start sentences with punctuation as shown here.  Interesting that it seems you addressed this but for the life of me I cannot seem to consistently get it to work for some reason.  

in V.1.9.1 you can see where I attempted to catch the errors myself but just kept moving the problem.  

 Debug.LogError("SUPERTEXTMESH Index Length Error");

The first error was here.  info was not large enough for i.

                    Font myFont = info[i].fontData != null ? info[i].fontData.font : font; //use info's font, or default?
                                                                                           //info[i].size *= bestFitMulti;


void RebuildTextInfo()
    {
        drawText = ParseText(text); //remove parsing junk (<col>, <b>), and fill textinfo again
        lineBreaks.Clear(); //index of line break characters, for centering
        hyphenedText = string.Copy(drawText);
        CalculateLineHeights(); //figure out line heigts for unwrapped equation
                                //Debug.Log("lines: " + lineHeights.Count);
        Vector3 pos = new Vector3(info.Count > 0 ? info[0].indent : 0f,
                                lineHeights.Count > 0 ? -lineHeights[0] : -size,
                                0f); //keep track of where to place this text

        if (bestFit != BestFitMode.Off)
        {
            FigureOutUnwrappedLimits(pos);
        }
        else
        {
            unwrappedBottomRightTextBounds.x = 1f;
            unwrappedBottomRightTextBounds.y = 1f;
        }
        CalculateBestFitMulti();
        //apply this multi to every letter early
        for (int i = 0; i < hyphenedText.Length; i++)
        {
            info[i].size *= bestFitMulti;
        }

        CalculateLineHeights(); //now with multi applied, redo line heights

        pos.x = info.Count > 0 ? info[0].indent : 0f;
        pos.y = lineHeights.Count > 0 ? -lineHeights[0] : size;
        totalWidth = 0f;
        allFonts.Clear();
        if (AutoWrap > 0f)
        { //use autowrap?

            //TODO see if setting "quality" to be info[i].ch.size has any GC issues, now: 2016-10-26
            for (int i = 0, iL = hyphenedText.Length; i < iL; i++)
            { //first, get character info...
                if (i < info.Count && i < hyphenedText.Count())
                {
                    Font myFont = info[i].fontData != null ? info[i].fontData.font : font; //use info's font, or default?
                                                                                           //info[i].size *= bestFitMulti;

                    myFont.RequestCharactersInTexture(hyphenedText[i].ToString(), GetFontSize(myFont, info[i]), info[i].ch.style);
                    
                    CharacterInfo ch;

                    if (i < info.Count && i < hyphenedText.Count())
                    {
                        if (myFont.GetCharacterInfo(hyphenedText[i], out ch, GetFontSize(myFont, info[i]), info[i].ch.style))
                        { //does this character exist?
                            info[i].ch = ch; //remember character info!
                                             // If the character changed, update the cached sizing values.
                            info[i].UpdateCachedValuesIfChanged();
                            // SetTextGenSettings(info[i], i);
                        }
                        //else, don't draw anything! this charcter won't have info
                        //...is how it USED to work! instead, lets draw it in a fallback font:
                        else
                        {
                            myFont = data.defaultFont;
                            if (myFont.GetCharacterInfo(hyphenedText[i], out ch, GetFontSize(myFont, info[i]), info[i].ch.style))
                            {
                                //change the font on this mesh to the default
                                info[i].fontData = new STMFontData(data.defaultFont);
                                info[i].ch = ch; //remember character info!
                                info[i].UpdateCachedValuesIfChanged();
                                // SetTextGenSettings(info[i], i);
                            }
                        }
                    }
                    else
                    {
                        Debug.LogError("SUPERTEXTMESH Index Length Error");
                    }

                    if (!allFonts.Contains(myFont))
                    { //if this font is not listed yet
                        allFonts.Add(myFont);
                    }
                }
                else
                {
                    Debug.LogError("SUPERTEXTMESH Index Length Error");
                }
            }


Thanks.  Yep upgrading to latest and seeing if it shows up again.  

The repro is tough like you said.  Appears to be related to text that would extend beyond the setup limits of the control AND clicking through ie triggering a full ShowTextAll while its reading in the text.  It appears to be timing based ie it happens, my guess when the text is being rendered out beyond the limits and you try and do a ShowTextAll and immediately set the text to the next statement.  Like you said something in the order of that must be resetting the array vars.  My guess its doing something like setting the next text and array length to the next statement which is shorter then the previous text but rebuild of the previous text is still taking place or gets triggered again.   If I can come up with a hard repro I will pass it along but like I said so far little luck but used to be able to get it 1 out of maybe 5 times etc.

(1 edit)
v1.9.1

Want to confirm this has been fixed.  Repro on this is very hard and cannot repro it consistently so figured I would check if it was already known and fixed (appears after 1.9.1 there was some fixes related to this in v.1.10 but not sure.  This would be a very bad bug to slip through the cracks, especially since it appears to be a timing issue and having text longer then the text container.

  • Fixed array lengths not matching up under specific circumstances.

The error occurred in RebuildTextInfo() at this line.  i was larger the info array.

       Font myFont = info[i].fontData != null ? info[i].fontData.font : font; //use info's font, or default?

Thanks.

IndexOutOfRangeException: Index was outside the bounds of the array. SuperTextMesh.RebuildTextInfo () (at Assets/Clavian/SuperTextMesh/Scripts/SuperTextMesh.cs:2622) SuperTextMesh.Rebuild (System.Single startTime, System.Boolean readAutomatically, System.Boolean executeEvents) (at Assets/Clavian/SuperTextMesh/Scripts/SuperTextMesh.cs:1349) SuperTextMesh.Rebuild (System.Single startTime, System.Boolean readAutomatically) (at Assets/Clavian/SuperTextMesh/Scripts/SuperTextMesh.cs:1327) SuperTextMesh.Rebuild () (at Assets/Clavian/SuperTextMesh/Scripts/SuperTextMesh.cs:1317) SuperTextMesh.set_text (System.String value) (at Assets/Clavian/SuperTextMesh/Scripts/SuperTextMesh.cs:681) 

(1 edit)

I would recommend adding the following additional check here to fix these occasional errors.   (textMesh??false)

I get this sometimes when I need to disable my converse bubble between clicks when doing actions say giving characters things and I want to temp hide the UI and then bring it back.  Granted I should be able to track down the correct timing of this but I know adding this additional check just fixes the issue 100% which is safer.

void SetMesh(float timeValue, bool undrawingMesh){ //0 == start mesh, < 0 == end mesh, > 0 == midway mesh
if( textMesh == null || (textMesh??false))

(1 edit)

Getting two different results of positional layout of text for the following;

What a pretty <c=C47015FF> blue shell</c>

What a pretty blue shell

The 1st text is to low is not properly centered in the text box.


The 2nd one works fine.  Centers correctly within the text box. 

 Vertical limit set to 100, Auto Wrap to 245, anchor Middle Center and Alignment Center.  Best fit off.

Thanks