コード例 #1
0
ファイル: AdvGame.cs プロジェクト: IJkeB/Ekster1
 public static void DrawTextEffect(Rect rect, string text, GUIStyle style, Color outColor, Color inColor, float size, TextEffects textEffects)
 {
     if (textEffects == TextEffects.Outline || textEffects == TextEffects.OutlineAndShadow)
     {
         AdvGame.DrawTextOutline(rect, text, style, outColor, inColor, size);
     }
     if (textEffects == TextEffects.Shadow || textEffects == TextEffects.OutlineAndShadow)
     {
         AdvGame.DrawTextShadow(rect, text, style, outColor, inColor, size);
     }
 }
コード例 #2
0
        public static void DrawTextEffect(Rect rect, string text, GUIStyle style, Color outColor, Color inColor, float size, TextEffects textEffects)
        {
            if (AdvGame.GetReferences().menuManager != null && AdvGame.GetReferences().menuManager.scaleTextEffects)
            {
                size = AdvGame.GetMainGameViewSize().x / 200f / size;
            }

            if (textEffects == TextEffects.Outline || textEffects == TextEffects.OutlineAndShadow)
            {
                AdvGame.DrawTextOutline(rect, text, style, outColor, inColor, size);
            }
            if (textEffects == TextEffects.Shadow || textEffects == TextEffects.OutlineAndShadow)
            {
                AdvGame.DrawTextShadow(rect, text, style, outColor, inColor, size);
            }
        }
コード例 #3
0
        /**
         * <summary>Draws GUI text with an outline and/or shadow.</summary>
         * <param name = "rect">The Rect of the GUI text</param>
         * <param name = "text">The text itself</param>
         * <param name = "style">The GUIStyle that the GUI text uses</param>
         * <param name = "outColour">The colour of the text's outline/shadow</param>
         * <param name = "inColour">The colour of the text itself</param>
         * <param name = "size">The size of the text</param>
         * <param name = "textEffects">The type of text effect (Outline, Shadow, OutlineAndShadow, None)</param>
         */
        public static void DrawTextEffect(Rect rect, string text, GUIStyle style, Color outColor, Color inColor, float size, TextEffects textEffects)
        {
            if (AdvGame.GetReferences().menuManager != null && AdvGame.GetReferences().menuManager.scaleTextEffects)
            {
                size = AdvGame.GetMainGameViewSize().x / 200f / size;
            }

            int    i          = 0;
            string effectText = text;

            if (effectText != null)
            {
                while (text.IndexOf("<color=", i) > 0)
                {
                    int startPos = effectText.IndexOf("<color=", i);
                    int endPos   = 0;
                    if (effectText.IndexOf(">", startPos) > 0)
                    {
                        endPos = effectText.IndexOf(">", startPos);
                    }

                    if (endPos > 0)
                    {
                        effectText = effectText.Substring(0, startPos) + "<color=black>" + effectText.Substring(endPos + 1);
                    }

                    i = startPos + i;
                }

                if (textEffects == TextEffects.Outline || textEffects == TextEffects.OutlineAndShadow)
                {
                    AdvGame.DrawTextOutline(rect, text, style, outColor, inColor, size, effectText);
                }
                if (textEffects == TextEffects.Shadow || textEffects == TextEffects.OutlineAndShadow)
                {
                    AdvGame.DrawTextShadow(rect, text, style, outColor, inColor, size, effectText);
                }
            }
        }