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); }
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(); }
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); } }
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); } }
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(); }
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); } }
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); } }
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)); } }
public static bool JustdidLeftClick(DrawingLayer s) { return(JustdidLeftClick() && IsOn(s)); }
public static bool IsOn(DrawingLayer d) { return(d.GetBound().Contains(GetPos())); }
public DrawingLayerWithVector(DrawingLayer d, Point v) { drawingLayer = d; Vector = v; }
public void AddMenu(DrawingLayer menu, Point p, string s) { MenuList.Add(new DrawingLayerWithVector(menu, p)); MenuStringList.Add(s); }
public void SetFrame(DrawingLayer frame) { Frame = frame; }
public void Add(DrawingLayer d, int t) { Animationlist.Add(new DrawingLayerWithTimer(d, t)); }
public void AttachTo(DrawingLayer d) { drawingLayer.SetPos(Method2D.Add(d.GetBound().Location, Vector)); }
public static bool JustdidRightClick(DrawingLayer s) { return(JustdidRightClick() && s.GetBound().Contains(GetPos())); }
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); }
public DrawingLayerWithTimer(DrawingLayer d, int t) { drawingLayer = d; Timer = t; }