/// <summary> /// 拉线 /// </summary> public void DrawLine() { gameObject.SetActive(true); m_curType = drawType.Line; m_curline = new VectorLine("Line", points, m_matLine, 3.0f, LineType.Discrete, Joins.Weld); m_pLine.Add(m_curline); }
/// <summary> /// 默认先画框 /// </summary> /// <param name="_actRect"></param> public void ChooseRect(Action <Rect> _actRect) { // 清除之前 CleanLine(); squareLine = new VectorLine("Square", new Vector2[8], m_matLine, 3.0f, LineType.Discrete, Joins.Weld); m_pLine.Add(squareLine); gameObject.SetActive(true); m_actCutPic = _actRect; m_curType = drawType.Rect; }
/// <summary> /// Maps the type of the draw /// </summary> /// <param name="drawType">Type of the draw</param> /// <param name="restTypeSpecified">if set to <c>true</c> [rest type specified]</param> /// <returns>DrawType</returns> public static DrawType MapDrawType(drawType drawType, bool restTypeSpecified) { if (!restTypeSpecified) { return(DrawType.Unknown); } if (drawType == drawType.drum) { return(DrawType.Drum); } return(DrawType.Rng); }
private void drawLines(List<TextPos> list, drawType type) { foreach (TextPos textPos in list) { Point start = textBox.GetPositionFromCharIndex(textPos.Start); Point end = textBox.GetPositionFromCharIndex(textPos.End); // The position above now points to the top left corner of the character. // We need to account for the character height so the underlines go // to the right place. end.X += 1; start.Y += TextBoxAPIHelper.GetBaselineOffsetAtCharIndex(textBox, textPos.Start); end.Y += TextBoxAPIHelper.GetBaselineOffsetAtCharIndex(textBox, textPos.End); if (start.X == -1 || end.X == -1) continue; // Draw the wavy underline/mark if (start.Y < end.Y) { switch (type) { case drawType.Wave: DrawWave(start, new Point(textBox.Width - 3, start.Y)); DrawWave(new Point(3, end.Y), end); break; case drawType.Mark: DrawMark(start, new Point(textBox.Width - 3, start.Y)); DrawMark(new Point(0, end.Y), end); break; } } else switch (type) { case drawType.Wave: DrawWave(start, end); break; case drawType.Mark: DrawMark(start, end); break; } } }
//Constructor given vector direction public Bullet(AnimatedTexture t, Vector2 p, Vector2 d, Color c, drawType ty) : base(t, p, d, c, ty) { }
public Bullet(AnimatedTexture t, Vector2 p, float a, float s, Color c, drawType ty) : base(t, p, a, s, c, ty) { }
//Constructor given vector direction public Bullet(Texture2D t, Vector2 p, Vector2 d, Color c, drawType ty) : base(t, p, d, c, ty) { }
public Sprite(AnimatedTexture t, Vector2 p, Vector2 d, Color c, drawType ty) { imgA = t; pos = p; dir = d; type = ty; angle = MathHelper.ToDegrees((float)Math.Atan2(dir.Y, dir.X)) + 90.0f; speed = (float)Math.Sqrt(d.X * d.X + d.Y * d.Y); dim = t.dim; color = c; }
public Sprite(AnimatedTexture t, Vector2 p, float a, float s, Color c, drawType ty) { imgA = t; pos = p; angle = a - 90.0f; speed = s; type = ty; radians = MathHelper.ToRadians(angle); dir = new Vector2((float)Math.Cos(radians), (float)Math.Sin(radians)); dim = t.dim; color = c; }
public Sprite(Texture2D t, Vector2 p, Vector2 d, Color c, drawType ty) { img = t; pos = p; dir = d; type = ty; angle = MathHelper.ToDegrees((float)Math.Atan2(dir.Y, dir.X))+90.0f; speed = (float)Math.Sqrt(d.X * d.X + d.Y * d.Y); dim = new Vector2(t.Width, t.Height); color = c; }
public Sprite(Texture2D t, Vector2 p, float a, float s, Color c, drawType ty) { img = t; pos = p; angle = a - 90.0f; speed = s; type = ty; radians = MathHelper.ToRadians(angle); dir = new Vector2((float)Math.Cos(radians), (float)Math.Sin(radians)); dim = new Vector2(t.Width, t.Height); color = c; }
public Orb(Texture2D t, Vector2 p, float a, float s, Color c, drawType ty, float d, float ti) : base(t, p, a, s, c, ty) { damage = d; totalTime = ti; this.c = c; }