Author Topic: UIGrid  (Read 2819 times)

Nseries

  • Guest
UIGrid
« on: April 07, 2013, 07:22:24 PM »
Hello, i create list using UIGrid script. And have problem with it. I need to resize selected element by OnClick on it.  I was writing simple script, which resize elements inside selected cell. The items are change, but the cell dont resize on bottom. How do I change the size of the cell with element inside it?
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class WarGearItemResize : MonoBehaviour {
  5.  
  6.     public void OnClick()
  7.     {
  8.         SetSprite();
  9.     }
  10.  
  11.  
  12.     void SetSprite()
  13.     {
  14.  
  15.         if (_flag)
  16.         {
  17.             gameObject.transform.localScale =
  18.                 new Vector3(gameObject.transform.localScale.x, 700,
  19.                  gameObject.transform.localScale.z);
  20.             _flag = !_flag;
  21.         }
  22.  
  23.         else
  24.             if (!_flag)
  25.             {
  26.                 gameObject.transform.localScale =
  27.                 new Vector3(gameObject.transform.localScale.x, 518.6f,
  28.                   gameObject.transform.localScale.z);
  29.                 _flag = !_flag;
  30.             }
  31.     }
  32.    
  33. }
  34.  

Sorry for my English :(

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIGrid
« Reply #1 on: April 07, 2013, 07:43:38 PM »
Grid = fixed size. If you want variable size, use a Table.

Nseries

  • Guest
Re: UIGrid
« Reply #2 on: April 08, 2013, 02:35:05 PM »
Ok, I work with UiTable. Explain me please, why if i disable checkbox "Depth Pass", elements on my Panel(UIDraggable Panel) become invisible. But if "Depth Pass" enabled - elements on Panel visible, but there are huge artifacts.
- "Depth Pass" disable
"Depth Pass" enabled
Можно на русском

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIGrid
« Reply #3 on: April 08, 2013, 02:41:28 PM »
Don't use the depth pass option.

You need to bring your dragged panel forward (negative Z position). Check the FAQ post in this forum.

Nseries

  • Guest
Re: UIGrid
« Reply #4 on: April 09, 2013, 04:14:32 AM »
AAAA, what happened? I created new atlas and my old SciFi atlas  become a very low resolution. Why did this happen? How to fix it?