zoukankan      html  css  js  c++  java
  • Unity UGUI 的RectTransform参数的设置

    http://wuxk2014.lofter.com/post/339d0e_5abfe8c

    nity出了一套比之前好用的UI系统,但是也新出了RectTransform,PosX,PosY....,刚开始可能不知道怎么用代码去更改,但是经过许多的实验之后就会明白一些:

    1.改变RectTransform的top

    GetComponent<RectTransform>().offsetMax = new Vector2(GetComponent<RectTransform>().offsetMax.x, top);

    2.改变RectTransform的bottom

    GetComponent<RectTransform>().offsetMin = new Vector2(GetComponent<RectTransform>().offsetMin.x, bottom);

    3.改变RectTransform的width,height

    GetComponent<RectTransform>().sizeDelta = new Vector2(width, height);

    4.改变RectTransform的pos

    GetComponent<RectTransform>().anchoredPosition3D = new Vector3(posx,posy,posz);

    GetComponent<RectTransform>().anchoredPosition = new Vector2(posx,posy);

  • 相关阅读:
    Python进阶-数据库操作
    Python进阶-数据库(MySQL)介绍与基本操作
    Python进阶-网络编程之TCP粘包
    表与表之间的关系
    基本数据类型
    mysql
    io模型
    GIL,线程池与进程池
    线程
    并发编程,进程
  • 原文地址:https://www.cnblogs.com/alps/p/7007342.html
Copyright © 2011-2022 走看看