Exemplo n.º 1
0
        public override void EvtDraw()
        {
            CollisionContainer.Height = (int)(32 * ImageScaleTarget.Y);
            CollisionContainer.Width  = (int)(64 * ImageScaleTarget.X);
            CollisionContainer.X      = (int)Position.X;
            CollisionContainer.Y      = (int)Position.Y;

            //   draw_rectangle(Position, new Vector2(Position.X + 16 * ImageScaleTarget.X, Position.Y + 16 * ImageScaleTarget.Y), true);

            if (pickedUp)
            {
                ImageAlpha = (float)lerp_aggressive(ImageAlpha, 0, 0.1);
            }

            draw_self();

            if (pickedUp)
            {
                pe.Draw(sb);
            }

            draw_text(X, Y - 64, pickedUp.ToString());
            draw_text(X, Y - 96, "Alpha: " + ImageAlpha.ToString());
            //draw_line_color(rr.Point1, rr.Point2, Color.Red, Color.Red);
            // draw_line_color(rr.Point2, rr.Point3, Color.Red, Color.Red);
            //draw_line_color(rr.Point3, rr.Point4, Color.Red, Color.Red);
            //  draw_line_color(rr.Point4, rr.Point1, Color.Red, Color.Red);
        }
Exemplo n.º 2
0
        /// <summary>Handles the PropertyChanged event of the DataContext control.</summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="PropertyChangedEventArgs"/> instance containing the event data.</param>
        private void DataContext_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            switch (e.PropertyName)
            {
            case nameof(IAlphaSettings.AlphaValue):
                NumericAlphaValue.Value = DataContext.AlphaValue;
                ImageAlpha.Refresh();
                break;

            case nameof(IAlphaSettings.UpdateRange):
                NumericMinAlpha.Value = DataContext.UpdateRange.Minimum;
                NumericMaxAlpha.Value = DataContext.UpdateRange.Maximum;
                break;
            }

            ValidateOk();
        }