Class FileBrowserUI
Built-in file brower entity for PC only
Constructors
FileBrowserUI()
Declaration
public FileBrowserUI()
Properties
BackgroundRect
Rect position for background range in global space
Declaration
public IRect BackgroundRect { get; }
BlockEvent
True if this UI blocks mouse button event
Declaration
protected override bool BlockEvent { get; }
Overrides
CurrentFolder
Path of the current browsing folder
Declaration
public string CurrentFolder { get; set; }
CurrentName
Name of the current selecting file/folder
Declaration
public string CurrentName { get; set; }
Instance
Global single instance for this class
Declaration
public static FileBrowserUI Instance { get; }
SearchPatterns
Files that will be display inside the content panel
Declaration
public string[] SearchPatterns { get; }
ShowingBrowser
True if the entity is currently displaying
Declaration
public static bool ShowingBrowser { get; }
Title
Title of the current window
Declaration
public string Title { get; set; }
Methods
BeforeUpdate()
[2/4] This function is called every frame when entity is in stage. Prioritize using this function to update physics logic.
Declaration
public override void BeforeUpdate()
Overrides
FirstUpdate()
[1/4] This function is called every frame when entity is in stage. Prioritize using this function to fill collider in to physics system.
Declaration
public override void FirstUpdate()
Overrides
OnActivated()
This function is called when entity enter the stage
Declaration
public override void OnActivated()
Overrides
OpenFile(string, Action<string>, params string[])
Start file browser for open an existing file
Declaration
public static void OpenFile(string title, Action<string> onFileOpen, params string[] searchPatterns)
Parameters
Type | Name | Description |
---|---|---|
string | title | Title of the window |
Action<string> | onFileOpen | Callback function for a file being open |
string[] | searchPatterns | Which file should be display. eg.".png", ".jpg" |
OpenFolder(string, Action<string>)
Start file browser for open an existing folder
Declaration
public static void OpenFolder(string title, Action<string> onFolderOpen)
Parameters
Type | Name | Description |
---|---|---|
string | title | Title of the window |
Action<string> | onFolderOpen | Callback function for a folder being open |
SaveFile(string, string, Action<string>, params string[])
Start file browser for create/save a file
Declaration
public static void SaveFile(string title, string defaultFileNameWithExt, Action<string> onFileSaved, params string[] searchPatterns)
Parameters
Type | Name | Description |
---|---|---|
string | title | Title of the window |
string | defaultFileNameWithExt | Default name shown in the input field. eg. "name.png" |
Action<string> | onFileSaved | Callback function for the file being create/save |
string[] | searchPatterns | Which type of file is allowed be create/save. eg.".png", ".jpg" |
SaveFolder(string, string, Action<string>)
Start file browser for create/save a folder
Declaration
public static void SaveFolder(string title, string defaultFolderName, Action<string> onFolderSaved)
Parameters
Type | Name | Description |
---|---|---|
string | title | Title of the window |
string | defaultFolderName | Default name shown in the input field |
Action<string> | onFolderSaved | Callback function for the folder being create/save |
UpdateUI()
Declaration
public override void UpdateUI()