當前位置: 首頁>>代碼示例>>C#>>正文


C# Rect.Pad方法代碼示例

本文整理匯總了C#中UnityEngine.Rect.Pad方法的典型用法代碼示例。如果您正苦於以下問題:C# Rect.Pad方法的具體用法?C# Rect.Pad怎麽用?C# Rect.Pad使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UnityEngine.Rect的用法示例。


在下文中一共展示了Rect.Pad方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Draw

        public void Draw(Rect bouds)
        {

            //PlatformDrawer.DrawStretchBox(bouds, CachedStyles.BreadcrumbBoxStyle, 11);
           

            bouds = bouds.Pad(15,0,0,0);

            var stepButtonRect = new Rect().Align(bouds).WithSize(75, 65);
            var continueButtonRect = stepButtonRect.RightOf(stepButtonRect);

            var stepIconRect = new Rect().WithSize(31, 31).Align(stepButtonRect).AlignVerticallyByCenter(stepButtonRect).Translate(0,7);
            var continueIconRect = new Rect().WithSize(31, 31).Align(continueButtonRect).AlignVerticallyByCenter(continueButtonRect).Translate(0, 7);

            var stepTitleRectr = new Rect().WithSize(75, 20).InnerAlignWithBottomCenter(stepButtonRect).Translate(0,-5);
            var continueTitleRectr = new Rect().WithSize(75, 20).InnerAlignWithBottomCenter(continueButtonRect).Translate(0, -5);


            PlatformDrawer.SetTooltipForRect(stepButtonRect,"Step to the next action");
            PlatformDrawer.DoButton(stepButtonRect,"", CachedStyles.WizardActionButtonStyle, DoStep);

            PlatformDrawer.SetTooltipForRect(continueButtonRect, "Continue normal execution");
            PlatformDrawer.DoButton(continueButtonRect, "", CachedStyles.WizardActionButtonStyle, DoContinue);

            PlatformDrawer.DrawImage(stepIconRect,"StepIcon",true);
            PlatformDrawer.DrawImage(continueIconRect, "PlayIcon", true);

            PlatformDrawer.DrawLabel(stepTitleRectr,"Step",CachedStyles.BreadcrumbTitleStyle,DrawingAlignment.MiddleCenter);
            PlatformDrawer.DrawLabel(continueTitleRectr, "Continue", CachedStyles.BreadcrumbTitleStyle, DrawingAlignment.MiddleCenter);

        }
開發者ID:InvertGames,項目名稱:uFrame.Editor,代碼行數:31,代碼來源:DebugPanelUISystem.cs

示例2: DrawToolip

        private void DrawToolip(Rect alignmentRect)
        {
            var tooltip = Drawer.GetTooltip();
            if (!string.IsNullOrEmpty(tooltip))
            {
                var tooltipHeight = Drawer.CalculateTextHeight(tooltip, CachedStyles.ListItemTitleStyle, 350);

                var infoRect =
                    new Rect().WithSize(350, Math.Max(80, tooltipHeight + 60)).AlignTopRight(alignmentRect).Below(alignmentRect).Pad(0, 15, 15, 0).Translate(-20,0);

                var imageRect =
                    new Rect().WithSize(37, 37).AlignTopRight(infoRect).AlignHorisonallyByCenter(infoRect).Translate(-10, 0);

                Drawer.DrawStretchBox(infoRect, CachedStyles.TooltipBoxStyle, 13);
                Drawer.DrawLabel(infoRect.Pad(15, 15, 15 + 41 + 15, 30), tooltip, CachedStyles.ListItemTitleStyle,
                    DrawingAlignment.MiddleLeft);
                Drawer.DrawImage(imageRect, "InfoIcon", true);

            }
            Drawer.ClearTooltip();
        }
開發者ID:InvertGames,項目名稱:uFrame.Editor,代碼行數:21,代碼來源:DesignerWindow.cs


注:本文中的UnityEngine.Rect.Pad方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。