public static Cell Custom(Rect rect) { Cell cell = GetCell(); // cell.relativeSize = new Vector2(0,0); cell.pixelSize = rect.size; cell.pixelOffset = rect.position; cell.Activate(); return(cell); }
public static Cell Custom(float posX, float posY, float sizeX, float sizeY) { Cell cell = GetCell(); // cell.relativeSize = new Vector2(0,0); cell.pixelSize = new Vector2(sizeX, sizeY); cell.pixelOffset = new Vector2(posX, posY); cell.Activate(); return(cell); }
public static Cell Custom(float sizeX, float sizeY) { Cell cell = GetCell(); cell.pixelSize = new Vector2(sizeX, sizeY); cell.stackHor = false; cell.stackVer = false; cell.Activate(); return(cell); }
public static Cell Padded(int padding) { Cell cell = GetCell(); cell.relativeSize = new Vector2(1, 1); cell.pixelSize = new Vector2(-padding * 2, -padding * 2); cell.pixelOffset = new Vector2(padding, padding); // cell.pixelResize = new Vector2(-padding*2, -padding*2); cell.Activate(); return(cell); }
public static Cell Padded(int left, int right, int top, int bottom) //padding will not be counted in min size { Cell cell = GetCell(); cell.relativeSize = new Vector2(1, 1); cell.pixelSize = new Vector2(-left - right, -top - bottom); cell.pixelOffset = new Vector2(left, top); // cell.pixelResize = new Vector2(-left-right, -top-bottom); cell.Activate(); return(cell); }
public static Cell RowRel(float size) { Cell cell = GetCell(); cell.stackHor = true; cell.relativeSize = new Vector2(size, 1); // cell.pixelSize = new Vector2(0,0); // cell.pixelOffset = new Vector2(0,0); cell.Activate(); return(cell); }
public static Cell LinePx(float size) { Cell cell = GetCell(); cell.stackVer = true; cell.relativeSize = new Vector2(1, 0); cell.pixelSize = new Vector2(0, size); // cell.pixelOffset = new Vector2(0,0); cell.Activate(); return(cell); }
public static Cell Center(float width, float height) { Cell cell = GetCell(); //cell.relativeSize = new Vector2(0,0); cell.relativeOffset = new Vector2(0.5f, 0.5f); cell.pixelSize = new Vector2(width, height); cell.pixelOffset = new Vector2(-width / 2, -height / 2); // cell.pixelResize = new Vector2(width, height); cell.Activate(); return(cell); }
public static Cell Custom(Cell other) { Cell cell = GetCell(); cell.relativeOffset = other.relativeOffset; cell.relativeSize = other.relativeSize; cell.isLayouted = other.isLayouted; cell.pixelOffset = other.pixelOffset; cell.pixelSize = other.pixelSize; cell.stackHor = other.stackHor; cell.stackVer = other.stackVer; cell.Activate(); return(cell); }
public static Cell Static(float posX, float posY, float sizeX, float sizeY) ///Cell independent from current scroll zoom { Cell cell = GetCell(); cell.pixelSize = new Vector2(sizeX, sizeY); cell.pixelOffset = new Vector2(posX, posY); if (UI.current.scrollZoom != null) { cell.pixelSize /= UI.current.scrollZoom.zoom; cell.pixelOffset = (cell.pixelOffset - UI.current.scrollZoom.scroll) / UI.current.scrollZoom.zoom; } cell.Activate(); return(cell); }