예제 #1
0
파일: GUI.cs 프로젝트: Joelone/FFWD
 public static bool Button(Rect rect, Texture texture, GUIStyle style)
 {
     if (isRendering)
     {
         Rectangle r = rect;
         if (Camera.FullScreen.Bounds.Contains(r))
         {
             spriteBatch.Draw((Texture2D)texture, r, color);
         }
         if (Input.GetMouseButtonDown(0) && rect.Contains(Input.mousePositionXna))
         {
             return true;
         }
         for (int i = 0; i < Input.touches.Length; i++)
         {
             if (Input.touches[i].phase == TouchPhase.Began && rect.Contains(Input.touches[i].cleanPosition))
             {
                 return true;
             }
         }
     }
     return false;
 }
예제 #2
0
파일: GUILayout.cs 프로젝트: Joelone/FFWD
 // TODO:
 //public static bool Toggle(bool value, GUIContent content, GUIStyle style, GUILayoutOption[] options)
 //public static bool Toggle(bool value, Texture image, GUIStyle style, GUILayoutOption[] options)
 //public static bool Toggle(bool value, Texture image, GUILayoutOption[] options)
 //public static bool Toggle(bool value, string text, GUIStyle style, GUILayoutOption[] options)
 //public static bool Toggle(bool value, GUIContent content, GUILayoutOption[] options)
 private static bool DoToggle(bool value, GUIContent content, GUIStyle style, GUILayoutOption[] options)
 {
     // TODO: Implement this
     return false;
 }
예제 #3
0
파일: GUILayout.cs 프로젝트: Joelone/FFWD
 public static void Label(string text, GUIStyle style)
 {
     // TODO: Implement this
 }
예제 #4
0
파일: GUI.cs 프로젝트: Joelone/FFWD
        public static void Label(Rect rect, string text, GUIStyle style)
        {
            if (isRendering)
            {
                Rectangle r = rect;
                if (Camera.FullScreen.Bounds.Contains(r))
                {
                    Microsoft.Xna.Framework.Vector2 pos = new Microsoft.Xna.Framework.Vector2(r.Location.X, r.Location.Y);

                    if (style.alignment == TextAnchor.MiddleCenter)
                    {
                        Microsoft.Xna.Framework.Vector2 sz = GUI.spriteFont.MeasureString(text);
                        pos += new Microsoft.Xna.Framework.Vector2(Mathf.Floor((rect.width - sz.X) / 2), Mathf.Floor((rect.height - sz.Y) / 2));
                    }

                    spriteBatch.DrawString(GUI.spriteFont, text ?? "", pos, color);
                }
            }
        }