コード例 #1
0
 public static UIComponent Center(this UIComponent component)
 {
     return(component.AddConstraint(new UICenterConstraint()));
 }
コード例 #2
0
 public static UIComponent Width(this UIComponent component, int pixels)
 {
     return(component.AddConstraint(new UIWidthConstraint(pixels)));
 }
コード例 #3
0
 public static UIComponent Bottom(this UIComponent component, int pixels)
 {
     return(component.AddConstraint(new UIPositionConstraint(bottom: pixels)));
 }
コード例 #4
0
 public static UIComponent Left(this UIComponent component, int pixels)
 {
     return(component.AddConstraint(new UIPositionConstraint(left: pixels)));
 }
コード例 #5
0
 public static UIComponent Height(this UIComponent component, int pixels)
 {
     return(component.AddConstraint(new UIHeightConstraint(pixels)));
 }
コード例 #6
0
 public static UIComponent Height(this UIComponent component, float percent)
 {
     return(component.AddConstraint(new UIHeightConstraint(percent)));
 }
コード例 #7
0
 public static UIComponent Width(this UIComponent component, float percent)
 {
     return(component.AddConstraint(new UIWidthConstraint(percent)));
 }
コード例 #8
0
 public static UIComponent Color(this UIComponent component, Color?color)
 {
     return(component.AddConstraint(new UIColorConstraint(color ?? Microsoft.Xna.Framework.Color.Black)));
 }
コード例 #9
0
 public static UIComponent Background(this UIComponent component, Color?color)
 {
     return(component.AddConstraint(new UIBackgroundConstraint(color ?? Microsoft.Xna.Framework.Color.Transparent)));
 }
コード例 #10
0
 public static UIComponent FontSize(this UIComponent component, float fontScale)
 {
     return(component.AddConstraint(new UIFontSizeConstraint(fontScale)));
 }
コード例 #11
0
 /**
  * Define the aspect ratio as a float. Ex: 16:9 ~= 1.78f
  */
 public static UIComponent AspectRatio(this UIComponent component, float ratio)
 {
     return(component.AddConstraint(new UIAspectRatioConstraint(ratio)));
 }