Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Biggix on August 07, 2016, 12:57:58 PM

Title: Embed UISprite into UILabel as bbcode
Post by: Biggix on August 07, 2016, 12:57:58 PM
Hi,

I need to embed a sprite from an existing atlas, into an UILabel string of characters (using atlased fonts), basically replacing one of the letters with a scaled sprite from other atlas (not the text one). These are not emoticons but in-game item images.

How could this be done?
Title: Re: Embed UISprite into UILabel as bbcode
Post by: ArenMook on August 08, 2016, 05:52:24 PM
Select the font and add the sprite as a symbol. This only works if the sprite is in the same atlas as the font.

There is no way to reference sprites or images that are not in the same atlas.
Title: Re: Embed UISprite into UILabel as bbcode
Post by: Biggix on August 09, 2016, 03:53:50 AM
Well thank you so much for another "blabla" reply. My question was exactly HOW TO ADD THE SPRITE FROM ANOTHER ATLAS. For gods sake I understand that there is no way to do it as of now. The question was, how to implement this.

In fact I just posted here to see how you are going to avoid the question again. The support for your product is non-existent. NGUI is not developing. No features are added despite hundreds of users requests. You do not seem to be a nice person at all. I never received a helpful reply on ANY question that I had.


Title: Re: Embed UISprite into UILabel as bbcode
Post by: ArenMook on August 09, 2016, 06:19:29 AM
NGUI was written so that you can have only one material per widget due to each widget having only one OnFill function. What you are trying to do requires two materials per widget -- one to draw the text, and another to draw the sprite. This is why it's not something I can advise you on. You need two distinct widgets for that and there is no simple way of getting it to work short of redesigning NGUI's core functionality or some ugly hacks. The latter approach involves creating a custom widget that would print out the string like a label would, figure out the positions of all the glyphs -- then would fill the draw buffer replacing the glyphs with sprites.

Now as for your reply... If I'm not helping, I can just stop trying to answer your questions.