public MainWindow() { InitializeComponent(); _rpi = new RPi(); _startKnap = new Key(_rpi, Key.ID.P1); _pwm = new PWM(_rpi); _pulseReader = new PulseReader(_rpi, _pwm); _sevenSeg = new SevenSeg(_rpi); _hundredeDisplay = new Led(_rpi, Led.ID.LD1); standartFontSize = 18; enabledColor = new SolidColorBrush(Color.FromArgb(255, 211, 47, 47)); annuller_BT = new Button(); cStyle = new Style(typeof(Border)); // Definerer "Annuller"-knappens udseende annuller_BT.Click += annullerBT_Click; annuller_BT.Width = 185; annuller_BT.Height = 55; annuller_BT.Content = "ANNULLER"; annuller_BT.FontFamily = new FontFamily("Yu Gothic"); annuller_BT.FontSize = standartFontSize; annuller_BT.Name = "ANNULLER"; annuller_BT.HorizontalAlignment = HorizontalAlignment.Left; annuller_BT.VerticalAlignment = VerticalAlignment.Top; annuller_BT.Margin = new Thickness(40, 170, 0, 0); cStyle.Setters.Add(new Setter(Border.CornerRadiusProperty, new CornerRadius(50.0))); annuller_BT.Resources.Add(typeof(Border), cStyle); _sevenSeg.Init_SevenSeg(); _pwm.InitPWM(); }
public void setScore(int score) ///Each player should hold their own score and then set it here { mScore = score; for (int i = 0; i < transform.childCount; i++) { SevenSeg sevSeg = transform.GetChild(i).GetComponent <SevenSeg>(); if (sevSeg != null) { sevSeg.ripScore(); } } }