RenderBox flex() { var flexbox = new RenderFlex( direction: Axis.horizontal, crossAxisAlignment: CrossAxisAlignment.center); flexbox.add(new RenderConstrainedBox( additionalConstraints: new BoxConstraints(minWidth: 300, minHeight: 200), child: new RenderDecoratedBox( decoration: new BoxDecoration( color: new Color(0xFF00FF00) ) ))); flexbox.add(new RenderConstrainedBox( additionalConstraints: new BoxConstraints(minWidth: 100, minHeight: 300), child: new RenderDecoratedBox( decoration: new BoxDecoration( color: new Color(0xFF00FFFF) ) ))); flexbox.add(new RenderConstrainedBox( additionalConstraints: new BoxConstraints(minWidth: 50, minHeight: 100), child: new RenderDecoratedBox( decoration: new BoxDecoration( color: new Color(0xFF0000FF) ) ))); return(flexbox); }
RenderBox textEditable() { var span = new TextSpan("", children: new List <TextSpan> { new TextSpan( "Word Wrap:The ascent of the font is the distance from the baseline to the top line of the font, as defined in the font's original data file.", null), }, style: new TextStyle(height: 1.0f)); var flexbox = new RenderFlex( direction: Axis.vertical, mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center); flexbox.add(this.flexItemBox( new Unity.UIWidgets.rendering.RenderEditable(span, TextDirection.ltr, new _FixedViewportOffset(0.0f), new ValueNotifier <bool>(true), onSelectionChanged: this.selectionChanged, cursorColor: Color.fromARGB(255, 0, 0, 0), maxLines: 100, selectionColor: Color.fromARGB(255, 255, 0, 0), textSelectionDelegate: this) )); span = new TextSpan("", children: new List <TextSpan> { new TextSpan( "Hard Break:The ascent of the font is the distance\nfrom the baseline to the top \nline of the font,\nas defined in", null), }, style: new TextStyle(height: 1.0f)); flexbox.add(this.flexItemBox( new Unity.UIWidgets.rendering.RenderEditable(span, TextDirection.ltr, new _FixedViewportOffset(0.0f), new ValueNotifier <bool>(true), onSelectionChanged: this.selectionChanged, cursorColor: Color.fromARGB(255, 0, 0, 0), maxLines: 100, selectionColor: Color.fromARGB(255, 255, 0, 0), textSelectionDelegate: this) )); span = new TextSpan("", children: new List <TextSpan> { new TextSpan("Single Line:How to create mixin", null), }, style: new TextStyle(height: 1.0f)); flexbox.add(this.flexItemBox( new Unity.UIWidgets.rendering.RenderEditable(span, TextDirection.ltr, new _FixedViewportOffset(0.0f), new ValueNotifier <bool>(true), onSelectionChanged: this.selectionChanged, cursorColor: Color.fromARGB(255, 0, 0, 0), selectionColor: Color.fromARGB(255, 255, 0, 0), textSelectionDelegate: this) , width: 300)); return(flexbox); }
RenderBox textAlign() { var flexbox = new RenderFlex( direction: Axis.vertical, mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center); var height = 120; flexbox.add(this.flexItemBox( new RenderParagraph(new TextSpan(EditorGUIUtility.pixelsPerPoint.ToString() + "Align To Left\nMaterials define how light reacts with the " + "surface of a model, and are an essential ingredient in making " + "believable visuals. When you’ve created a "), textAlign: TextAlign.left), height: height )); flexbox.add(this.flexItemBox( new RenderParagraph(new TextSpan(EditorGUIUtility.pixelsPerPoint.ToString() + "Align To Rgit\nMaterials define how light reacts with the " + "surface of a model, and are an essential ingredient in making " + "believable visuals. When you’ve created a "), textAlign: TextAlign.right), height: height )); flexbox.add(this.flexItemBox( new RenderParagraph(new TextSpan(EditorGUIUtility.pixelsPerPoint.ToString() + "Align To Center\nMaterials define how light reacts with the " + "surface of a model, and are an essential ingredient in making " + "believable visuals. When you’ve created a "), textAlign: TextAlign.center), height: height )); flexbox.add(this.flexItemBox( new RenderParagraph(new TextSpan("Align To Justify\nMaterials define how light reacts with the " + "surface of a model, and are an essential ingredient in making " + "believable visuals. When you’ve created a "), textAlign: TextAlign.justify), height: height )); return(flexbox); }