Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: mkgame on July 14, 2016, 04:00:48 PM

Title: UIPopupList with sprite/texture
Post by: mkgame on July 14, 2016, 04:00:48 PM
Hello,

the UIPopupList supports UILabels (and an object, for whatever it is), but not sprites or textures. Is there is simple solution to make a player color selection popup list (or somehow a color selection UI component)? I just want to select one of 8 predefined colors, which should be presented as a texture and not as text. The UIPopupList is pretty long for what it does, and patching that file would be my last option.

Thanks in advance for help!
Title: Re: UIPopupList with sprite/texture
Post by: mkgame on July 15, 2016, 06:02:04 AM
I found a quick hack, streching the 'l', or similar to a rectangle works as color selection. The text can be colorized with [99ff00]l[-]. The UIPopupList should somehow manage UIPanels instead of just a text. That would be a much more valuable component, so we could decide what we put on the panel.
I'm making a strategy game, game creation panel where at least an icon (because it is a game, not an application for office) and text is needed. I need a popop menu at selecting the AI/Human, at selecting the race, the group and the color.
Title: Re: UIPopupList with sprite/texture
Post by: ArenMook on July 15, 2016, 11:56:01 PM
You can add an emoticon to your text used by the popup list -- even a plain square will do. You can then color it like you did with the [99ff00] method.

Try it with the NGUI's Wooden Atlas / Arimo font found in the Examples folder. You can add a smiley face emoticon to your items in the popup list.