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

Pages: 1 ... 9 10 [11]
NGUI 3 Support / Re: same height of sprite on various aspect ratios?
« on: August 31, 2012, 02:22:50 PM »
can you point me in the right direction, i am not sure how i would do this, but i would try

NGUI 3 Support / sorting the elements in the grid?
« on: August 31, 2012, 09:57:07 AM »

I am adding children to grid element by code. it seems that they are not sorted in sequence
checking/unchecking "sort" in the UIGrid gives different result but not in the sequence i have this list. i made the list public
so i can see what order elements are in the list. it seems alse that in both ways ("sort" checked or not) it does take into account
game object names that are added to the Grid element (elements beginning with "a" get displayed first...)

can i resolve this somehow, maybe using table instead of grid?

NGUI 3 Support / same height of sprite on various aspect ratios?
« on: August 31, 2012, 05:01:04 AM »

I am making a vertical scrollview and it works fine but when i tried it on the phone it does not go all the way down to the bottom
of the screen. i used top-right anchor so it stays in that position.

I tried to use UIStrech but i dont know where to put it and how to set clipping on the dragPanel based on new height?
Any help appreciated!

everything looks good until i place unlit/transparent soft clip shader on the background. then it dissapears, in the scene view i see that in the same place but not visible.

i have this setup

UI Root (2D)
--------Background (this dissapears)

NGUI 3 Support / Re: adding child to grid and modifying prefab? (SOLVED)
« on: August 30, 2012, 01:47:47 PM »
ok i managed to do it properly like this:

  1. using UnityEngine;
  2. using System.Collections;
  4. public class HierarchyTest : MonoBehaviour {
  6.         public GameObject Grid;
  7.         public GameObject Prefab;
  8.         public GameObject DragablePanel;
  11.         void OnClick()
  12.         {
  13.                 GameObject _go = NGUITools.AddChild(Grid,Prefab);
  14.                 _go.GetComponentInChildren<UILabel>().text = Random.Range(0,100).ToString();
  15.        = Random.Range(0,100).ToString();
  17.                 Grid.GetComponent<UIGrid>().repositionNow = true;
  18.                 DragablePanel.GetComponent<UIDraggablePanel>().ResetPosition();
  19.         }
  20. }

NGUI 3 Support / adding child to grid and modifying prefab?
« on: August 30, 2012, 01:15:37 PM »
i have managed to get scrollview, grid and adding children to it to work fine. i have one problem though and that is modifing the child after it was added to the grid. here is the code i have currently (script attached to the button for adding children):

  1. public GameObject Grid;
  2.         public GameObject Prefab; //button with backgroun and label
  4.         void OnClick()
  5.         {
  6.        = Random.Range(0,100).ToString(); // just test to see if i can change the name before it is added to the grid - works!          
  7.                 NGUITools.AddChild(Grid,Prefab).GetComponent<UILabel>().text = Random.Range(0,100).ToString(); //this does not work? i need to modify the label text so that i can get something meaningfull
  8.                 Grid.GetComponent<UIGrid>().repositionNow = true;
  9.         }


i am running this on intel integrated graphics, i know it is capable in running these sorts of things since examples work just fine

NGUI 3 Support / Re: Scrollable panel, working but...
« on: August 30, 2012, 11:37:14 AM »
with other shader it is visible and properly sized, changing shader panel dissapears

NGUI 3 Support / Re: Scrollable panel, working but...
« on: August 30, 2012, 11:30:40 AM »
wrong shader used! now working fine except background dissapears when unlit/transparent softclip shader used

everything is working great except this thing. background panel dissapears when i use unlit/transparent soft clip shader.
without it also works but not as smoothly with this shader, but with this shader background dissapears (even when only background panel is made, no other elements)

what to do? i used sliced sprite as background.

NGUI 3 Support / Scrollable panel, working but...
« on: August 29, 2012, 06:15:19 PM »
i used tutorial to make scroll view (clipped panel way) and it works good but every time panel is scrolled all labels are "greyed out" and it takes a seconds or so to come back, like it is being rebuilt. now your example works perfectly and i want to make something like that. do somebody know what could be the problem here? i verified the materials, disabled all button scripts that make button move/scale change color etc... but nothing worked. i guess there is something that i am missing. i wanted to do it this way because i want the scrollview to be in 3d.


NGUI 3 Support / Input OnSubmit event?
« on: August 28, 2012, 02:11:29 PM »
what am i doing seems to be working but i get the error about event -> "The best match for method OnSubmit has some invalid parameter."

here is the code that i attached to Input control

  1. using UnityEngine;
  2. using System.Collections;
  4. public class InputControl : MonoBehaviour {
  6.         public GameObject InputField;
  8.         void OnEnable()
  9.         {
  10.                 UIEventListener.Get(InputField).onSubmit += OnSubmit;  
  11.         }
  13.         void Start()
  14.         {
  15.                 if(PlayerPrefs.HasKey("Player Name"))
  16.                 {
  17.                         InputField.GetComponent<UIInput>().label.text = PlayerPrefs.GetString("Player Name");
  18.                 }
  21.         }
  23.         void OnSubmit(GameObject go)
  24.         {
  25.                 if(PlayerPrefs.HasKey("Player Name"))
  26.                 {
  27.                         PlayerPrefs.SetString("Player Name", go.GetComponent<UIInput>().text);
  28.                         PlayerControl.Name = PlayerPrefs.GetString("Player Name");
  29.                 }
  30.                 else
  31.                 {
  32.                         Debug.Log("No key");   
  33.                 }
  35.                 Debug.Log("Name: " + PlayerPrefs.GetString("Player Name"));
  36.         }
  37. }

Pages: 1 ... 9 10 [11]