예제 #1
0
        private void DrawEachMenuBox(DrawingLayer d, Color EdgeColor, Color InnerColor)        //테두리와 내부를 별도로 그리기 위한 일회성 메소드.
        {
            d.Draw(EdgeColor);
            DrawingLayer Inner = new DrawingLayer("Light", new Rectangle(d.GetPos().X + EdgePixelSize, d.GetPos().Y + EdgePixelSize, d.GetBound().Width - 2 * EdgePixelSize, d.GetBound().Height - 2 * EdgePixelSize));

            Inner.Draw(InnerColor);
        }
예제 #2
0
 public static void DrawString(Camera2D cam, string s, DrawingLayer d, Vector2 vector2, Color color)
 {
     Game1.spriteBatch.Begin(SpriteSortMode.BackToFront,
                             BlendState.AlphaBlend,
                             null,
                             null,
                             null,
                             null,
                             cam.get_transformation(Game1.graphics.GraphicsDevice /*Send the variable that has your graphic device here*/));
     Game1.spriteBatch.DrawString(Standardfont, s, vector2 + new Vector2(d.GetPos().X, d.GetPos().Y), color);
     Game1.spriteBatch.End();
 }
예제 #3
0
 public static void FadeAnimation(DrawingLayer d, int t, Color color)
 {
     if (FadeAnimationList.ContainsKey(color))
     {
         FadeAnimationList[color].Add(d, t);
     }
     else
     {
         FadeAnimationList.Add(color, new AnimationList(1.0 / t));
         FadeAnimationList[color].Add(d, t);
     }
 }
예제 #4
0
 public static void FadeAnimation(DrawingLayer d, int t)
 {
     if (FadeAnimationList.ContainsKey(Color.White))
     {
         FadeAnimationList[Color.White].Add(d, t);
     }
     else
     {
         FadeAnimationList.Add(Color.White, new AnimationList(1.0 / t));
         FadeAnimationList[Color.White].Add(d, t);
     }
 }
예제 #5
0
 public static void DrawString(string FontName, string s, DrawingLayer d, Vector2 vector2, Color color)
 {
     Temporaryfont = Game1.content.Load <SpriteFont>(FontName);
     Game1.spriteBatch.Begin(SpriteSortMode.BackToFront,
                             BlendState.AlphaBlend,
                             null,
                             null,
                             null,
                             null,
                             Standard.MainCamera.get_transformation(Game1.graphics.GraphicsDevice /*Send the variable that has your graphic device here*/));
     Game1.spriteBatch.DrawString(Temporaryfont, s, vector2 + new Vector2(d.GetPos().X, d.GetPos().Y), color);
     Game1.spriteBatch.End();
 }
예제 #6
0
 public static void DrawLight(DrawingLayer d, Color color, float opacity, LightMode lightMode)
 {
     if (lightMode == LightMode.Absolute)
     {
         DrawingLayer AbsoluteLightLayer = new DrawingLayer("WhiteSpace", d.GetBound());
         AbsoluteLightLayer.Draw(color * opacity);
     }
     else if (lightMode == LightMode.Vignette)
     {
         DrawingLayer AbsoluteLightLayer = new DrawingLayer("Light", d.GetBound());
         AbsoluteLightLayer.Draw(color * opacity);
     }
 }
예제 #7
0
        public static bool IsDragging(DrawingLayer s)
        {
            if (JustdidLeftClick(s))
            {
                DraggingLayer = s;
            }

            if (DraggingLayer.Equals(s))
            {
                if (!IsLeftClickingNow())
                {
                    DraggingLayer = new DrawingLayer("WhiteSpace", new Rectangle(0, 0, 0, 0));
                }
            }
            if (DraggingLayer == s)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #8
0
        public ScrollBar(DrawingLayer frame, string BarSpriteName, int BarSize, bool is_vertical, Action ScrollAction)
        {
            Frame      = frame;
            isVertical = is_vertical;
            if (isVertical)
            {
                Interval = Frame.GetBound().Height - BarSize;
            }
            else
            {
                Interval = Frame.GetBound().Width - BarSize;
            }

            ScrollEvent += ScrollAction;

            if (is_vertical)
            {
                Bar = new DrawingLayer(BarSpriteName, new Rectangle(Frame.GetPos(), new Point(Frame.GetBound().Width, BarSize)));
            }
            else
            {
                Bar = new DrawingLayer(BarSpriteName, new Rectangle(Frame.GetPos().X + Interval, Frame.GetPos().Y, BarSize, Frame.GetBound().Height));
            }
        }
예제 #9
0
 public static bool JustdidLeftClick(DrawingLayer s)
 {
     return(JustdidLeftClick() && IsOn(s));
 }
예제 #10
0
 public static bool IsOn(DrawingLayer d)
 {
     return(d.GetBound().Contains(GetPos()));
 }
예제 #11
0
 public DrawingLayerWithVector(DrawingLayer d, Point v)
 {
     drawingLayer = d;
     Vector       = v;
 }
예제 #12
0
 public void AddMenu(DrawingLayer menu, Point p, string s)
 {
     MenuList.Add(new DrawingLayerWithVector(menu, p));
     MenuStringList.Add(s);
 }
예제 #13
0
 public void SetFrame(DrawingLayer frame)
 {
     Frame = frame;
 }
예제 #14
0
 public void Add(DrawingLayer d, int t)
 {
     Animationlist.Add(new DrawingLayerWithTimer(d, t));
 }
예제 #15
0
 public void AttachTo(DrawingLayer d)
 {
     drawingLayer.SetPos(Method2D.Add(d.GetBound().Location, Vector));
 }
예제 #16
0
 public static bool JustdidRightClick(DrawingLayer s)
 {
     return(JustdidRightClick() && s.GetBound().Contains(GetPos()));
 }
예제 #17
0
        public static void DrawAddon(Camera2D cam, DrawingLayer d, Color color, float opacity, string LayerName)
        {
            DrawingLayer AddonLayer = new DrawingLayer(LayerName, d.GetBound());

            AddonLayer.Draw(cam, color * opacity);
        }
예제 #18
0
 public DrawingLayerWithTimer(DrawingLayer d, int t)
 {
     drawingLayer = d;
     Timer        = t;
 }