Author Topic: Random Positions  (Read 4211 times)

apple741

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Random Positions
« on: June 01, 2014, 01:45:52 AM »
Hello,

I've also noticed some times the grid goes off screen even though I can Constrain to Panel selected, I think this is because my panel extends further than my Game view, is there a way to control the size of the panel?

Thanks!
« Last Edit: June 01, 2014, 05:01:37 PM by apple741 »

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Random Positions
« Reply #1 on: June 01, 2014, 03:07:50 PM »
My brain's having real trouble parsing your post.

A UIGrid moves its child transforms by the cell size defined on the script. It does not account for screen size, Panel clipping area or anything like that. You have to define how many columns or rows you want.

If you put the grid inside a UIPanel, then you can define a clip range, wherein the content (UIGrid + children) will be able to Clip within the area defined on the UIPanel.

Does this help you?

apple741

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: Random Positions
« Reply #2 on: June 01, 2014, 04:40:40 PM »
Hi Nicki,

Sorry for the confusion, it seems you understood my question correctly anyway :) and solved my issue :D

I have some items in my grid that are smaller than others and that leads to extra spacing between it and the other grid elements when moving items around, any thoughts on how to correct this?

Thanks Nicki!
« Last Edit: June 01, 2014, 05:01:14 PM by apple741 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Random Positions
« Reply #3 on: June 01, 2014, 05:42:08 PM »
Spacing between grid items is always fixed. Grid = fixed cell size. If you want variable cell size, you should be using a table instead.