Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Lautaro on February 13, 2014, 07:46:30 AM

Title: Using sprite from atlas for spriteRenderer
Post by: Lautaro on February 13, 2014, 07:46:30 AM
The NGUI sprite atlas i use for the gui has a sprite i need for the game world. Can i use it with a normal unity SpriteRenderar through code? How?
Title: Re: Using sprite from atlas for spriteRenderer
Post by: ArenMook on February 14, 2014, 05:56:44 AM
SpriteRenderer is Unity2D, and is a completely different system. You won't be able to use it. NGUI can draw 2D sprites (UI2DSprite), but 2D sprites can't draw NGUI sprites.
Title: Re: Using sprite from atlas for spriteRenderer
Post by: Lautaro on February 14, 2014, 12:28:08 PM
I thought so, since Unity2D is a newer function right? So then i will make NGUI Atlases for the gui and go the other way for the in screen sprites. :)
Title: Re: Using sprite from atlas for spriteRenderer
Post by: ArenMook on February 15, 2014, 01:07:37 AM
Unity 2D stuff is a part of Unity, and knows nothing about NGUI. NGUI is a plugin, it wouldn't make sense for the core tech to know something about plugins.
Title: Re: Using sprite from atlas for spriteRenderer
Post by: Lautaro on February 15, 2014, 01:36:47 PM
Ofcourse. I was more thinking in the line of NGUI yet not adapted to Unity2D.
Title: Re: Using sprite from atlas for spriteRenderer
Post by: ArenMook on February 16, 2014, 02:13:16 AM
It will be once Unity 4.5 (or 4.6?) comes out, because that's when the missing script functionality gets added. Right now 2D is incomplete and has no way of retrieving some important information on the scripting side. 2D in 4.3 was not meant to be scriptable.