Author Topic: Anchoring Board Game Object to Panel  (Read 3297 times)

rookie_coder

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 14
    • View Profile
Anchoring Board Game Object to Panel
« on: February 18, 2014, 05:33:39 PM »
I have a 8*8 Game Board (GameObject). It is made up of Cubes. I want the Game Board to be contained and anchored to a Panel, so that when the Panel resizes based on the platform, Web or mobile, the GameBoard resizes accordingly. Is there a way to do this in NGUI? Any examples?

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Anchoring Board Game Object to Panel
« Reply #1 on: February 19, 2014, 12:26:34 PM »
Panel has no rectangle unless you enable clipping. Furthermore you can't anchor game object. You can only anchor widgets.

Easiest thing to do in your case is to just write a custom script that will position its children based on some dimensions of your choice by splitting them into rows and columns.