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 - sisso

Pages: 1 2 [3] 4
31
NGUI 3 Support / Re: Need help with calling tween method
« on: August 23, 2013, 08:17:18 AM »
Open TweenScale.cs and search for static method Begin. Now you know what parameters you could use, and what its return. If you want something different from parameters, it must be applied in the return object. Ex:

  1. var tween = TweenScale.Begin(banner, 1f, Vector3.one * 2f);
  2. tween.from = Vector3.one * 0.5f;

Because it is a simple concept in programing, take a time to study, It will allow you be able to workround some simple problems.

32
NGUI 3 Support / Steps to switch HD/SD at runtime. Approved?
« on: August 22, 2013, 02:47:41 PM »
After reading around what I need to do to switch the HD/SD at runtime, I finished with this steps:

1.  Instead create the reference atlas as prefab like video tutorial, you need to create the reference atlas in each scene, this will allow you to do changes in runtime.
2.  The script that load the atlas from resources must execute before any ngui stuff. Use awake and script execution order.
3. Before a build, you update each scene the reference atlas to point to null, so the default is loaded in memory.
4. For prefabs with sprites (like popups). You must point to null atlas and resolve when instantiated.

Any advice or better solution? A simple "ok, you are not crazy" is a good answer to me :P

33
Hi there,

It is an expected behavior that UITweener didn't respect the "delay" parameter when you call a Play(true) more that one time?

I am using Reset() followed by Play(true) to play again some effects.

[]s,
Sisso

34
Nice, thanks.

35
Only  to confirm, it is ok to use textcord and resize atlas for sprites only?

36
If someone need it.

For simple needs, I simple create a sprite with alpha 0 to make the 3d object bounds. Any other NGUI stuff like drag panels will work fine.

37
Hello,

I am trying to change atlas texture max size but it is broken the labels. These was my steps:

1 - I have everything working nice, sprites, labels, fonts and atlas.
2 - I selected atla texture and changed its max size to 512px
3 -  Every sprites has broken
4 - I reverted the atlas texture max size
5 - Changed atlas to use Text Coords
6 - Resize atlas texture again to 512
7 - Everything works fine, but, when I play and change some scenes every label get broken, but sprites didn't.

If I select the Font prefab, in the preview its show the full atlas, even with Prevew->Font selected.

I haved tryied to change Font sprite to something and get back without success.

If I reimport the font, the importer changes automatically the atlas to pixel coords and max size, but when I did steps 5-7 again, the labels got broken.

If a make changes 5-7 and restart the unity3d it always start with labels broken, I didn't need to play to mess things up.

I am doing something wrong?

Bug in persist stuff?

38
If you need to display 3D models with your 2D UIs, then you should render 3D models into thumbnails (textures) that you then display using the UI. This way the UI stays flat.

Sorry, but it make no sense. The point is that I don't want to use something 2d. 3d model have the ability to rotate, animate and apply effects. I am talking about make integration easy, even if partial.

39
Hi,

Sometimes I need to change some Widget by a 3D model. Most of cases is ok, but some like DraggablePanels restrictions didn't work because it didn't know about 3D bounds.

I was thinking about a UI3dModel computes the bounds my model renderer or by a UIFixedSize where you define your bounds manually.

I understand that some features like shader clipping will not work, but NGUI there is a lot of functionallity and behavior that will be easy to use without duplicate my code.

I am in the correct way?

40
NGUI 3 Support / Re: Easy way to have access to all touches
« on: April 16, 2013, 02:41:45 PM »
Thanks.

But I use from NGUI because mouse and touches are normalized. Between normalize by myself or hack ngui, I take the second one :P

41
NGUI 3 Support / Easy way to have access to all touches
« on: April 16, 2013, 10:30:15 AM »
Hi,

There is some algorithms that is better to have access to all touches instead receive separate events.

Because I didn't found any easy way, I hacked UICamera with the following function:

EDITED > The code below didn't work in some situations in android. It is better to create  your own centralized input.

  1. static public MouseOrTouch[] GetTouches() {
  2.                 var list = new List<MouseOrTouch>();
  3.                 for (int i = 0; i < mMouse.Length; ++i)
  4.                         if (mMouse[i].pressed != null)
  5.                                 list.Add(mMouse[i]);
  6.  
  7.                 for (int i = 0; i < mTouches.Count; ++i)
  8.                         if (mTouches[i].pressed != null)
  9.                                 list.Add(mTouches[i]);
  10.                
  11.                 return list.ToArray();
  12.         }

Questions:

1) There is another way to access this information without change NGUI code?

2) This information could not be provided by I reason, so, I could have problem in use it in "Update"/"LateUpdate" methods?

3) We could have something like it in next release?

Thanks,
Sisso

42
NGUI 3 Support / Re: GetComponentInChildren null when not active
« on: April 11, 2013, 05:34:07 AM »
I will try again in the case of misunderstood.

What I am saying is to not add a script in all children to inform the parent about the change, but change the script that activate to broadcast a new message.

Given the hierrarchy:

  1. root
  2. - group
  3. - - widgets

# Ativate one group script
NGUITools.SetActive(group, true);
parent.BroadcastMessage("AllEnabledYeah");

  1. # group.js
  2. function Start() {
  3.   AllEnabledYeah();
  4. }
  5.  
  6. function Enabled() {
  7.   // ignore, wait for AllEnabledYeah when everything is fully initialized
  8. }
  9.  
  10. function AllEnabledYeah() {
  11.   LabelToEffect.text = "Works";
  12. }

  1. # widgets.js
  2. // no change :P

43
NGUI 3 Support / Re: Pattern to create tabs with ngui?
« on: April 10, 2013, 05:19:27 PM »
Same problem, if you disable on widget in Panel B, after user go back to PanelA, and back again to PanelB, it will appear.

44
NGUI 3 Support / Re: GetComponentInChildren null when not active
« on: April 10, 2013, 04:45:32 PM »
I have wrote right now a problem with tabs with some relation with this. In your case, I think is better to BroadcastMessage an message after activate your objects.

  1. NGUITools.SetActive(parent, true);
  2. parent.BroadcastMessage("AllEnabledYeah");

45
NGUI 3 Support / Pattern to create tabs with ngui?
« on: April 10, 2013, 04:40:44 PM »
Hi there,

I am having alot of problems to create a UI with 2 tabs with enabled/disabled content.

Today I am using NGUI.SetActive to enable/disable tabs and content. Like:

  1. # Tabs.js
  2. function SetActiveTab(current: int) {
  3.         for (var i = 0 ; i < tabs.length ; i++)
  4.                 NGUITools.SetActive(tabs[i], i == current);
  5. }
  6.  
  7. # Tab0.js
  8. functoin Start() {
  9.     NGUITools.SetActive(button, false);
  10. }

When I activate a tab, its activate the disabled button too. OnEnable don't work because parent are enabled before its children.

I can only see some not to good solutions:

1) I must change the hidden content to disable Components instead GameObjects. Like:

  1. # Tab0.js
  2. function Start() {
  3.     for (var c: UIWidgetd in button.GetComponentsInChildren(UIWidgetd)) c.enabled = false;
  4. }

It works, but don't scale, in situations where you create tabs of tabs (or popups with tabs) we will have this problema again.

2) Instead disable, move it offscrean. Smells bad and I will have some problem enabling/disabling Anchors.

3) Broadcast some message after Active to allow any object to disabled again.

  1. NGUITools.SetActive(tab, true);
  2. parent.BroadcastMessage("EnabledAgainHa");
  3.  
Can someone see a better solution for the problem?

Pages: 1 2 [3] 4