VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
void AVR.UEditor.UI.AVR_FA_GlyphHelper_Editor.Glyphs ( List< int >  unicodes,
Font  DisplayFont,
Font  UseFont 
)
inlineprivate

Definition at line 92 of file AVR_FA_GlyphHelper_Editor.cs.

93  {
94  const float button_size = 30;
95  const int fontSize = 16;
96 
97  float max_width = Screen.width - button_size;
98 
99  float width_acc = 0.0f;
100 
101  button_style = new GUIStyle(GUI.skin.button);
102  button_style.margin = new RectOffset(0, 0, 0, 0);
103  button_style.fontSize = fontSize;
104  button_style.font = DisplayFont;
105 
106  scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.Height(500), GUILayout.Width(max_width));
107  GUILayout.BeginHorizontal();
108  for (int i = 0; i < unicodes.Count; i++)
109  {
110  if (width_acc >= max_width)
111  {
112  GUILayout.EndHorizontal();
113  GUILayout.BeginHorizontal();
114  width_acc = 0.0f;
115  }
116 
117  int u = unicodes[i];
118 
119  if(GUILayout.Button(AVR_EditorUtility.Unicode_to_String(u), button_style, GUILayout.Width(button_size), GUILayout.Height(button_size))) {
120  ((AVR_FA_GlyphHelper)target).setup(UseFont, u);
121  show_glyphs = false;
122  }
123 
124  width_acc += button_size + 2; //+2 because inherently there is 1 pixel of padding on each side.
125  }
126  GUILayout.EndHorizontal();
127  EditorGUILayout.EndScrollView();
128  }
static string Unicode_to_String(string unicode)