public Graph(Graph graph) { foreach (var e in graph.Charas) { var chip = new asd.Chip2D(); chip.Texture = Resource.Font; chip.Scale = new asd.Vector2DF( Consts.CharSize.X / Consts.FontSize.X, Consts.CharSize.Y / Consts.FontSize.Y); chip.Color = e.Value.Color; chip.Position = new asd.Vector2DF(e.Key.Item1 * Consts.CharSize.X, e.Key.Item2 * Consts.CharSize.Y); chip.Src = e.Value.Src; Charas.Add(new Tuple <int, int>(e.Key.Item1, e.Key.Item2), chip); } this.Position = graph.Position; this.Parent = graph.Parent; }
private void AddChip(int x, int y, asd.Color color, int c) { var chip = new asd.Chip2D(); chip.Texture = Resource.Font; chip.Scale = new asd.Vector2DF( Consts.CharSize.X / Consts.FontSize.X, Consts.CharSize.Y / Consts.FontSize.Y); chip.Color = color; chip.Position = new asd.Vector2DF(x * Consts.CharSize.X, y * Consts.CharSize.Y); c -= ' '; float diffX = (c % 16) * Consts.FontSize.X; float diffY = (c / 16) * Consts.FontSize.Y; chip.Src = new asd.RectF(diffX, diffY, Consts.FontSize.X, Consts.FontSize.Y); Charas.Add(new Tuple <int, int>(x, y), chip); }