示例#1
0
    public StructureReusable(Rect drawRect, Texture iconTexture, string title, BlueprintDesign blueprintDesign)
    {
        igrList = new List <IconGroupReusable>();
        labels  = new List <string>();

        this.iconTexture     = iconTexture;
        this.title           = title;
        this.blueprintDesign = blueprintDesign;

        titleStyle           = GUIFunctions.GetStandardGUIStyle(12);
        titleStyle.alignment = TextAnchor.MiddleCenter;
        labelStyle           = GUIFunctions.GetStandardGUIStyle(8);
        labelStyle.alignment = TextAnchor.MiddleLeft;

        titleHeight = titleStyle.CalcSize(new GUIContent("HEIGHT LAWL")).y;

        float iconSize = drawRect.height - titleHeight;

        iconRect  = new Rect(0, 0, iconSize, iconSize);
        titleRect = new Rect(0, 0, drawRect.width, titleHeight);
        listRect  = new Rect(iconRect.width, titleHeight, drawRect.width, iconRect.height);

        background = GUIFunctions.Get1x1Texture(new Color(0f, 1f, 1f, 0.5f));

        BuildIGRList();
    }
示例#2
0
 public PicNameStatusReusable(string label, Texture iconTexture)
 {
     this.iconTexture    = iconTexture;
     this.label          = label;
     textStyle           = GUIFunctions.GetStandardGUIStyle(10);
     textStyle.alignment = TextAnchor.MiddleLeft;
 }
示例#3
0
    void Start()
    {
        fpsRect            = new Rect(Screen.width / 50, 0, 100, 40);
        guiStyle           = GUIFunctions.GetStandardGUIStyle(12);
        guiStyle.alignment = TextAnchor.MiddleLeft;

        StartCoroutine(CalculateFPS());
    }
示例#4
0
    public ResourceReusable(ResourceTypes resourceType, string tooltipText)
    {
        this.resourceType    = resourceType;
        this.tooltipText     = tooltipText;
        valueStyle           = GUIFunctions.GetStandardGUIStyle(16);
        valueStyle.alignment = TextAnchor.MiddleLeft;

        iconTexture = GetResourceTextureFromResourceType(resourceType);
    }
示例#5
0
    public IconGroupReusable(bool alwaysUseTextNumbers)
    {
        this.alwaysUseTextNumbers = alwaysUseTextNumbers;
        iconGroups = new List <IconGroup>();

        textStyle           = GUIFunctions.GetStandardGUIStyle(10);
        textStyle.alignment = TextAnchor.UpperRight;

        moreStyle           = GUIFunctions.GetStandardGUIStyle(10);
        moreStyle.alignment = TextAnchor.MiddleLeft;
    }
示例#6
0
    public StructuresWindow()
    {
        //used in every toolbar window to make a unique id
        windowId       = Toolbar.GetNextWindowID();
        scrollPosition = Vector2.zero;

        windowRect = new Rect(0, 0, Screen.width / 2, Screen.height * 2 / 3);
        windowRect = new Rect(Screen.width / 2 - windowRect.width / 2, Screen.height / 2 - windowRect.height / 2,
                              windowRect.width, windowRect.height);

        scrollRect = new Rect(GUIFunctions.margin, GUIFunctions.heightOfWindowBar,
                              windowRect.width - GUIFunctions.margin * 2, windowRect.height - GUIFunctions.heightOfWindowBar - GUIFunctions.margin);
        rowHeight = Screen.height / 20;

        cellRect     = new Rect(0, 0, Screen.width / 6, rowHeight);
        bigCellRect  = new Rect(0, 0, Screen.width / 4, rowHeight);
        tinyCellRect = new Rect(0, 0, Screen.width / 8, rowHeight);

        rowStyle           = GUIFunctions.GetStandardGUIStyle(10);
        rowStyle.alignment = TextAnchor.MiddleLeft;
    }
示例#7
0
 void Start()
 {
     tooltipStyle                   = GUIFunctions.GetStandardGUIStyle(12);
     tooltipStyle.alignment         = TextAnchor.MiddleCenter;
     tooltipStyle.normal.background = GUIFunctions.Get1x1Texture(new Color(0, .8f, .8f, 0.8f));
 }