Jump to content

Callbacks on rich text image


photo

Recommended Posts

Hi!

We want to create hyperlink in rich text. Could we somehow realize this with the help of the callbacks on rich text images and how? Or what can you advise me to create hyperlink in huge text if I use only unigine GUI.

Link to comment

Hi Artem!

There is a way to use callbacks (for a whole widget) to open a certain URL in a browser. But the words "huge text" and "rich text images" you've mentioned confuse me a bit. So, could you please describe your use case, what exactly do you want to implement?

Thank you!

Link to comment

fox, I try to explain.

We have, for example, text in only one Label (see attach). This text is from xml file. Green text (or images instead green text) is hyperlink. If I click on green text then image or node viewer should be opened in another window. Is it real to do so or not?

explain.png

Link to comment

Just a follow-up question: does "opened in another window" mean, another window of your UNIGINE-based application, or it is some external application you're talking about?

Rich text formatting in UNIGINE's widgets has a limited set of supported tags (namely: br, left, right, center, p,  image, table, tr, td, font, sup, sub, b, i, bi ), there's no <a></a> tag .

Moreover, in case of a Label widget you cannot get selected text or cursor position other than in screen coordinates, this means you'll have to either split your text into multiple label widgets and set onClick callbacks for the ones, that represent hyperlinks, or define clickable areas on your label widget's canvas (like an image map in html) and specify a link for each of them. In both cases resizing and scrolling the text area will be quite complicated.

Maybe it's worth considering Qt or ImGUI as a solution for your task.

Thank you!

Link to comment
×
×
  • Create New...