public void DrawRelative(Color color, Color border_color, AGT_Text label, float x_offset, float y_offset) { _line_points[0].X = (float)(label.X) + x_offset; _line_points[0].Y = (float)((label.Y - 1)) + y_offset; _line_points[1].X = (float)(_line_points[0].X + label.Width); _line_points[1].Y = (float)(_line_points[0].Y); _line.Draw(_line_points, border_color); _line_points[0].X = (float)(label.X) + x_offset; _line_points[0].Y = (float)((label.Y + 1)) + y_offset; _line_points[1].X = (float)(_line_points[0].X + label.Width); _line_points[1].Y = (float)(_line_points[0].Y); _line.Draw(_line_points, border_color); _line_points[0].X = (float)((label.X + 1)) + x_offset; _line_points[0].Y = (float)(label.Y) + y_offset; _line_points[1].X = (float)((label.X + label.Width - 1)) + x_offset; _line_points[1].Y = (float)(label.Y) + y_offset; _line.Draw(_line_points, label.Background); label.DrawMessageRelative(color, x_offset, y_offset); }
public void Draw(Color color, Color border_color, AGT_Text label) { _line_points[0].X = (label.X); _line_points[0].Y = (float)(label.Y - 1); _line_points[1].X = (float)(_line_points[0].X + label.Width); _line_points[1].Y = (float)(_line_points[0].Y); _line.Draw(_line_points, border_color); _line_points[0].X = (float)(label.X); _line_points[0].Y = (float)(label.Y + 1); _line_points[1].X = (float)(_line_points[0].X + label.Width); _line_points[1].Y = (float)(_line_points[0].Y); _line.Draw(_line_points, border_color); _line_points[0].X = (float)(label.X + 1); _line_points[0].Y = (float)(label.Y); _line_points[1].X = (float)(label.X + label.Width - 1); _line_points[1].Y = (float)(label.Y); _line.Draw(_line_points, label.Background); label.DrawMessage(color); }
public void DrawRelative(Color color, Color border_color, AGT_Text label, float x_offset, float y_offset) { _line_points[0].X = (float)(label.X)+ x_offset ; _line_points[0].Y = (float)((label.Y - 1))+ y_offset; _line_points[1].X = (float)(_line_points[0].X + label.Width); _line_points[1].Y = (float)(_line_points[0].Y); _line.Draw(_line_points, border_color); _line_points[0].X = (float)(label.X)+x_offset; _line_points[0].Y = (float)((label.Y + 1)) + y_offset; _line_points[1].X = (float)(_line_points[0].X + label.Width); _line_points[1].Y = (float)(_line_points[0].Y); _line.Draw(_line_points, border_color); _line_points[0].X = (float)((label.X + 1))+ x_offset ; _line_points[0].Y = (float)(label.Y) + y_offset; _line_points[1].X = (float)((label.X + label.Width - 1) )+ x_offset; _line_points[1].Y = (float)(label.Y) + y_offset; _line.Draw(_line_points, label.Background); label.DrawMessageRelative(color, x_offset, y_offset); }
public void Draw(Color color, Color border_color, AGT_Text label) { _line_points[0].X = (label.X ); _line_points[0].Y = (float)(label.Y - 1); _line_points[1].X = (float)(_line_points[0].X + label.Width) ; _line_points[1].Y = (float)(_line_points[0].Y); _line.Draw(_line_points, border_color); _line_points[0].X = (float)(label.X) ; _line_points[0].Y = (float)(label.Y + 1); _line_points[1].X = (float)(_line_points[0].X + label.Width); _line_points[1].Y = (float)(_line_points[0].Y); _line.Draw(_line_points, border_color); _line_points[0].X = (float)(label.X + 1); _line_points[0].Y = (float)(label.Y); _line_points[1].X = (float)(label.X + label.Width - 1) ; _line_points[1].Y = (float)(label.Y); _line.Draw(_line_points, label.Background); label.DrawMessage(color); }
protected void AddLabel(AGT_Pawn p, AGT_Text label_info) { lock (this) { if (!_label_dictionary.ContainsKey(p.Id)) { _label_dictionary.Add(p.Id, label_info); } else { _label_dictionary[p.Id] = label_info; } } }
public void AddMapObject(string id, string texture_reference, float x, float y, float z, Color color, System.Threading.ThreadStart callback) { try { Rectangle measure = Rectangle.Empty; AGT_SpriteId sprite_id; sprite_id.Id = texture_reference; AGT_SpriteResource t = _pawn_sprites.GetTextureDefinition(sprite_id); AGT_Pawn p = new AGT_Pawn(id, t); p.SetPosition(x, y, z); AddPawn(p); measure = _pawn_font.MeasureString(null, p.Id, DrawTextFormat.Center | DrawTextFormat.VerticalCenter, Color.White); AGT_Text text = new AGT_Text(p.Id, _pawn_font); text.Background = color; AddLabel(p, text); AddMotionCalculator(p, callback); } catch (Exception) { } }