Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - VamppiV

Pages: [1]
1
NGUI 3 Support / legacy - what means?
« on: November 10, 2014, 03:18:51 PM »
I know it's strange question, but: what means 'legacy' in NGUI context? I was looking in dictionary (english is not my native language) and was definition about "old, outdated". But in NGUI it means, that's not supported and shouldn't be used in new projects? Or how to understand it?

2
NGUI 3 Support / Re: update atlas from script
« on: October 17, 2014, 09:05:07 AM »
Don't try to create atlases at run-time. If you need to pack many textures into one (and in most cases you don't need to), then just use a UITexture and specify a UV rect.
Hm, okey, I remember. But what can I do if I'm making textures in runtime and I have to show them at one screen? It generetes a lot of drawcalls. UV rect? Any simple tutorial? Because I was trying and I completely didn't understand how does it work

3
NGUI 3 Support / Re: update atlas from script
« on: October 16, 2014, 09:43:14 AM »
I need it for do something like this:

newSprite.SetRect(x,y,texWidth,texHeight);
newSprite.atlas = atlas;
newSprite.spriteName=photoAddress;

And it works, but I don't know how to update (or make) atlas. I found class UIAtlasMaker, but I don't know how to use it.

4
NGUI 3 Support / Re: draw call optimization - textures
« on: October 16, 2014, 09:02:47 AM »
Well, the minimal amount of drawcalls is 1 per material. Each UITexture is its own material, each atlas is its own material, each dynamic font is its own material. If you have more than the amount of materials you're using, it's because it's been split up with UIPanels or because of "pancaking" different materials.

You can take a look at this tool I made http://www.tasharen.com/forum/index.php?topic=6166.0 to see how things are pancacked and move them around on depth to get to your minimum.

Now I want pancakes.. dammit.

I don't know why but I doesn't work in my Unity (and it breaks all NGUI). So... I'm all time looking for ideas!

5
NGUI 3 Support / update atlas from script
« on: October 16, 2014, 08:38:09 AM »
I'm looking for the easiest way to update atlas from script. I have UIAtlas and I want put dynamically new photos in. I was trying PackTextures but I wrapped up.

I want to do something easy like this:

public UIAtlas atlas;
Texture2D snap;

void OnClickedAtlasBlaBla(){
atlas.UPDATE(snap);
}

And I'm looking for something like update function. Any ideas?

6
NGUI 3 Support / How to get and destroy a lot of UITexture from script?
« on: October 13, 2014, 12:41:34 PM »
I have script that make new UITextures when is OnEnable().

Now I'm looking how to get this textures to Destroy them on OnDisable(). It's really important to me to destroy OBJECTS.

My hierarchy:
--Panel (here's my script)
----ScrollView
-------Grid
----------Texture
----------Texture
----------...
----------(here I make new textures objects and this objects I want to completely destroy)

7
NGUI 3 Support / Re: draw call optimization - textures
« on: October 13, 2014, 07:39:16 AM »
Well, the minimal amount of drawcalls is 1 per material. Each UITexture is its own material, each atlas is its own material, each dynamic font is its own material. If you have more than the amount of materials you're using, it's because it's been split up with UIPanels or because of "pancaking" different materials.

You can take a look at this tool I made http://www.tasharen.com/forum/index.php?topic=6166.0 to see how things are pancacked and move them around on depth to get to your minimum.

Now I want pancakes.. dammit.

Ok, thanks. If it will work - I'll made you pancakes :D

8
NGUI 3 Support / Re: draw call optimization - textures
« on: October 13, 2014, 04:22:26 AM »
Sounds wise, but I'm just learning NGUI and I get "task" that I have to minimalize draw calls in my project. At this scene I have 6 drawcalls. So maybe any other simple ideas what should I change?

9
NGUI 3 Support / Re: draw call optimization - textures
« on: October 10, 2014, 08:10:07 AM »
Hey,

The idea might be to handle the texture atlas creation at runtime.
You should take a look at Texture2D.PackTextures method : http://docs.unity3d.com/ScriptReference/Texture2D.PackTextures.html.

Sounds good, but if I have about, for example 40 textures and all of them are quite big? Is it all time good idea?

And I see it works at "Start()". Can I use it in other function, eg. OnEnable()?

10
NGUI 3 Support / draw call optimization - textures
« on: October 10, 2014, 04:48:42 AM »
I have at my game a lot of textures that are making "from script" (I'm reading photos from disk and make them into texture). Now every texture generate new drawcall - it's very bad option. How can I change it? Any ideas?

11
NGUI 3 Support / NGUI mixed with GUI
« on: October 08, 2014, 09:01:40 AM »
I wonder: s it good practice to mix NGUI and GUI at one scene?
I ask theoretically :)

12
NGUI 3 Support / Re: photo gallery - how to do?
« on: October 07, 2014, 10:27:05 AM »
Thank you very much :) I've done that, now I have just one problem, this:
"And, I see, it has one big defect: if I put it in function "Start" it doesn't include new photos (app: camera+photo album). If I put it on Update() it will working all time... So: what function? Maybe when I'm coming into "panel album". But how to do that? Or maybe other option?"

13
NGUI 3 Support / Re: how attach script to UITexture by script
« on: October 07, 2014, 06:46:36 AM »
Okey, I'm idiot. newTexture.gameObject.AddComponent<UIDragScrollView>(); works

14
NGUI 3 Support / how attach script to UITexture by script
« on: October 07, 2014, 06:42:24 AM »
How can I attach script to UITexture I've made by script?

I have something like this:

UITexture newTexture;
newTexture = NGUITools.AddWidget<UITexture>(scrollViewObject);
newTexture.SetRect(x,y,texWidth,texHeight);

newTexture.mainTexture=texTmp;

It makes me newTexture in ScrollViewGrid. Now I want to do something like this:
newTexture.AddComponent<UIDragScrollView>();
Of course it doesn't work. So how can I do it better?

15
NGUI 3 Support / photo gallery - how to do?
« on: October 06, 2014, 12:37:14 PM »
Hi :) I'm new on forum (I hope I put this post at good place) and new in NGUI. I have problem, I was trying to do it, but I wasted a lot of time earlier (when I was learning basics) so I decided to ask you for help.

I have to do Photo Gallery. At Android/iOS (if easier, we can focus on Android). Layout similar to this: http://www.techcredo.com/wp-content/uploads/2011/02/quickpic-top-android-image-app-review.jpg

And it's my idea. I hope you tell me is it okey or something I'm thinking wrong.

1. I'm making empty game object. There I have ALBUM CONTROLLER.
2. In ALBUM CONTROLLER I have function that's reading all photos from device and put it into table (first question: how do that?).
3. Next - I'm doing so much GUITextures how I need (count of photos). HOW?
4. And atribute every photo from table to next textures.

It sound in my opinion quite good, but I don't know how to script it.
And, I see, it has one big defect: if I put it in function "Start" it doesn't include new photos (app: camera+photo album). If I put it on Update() it will working all time... So: what function? Maybe when I'm coming into "panel album". But it won't be to slow?

I hope you help me solve my problem. Every idea/tricks will be very helpful. I want to do it good.

(And sorry for my grammar :))

Pages: [1]