public void addDot(NetytarButton button) { Ellipse ellipse = new Ellipse(); ellipse.Height = 30; ellipse.Width = 30; ellipse.Fill = solidBrush; ellipse.Stroke = solidBrush; ellipse.StrokeThickness = 10; canvas.Children.Add(ellipse); Canvas.SetLeft(ellipse, Canvas.GetLeft(button) - 8); Canvas.SetTop(ellipse, Canvas.GetTop(button) - 8); ellipses.Add(ellipse); }
public void netytarButton_OnGaze(NetytarButton sender, bool hasGaze) { if (hasGaze) { lastCheckedButton = checkedButton; checkedButton = sender; flashIndependentLine(); InstrumentChest.getChest().Instrument.setNote(checkedButton.Note); GraphicsChest.getChest().NetytarWatched = new Point(Canvas.GetLeft(checkedButton), Canvas.GetTop(checkedButton)); flashSpark(); if (isHold) { chordHolderDots.addDot(checkedButton); } } }
public void generateNetytar() { int baseNote = GraphicsChest.getChest().netytarGenNote; int halfSpacer = horizontalSpacer / 2; int spacer = horizontalSpacer; int firstSpacer = 0; bool isPairRow; for (int row = 0; row < GraphicsChest.getChest().netytarHeight; row++) { for (int col = 0; col < GraphicsChest.getChest().netytarWidth; col++) { #region Is row pair? if (row % 2 != 0) { isPairRow = false; } else { isPairRow = true; } #endregion #region Draw the button on canvas if (isPairRow) { firstSpacer = horizontalSpacer / 2; } else { firstSpacer = 0; } netytarButtons[row, col] = new NetytarButton(); netytarButtons[row, col].ToolTip = row.ToString() + " " + col.ToString(); int X = GraphicsChest.getChest().netytarStart + firstSpacer + col * horizontalSpacer; int Y = GraphicsChest.getChest().netytarStart + verticalSpacer * row; Canvas.SetLeft(netytarButtons[row, col], X); Canvas.SetTop(netytarButtons[row, col], Y); // OCCLUDER //netytarButtons[row, col].Occluder.Points = new PointCollection() { new Point(X - occluderOffset, Y + buttonWidth / 2), new Point(X + buttonWidth / 2 + 1, Y - occluderOffset), new Point(X + buttonWidth + occluderOffset + 1, Y + buttonWidth / 2), new Point(X + buttonWidth / 2 + 1, Y + buttonHeight + occluderOffset)}; netytarButtons[row, col].Occluder.Width = buttonWidth + occluderOffset * 2; netytarButtons[row, col].Occluder.Height = buttonHeight + occluderOffset * 2; Canvas.SetLeft(netytarButtons[row, col].Occluder, X - occluderOffset); Canvas.SetTop(netytarButtons[row, col].Occluder, Y - occluderOffset); Panel.SetZIndex(netytarButtons[row, col], 3); Panel.SetZIndex(netytarButtons[row, col].Occluder, 2000); canvas.Children.Add(netytarButtons[row, col]); canvas.Children.Add(netytarButtons[row, col].Occluder); netytarButtons[row, col].Width = buttonWidth; netytarButtons[row, col].Height = buttonHeight; #endregion #region Define note int calcNote = baseNote; calcNote += col * 2 + row * 2; if (isPairRow) { calcNote += 1; } netytarButtons[row, col].Note = calcNote; #endregion #region Behavior netytarButtons[row, col].setBehavior(); #endregion } } }