unity3d - Buttons without background, size, why? -


i want create menu buttons. template button cloned , placed in vertical layout. worked in middle of work there strange effect of rendering text child od button, additionally gameobjects not have width, outside of canvas. on screen , in center template button, goal have 2 columns of buttons on left , right side.

using unityengine; using unityengine.ui;  public class dividedownui : monobehaviour {      void start () {         createbtnsrow(transform.find("panelleft"));         createbtnsrow(transform.find("panelright"));     }      void createbtnsrow(transform panel)     {         for(int = 1; <= 10; i++)         {             gameobject btn = instantiate(transform.find("btntpl").gameobject);             btn.transform.parent = panel;             btn.setactive(true);             btn.transform.find("text").gameobject.getcomponent<text>().text = "" + i;          }     } } 

` editor view

resolved: there problem positioning: after using rect transform instead of padding of layout group works espected. working :)


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -