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; } } }
resolved: there problem positioning: after using rect transform instead of padding of layout group works espected.
Comments
Post a Comment