protected void DrawBackground() { // Fixme: clear operation once set a color cannot apply transparency if (BackgroundColor != Color.Transparent) { tk.Clear(BackgroundColor); } }
public override void Draw(IDrawingToolkit tk, Area area) { double width, height; /* Compute how we should scale and translate to fit the widget * in the designated area */ width = homeBench.Width * NTeams + field.Width + 2 * NTeams * App.Current.Style.TeamTaggerBenchBorder; height = field.Height; Image.ScaleFactor((int)width, (int)height, (int)Width, (int)Height - BUTTONS_HEIGHT, ScaleMode.AspectFit, out scaleX, out scaleY, out offset); offset.Y += BUTTONS_HEIGHT; tk.Begin(); tk.Clear(BackgroundColor); /* Draw substitution buttons */ if (subPlayers.Visible) { subPlayers.Position = new Point(Width / 2 - BUTTONS_WIDTH / 2, offset.Y - BUTTONS_HEIGHT); subPlayers.Width = BUTTONS_WIDTH; subPlayers.Height = BUTTONS_HEIGHT; subPlayers.Draw(tk, area); } if (homeButton.Visible) { /* Draw local team button */ double x = Position.X + App.Current.Style.TeamTaggerBenchBorder * scaleX + offset.X; homeButton.Position = new Point(x, offset.Y - homeButton.Height); homeButton.Draw(tk, area); } if (awayButton.Visible) { double x = (Position.X + Width - offset.X - App.Current.Style.TeamTaggerBenchBorder * scaleX) - awayButton.Width; awayButton.Position = new Point(x, offset.Y - awayButton.Height); awayButton.Draw(tk, area); } tk.TranslateAndScale(Position + offset, new Point(scaleX, scaleY)); homeBench.Draw(tk, area); awayBench.Draw(tk, area); field.Draw(tk, area); tk.End(); }
public override void Draw(IDrawingToolkit tk, Area area) { double width, height; /* Compute how we should scale and translate to fit the widget * in the designated area */ width = homeBench.Width * NTeams + field.Width + 2 * NTeams * App.Current.Style.TeamTaggerBenchBorder; height = field.Height; Image.ScaleFactor ((int)width, (int)height, (int)Width, (int)Height - BUTTONS_HEIGHT, ScaleMode.AspectFit, out scaleX, out scaleY, out offset); offset.Y += BUTTONS_HEIGHT; tk.Begin (); tk.Clear (BackgroundColor); /* Draw substitution buttons */ if (subPlayers.Visible) { subPlayers.Position = new Point (Width / 2 - BUTTONS_WIDTH / 2, offset.Y - BUTTONS_HEIGHT); subPlayers.Width = BUTTONS_WIDTH; subPlayers.Height = BUTTONS_HEIGHT; subPlayers.Draw (tk, area); } if (homeButton.Visible) { /* Draw local team button */ double x = Position.X + App.Current.Style.TeamTaggerBenchBorder * scaleX + offset.X; homeButton.Position = new Point (x, offset.Y - homeButton.Height); homeButton.Draw (tk, area); } if (awayButton.Visible) { double x = (Position.X + Width - offset.X - App.Current.Style.TeamTaggerBenchBorder * scaleX) - awayButton.Width; awayButton.Position = new Point (x, offset.Y - awayButton.Height); awayButton.Draw (tk, area); } tk.TranslateAndScale (Position + offset, new Point (scaleX, scaleY)); homeBench.Draw (tk, area); awayBench.Draw (tk, area); field.Draw (tk, area); tk.End (); }