コード例 #1
0
ファイル: SequenceShower.cs プロジェクト: Soembodi/Luxuino
        private void SequenceMaker_MouseDown(object sender, MouseEventArgs e)
        {
            Point screenPoint = this.Parent.PointToScreen(this.Location);

            selectedPoint = null;
            Sequencepoint[] invPoints = points;
            Array.Reverse(invPoints);
            foreach (Sequencepoint point in invPoints)
            {
                if (Mathf.Contains(point.marker.path.PathPoints, new Point(MousePosition.X - screenPoint.X, MousePosition.Y - screenPoint.Y)))
                {
                    selectedPoint = point;
                    MarkerSelected?.Invoke(point);
                    Invalidate();
                    break;
                }
            }
            if (selectedPoint != null)
            {
                timer.Start();
            }
            else
            {
                List <Sequencepoint> lPoints  = points.ToList();
                Sequencepoint        newPoint = new Sequencepoint(Color.White, Mathf.Clamp((MousePosition.X - screenPoint.X) / (float)this.Width, 0.01f, 0.99f));
                lPoints.Add(newPoint);
                points = lPoints.ToArray();

                selectedPoint            = newPoint;
                selectedPoint.color      = GetColorOnGradient((int)(newPoint.time * this.Width));
                gradient1.SequencePoints = points;
                MarkerSelected?.Invoke(newPoint);
                if (sender.GetType() != typeof(Gradient))
                {
                    timer.Start();
                }
            }
        }
コード例 #2
0
ファイル: SequenceEditor.cs プロジェクト: Soembodi/Luxuino
 private void sequenceMaker1_MarkerSelected(Sequencepoint point)
 {
     sequenceColorWheel.SetColor(point.color);
 }