private void InitTextWindow() { UIScrollWindow textWindow = new UIScrollWindow(); textWindow.Position = new Vector2(300, 300); textWindow.ScrollPanel.Restriction = ScrollRestriction.Vertical; textWindow.Size = new Vector2(0, 180); textWindow.AddConstraint(Edge.Bottom, null, Edge.Bottom, 5); textWindow.AddConstraint(Edge.Horizontal, null, Edge.Horizontal, 5); string text = NativeFile.ReadAllText(Path.Combine(Environment.CurrentDirectory, "Lorem Ipsum.txt")); UILabel label = new UILabel(text, true); label.AddConstraint(Edge.TopLeft, textWindow.ScrollPanel, Edge.TopLeft, ConstraintCategory.Initialization); label.AddConstraint(Edge.Right, textWindow.ScrollPanel, Edge.Right, ConstraintCategory.Initialization); textWindow.AddChild(label); uiManager.Add(textWindow); }
/// <summary> /// Compiles an effect from file. /// </summary> /// <param name="filePath">The file path.</param> /// <param name="flags">The flags.</param> /// <param name="macros">The macrosArgs.</param> /// <param name="includeDirectoryList">The include directory list.</param> /// <param name="alloDynamicCompiling">Whether or not to allow dynamic compilation.</param> /// <param name="dependencyFilePath">Path to dependency files.</param> /// <returns>The result of compilation.</returns> public EffectCompilerResult CompileFromFile(string filePath, EffectCompilerFlags flags = EffectCompilerFlags.None, List <EffectData.ShaderMacro> macros = null, List <string> includeDirectoryList = null, bool alloDynamicCompiling = false, string dependencyFilePath = null) { return(Compile(NativeFile.ReadAllText(filePath, Encoding.UTF8, NativeFileShare.ReadWrite), filePath, flags, macros, includeDirectoryList, alloDynamicCompiling, dependencyFilePath)); }