User avatar
aliagha.huseynli
Topic Author
Posts: 44
Joined: 29 Mar 2023, 10:17

noesis RichText [img] doen't work

15 Dec 2023, 08:39

Hi,

I read the documentation you prepared
https://www.noesisengine.com/docs/App.A ... hText.html
everything works unless
[img][/img]
still raises the error invalid URL, but I tried many possibilities such as:
[img]Myimage.png[/img]
[img]Assets/Images/Myimage.png[/img]
[img]Images/Myimage.png[/img]
[img]MenuView/Myimage.png[/img]
It doesn't work

Blend error:
Error	XDG0010	Invalid URI: The format of the URI could not be determined
Unity error(this happens when I add link inside img /img. not in local image file):
 [NOESIS/E] Image not found '/cdn-cgi/image/w=1000,fit=contain,q=90,f=auto/library/content/images/size/w600/2023/10/free-images.jpg'
If I write weburl between img link shown in Blend side but it raises error in Unity side
Last edited by aliagha.huseynli on 19 Dec 2023, 13:59, edited 2 times in total.
 
dengfan
Posts: 16
Joined: 19 Nov 2023, 10:32

Re: noesis RichText [img] doen't work

16 Dec 2023, 13:01

屏幕截图 2023-12-16 200038.png
try add this line.
 
User avatar
aliagha.huseynli
Topic Author
Posts: 44
Joined: 29 Mar 2023, 10:17

Re: noesis RichText [img] doen't work

17 Dec 2023, 13:05

Where should I add this line? Could you please be more specific about what I should do to fix this issue?
 
dengfan
Posts: 16
Joined: 19 Nov 2023, 10:32

Re: noesis RichText [img] doen't work

17 Dec 2023, 13:15

I use the native sdk, It may not be quite the same as yours.
Look at bottom of this topic viewtopic.php?t=3145
 
User avatar
aliagha.huseynli
Topic Author
Posts: 44
Joined: 29 Mar 2023, 10:17

Re: noesis RichText [img] doen't work

18 Dec 2023, 06:35

No, unfortunately, it is not what I am facing. I said RichText works. I can see bold italic style changing color. Even weblink url text works. But I am unable to add local image file.
I follow the documentation. It says url invalid for img /img.
 
dengfan
Posts: 16
Joined: 19 Nov 2023, 10:32

Re: noesis RichText [img] doen't work

18 Dec 2023, 07:41

I've tried, you just initialize noesis as required, you can display the local image in bbcode.
Ptr<XamlProvider> xamlProvider = ...;
Ptr<LocalFontProvider> myFontProvider = ...;
Ptr<LocalTextureProvider> myTextureProvider = MakePtr<LocalTextureProvider>(".");
NoesisApp::SetThemeProviders(xamlProvider, myFontProvider, myTextureProvider);
 
User avatar
jsantos
Site Admin
Posts: 3931
Joined: 20 Jan 2012, 17:18
Contact:

Re: noesis RichText [img] doen't work

18 Dec 2023, 11:33

It seems the problem is that in Unity, rich text is not adding dependencies to the images it uses. For now, the workaround is manually registering these dependencies, as explained in the Unity tutorial.
 
User avatar
aliagha.huseynli
Topic Author
Posts: 44
Joined: 29 Mar 2023, 10:17

Re: noesis RichText [img] doen't work

19 Dec 2023, 13:57

I read this https://www.noesisengine.com/docs/App.A ... hText.html
The problem is not Unity for my first example.
As I said in this code everything works except img:
<Grid
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions">
  <TextBlock noesis:RichText.Text="Plain. [b]Bold, [i]bold italic, [/i]
    [size=60]Size 60 text.[/size] [color=Red]Red text.[/color] [img height=80]disk.png[/img]
    [br/] [url='https://www.noesisengine.com/']NoesisEngine.com[/url]" />
</Grid>
I know I should add myLocalImage.png. When I delete
[img height=80]ANYIMAGEFILE.png[/img]
it works fine. I can see bold italic red so on.
I even tried many paths for my .png file. It doesn't work. Error code I shared in the first post.
(I see this error in Blend not in Unity, my Unity error is different check the first post please)

Anyway, I fixed my issue, I used only textblock's Run and InlineUIContainer. But it would be better I could use noesis richtext
 
User avatar
jsantos
Site Admin
Posts: 3931
Joined: 20 Jan 2012, 17:18
Contact:

Re: noesis RichText [img] doen't work

19 Dec 2023, 19:24

There is a limitation (not well documented) with RichText. The tag [img] requires absolute URIs (eg: Assets/Samples/NoesisGUI/3.2.2/Localization/Flag-en.png). With this and manually registering the dependencies in the XAML, this should work.

Please, create a ticket to see if we can improve the implementation to be more flexible.

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests