public void DrawPoint(MPointF location, float direction) { MPointF unit = new MPointF((float)Math.Cos(direction), (float)Math.Sin(direction)); MPointF speed = unit * 0.0001f; Image.Projs.Add(new Proj(RainbowProjectileType, speed, location + unit * 13)); }
public void DrawChar(char c, MPointF center) { //DrawBorder(center); if (!DefinedCharacters.ContainsKey(c)) { return; } ProjImage img = DefinedCharacters[c]; SourceDrawer.Image.DrawImage(img, center); }
public void DrawBorder(MPointF center) { var left_up = center + new MPointF(-100, -100); var right_up = center + new MPointF(100, -100); var right_down = center + new MPointF(100, 100); var left_down = center + new MPointF(-100, 100); SourceDrawer.DrawLine(left_up, right_up); SourceDrawer.DrawLine(right_up, right_down); SourceDrawer.DrawLine(right_down, left_down); SourceDrawer.DrawLine(left_down, left_up); }
public void DrawString(string s, MPointF center) { int width = LetterWidth * s.Length; int height = LetterHeight; MPointF left_up = new MPointF(center.X - width / 2, center.Y - height / 2); MPointF fc = left_up + new MPointF(LetterWidth / 2, LetterHeight / 2); for (int i = 0; i < s.Length; i++) { DrawChar(s[i], fc); fc += new MPointF(LetterWidth, 0); } }
public void DrawLine(MPointF start, MPointF end) { MPointF dP = end - start; MPointF unit = dP / dP.Length * 40; int count = (int)Math.Ceiling(dP.Length / 40); float dir = (float)Math.Atan2(unit.Y, unit.X); MPointF s = start; for (int i = 0; i < count; i++) { DrawPoint(s, dir); s += unit; } DrawPoint(end, dir); }
public void DrawArc(MPointF center, float radius, float startRadian, float endRadian) { float dRadian = endRadian - startRadian; int count = (int)Math.Round((Math.Abs(dRadian) * radius / 40)) + 2; float unitRadian = dRadian / count; float radian = startRadian; for (int i = 0; i < count; i++) { MPointF point = center + new MPointF((float)Math.Cos(radian), (float)Math.Sin(radian)) * radius; DrawPoint(point, radian + (float)Math.PI / 2); radian += unitRadian; } MPointF last_point = center + new MPointF((float)Math.Cos(radian), (float)Math.Sin(radian)) * radius; DrawPoint(last_point, radian + (float)Math.PI / 2); }
public void Emit(GameContext Context, MPointF Location) { Image.Emit(Context, Location); }
public void Emit(GameContext Context, MPointF Location) { SourceDrawer.Emit(Context, Location); }
public FixedProperties(MPointF Location, MPointF Speed) { this.Location = Location; this.Speed = Speed; }