Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

MikkelSkovby

4
Posts
1
Topics
A member registered Jan 06, 2023

Recent community posts

Aha - very cool samples, and super useful to know. Thanks again! :)

ParseText_info.submeshChange = true; did the trick! thank you very much, saved me a bunch of time, very kind of you to assist with this! :)

I didn't need to add the "em" tag to the "ignore single-use tags", but I can see that the q tag is in there, so I'll keep it in mind for later.

It would be a cool feature to be able to have gameobjects inline with the text as well, but the scaling might be tough to figure out :)

The LoadTexture funtion looks like this, loading the texture from a file outside of the Unity asset system. When using the "T" to create a quad like you suggested, it's still creating an asset inside Unity, and I can't do this in my use case since the users can upload their own images at runtime.

Below the code in text form if you want to try it out - I just inserted my custom case below the case "<q=": section in the SuperTextMesh.cs.

 private Texture2D LoadTexture()

    {

        Texture2D texture = new Texture2D(2, 2);

string basePath = "D:\\Test\\";

        FileInfo fi = new FileInfo(Path.Combine(basePath, ParseText_myString + ".png"));

        if (fi.Exists)

        {

            if (texture.LoadImage(File.ReadAllBytes(fi.FullName)))

            {

            }

            else

            {

                // uh oh

            }

        }

        return texture;

    }

case "<em=":

                            ParseText_info.quadData = ScriptableObject.CreateInstance<STMQuadData>();

                            Texture2D texture = LoadTexture();

                            ParseText_info.quadData.texture = texture;

                            ParseText_info.quadData.filterMode = FilterMode.Trilinear;

                            ParseText_info.isQuad = true;

                            insertAfter = "\u2000";

                            break;


and the texture I am trying to load:


Hello

First, thanks for a great asset :)

I am trying to load custom images as a quad inline with the text using a custom tag like this:

unfortunately it is just displayed like this (this is the size of one character):

I tried changing the filtermode, but hoping you have some other ideas?

The texture loading works just fine when assigning the texture to a regular quad in unity.

Best Regards

Mikkel