Beispiel #1
0
 public void Reset()
 {
     ScaleX.ZoomReset();
     ScaleY.ZoomReset();
     MinX = null;
     MaxX = null;
 }
Beispiel #2
0
            public Storyboard CreateShowing(OverlaidContent target)
            {
                var content         = (PictureViewContent)target;
                var duration        = 250;
                var exponentialEase = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseOut, Exponent = 5
                };
                var transform = content.PicturePreviewControl.GetTransformTo(content.SourceControl);

                var translateX = new TranslateX(content.PicturePreviewControl)
                {
                    From = transform.TranslateX / 2, Duration = duration, EasingFunction = exponentialEase
                };
                var translateY = new TranslateY(content.PicturePreviewControl)
                {
                    From = transform.TranslateY / 2, Duration = duration, EasingFunction = exponentialEase
                };
                var scaleX = new ScaleX(content.PicturePreviewControl)
                {
                    From = transform.ScaleX + (1 - transform.ScaleX) / 2, To = 1, Duration = duration, EasingFunction = exponentialEase
                };
                var scaleY = new ScaleY(content.PicturePreviewControl)
                {
                    From = transform.ScaleY + (1 - transform.ScaleY) / 2, To = 1, Duration = duration, EasingFunction = exponentialEase
                };

                var storyboard = new Storyboard();

                storyboard.Children.Add(translateX.GetTimeline());
                storyboard.Children.Add(translateY.GetTimeline());
                storyboard.Children.Add(scaleX.GetTimeline());
                storyboard.Children.Add(scaleY.GetTimeline());
                return(storyboard);
            }
Beispiel #3
0
 void UpdateTransform()
 {
     cur_transform.Reset();
     cur_transform.Translate(curx - (hotx * ScaleX), cury - (hoty * ScaleY));
     //cur_transform.Rotate( rotation );
     cur_transform.RotateAt(rotation, new PointF(hotx * ScaleX, hoty * ScaleX));
     cur_transform.Scale(ScaleX.ToFloat(), ScaleY.ToFloat());
     //cur_transform.Translate( hotx, hoty );
 }
Beispiel #4
0
 private void hideTransform()
 {
     label1.Hide(); label4.Hide(); label7.Hide();
     label2.Hide(); label5.Hide(); label8.Hide();
     label3.Hide(); label6.Hide(); label9.Hide();
     LocationX.Hide(); LocationY.Hide(); LocationZ.Hide();
     RotationRoll.Hide(); RotationYaw.Hide(); RotationPitch.Hide();
     ScaleX.Hide(); ScaleY.Hide(); ScaleZ.Hide();
 }
Beispiel #5
0
 /// <summary>
 /// Сохраняются настройки компонента
 /// </summary>
 /// <param name="node">Узел с настройками</param>
 public void SaveState(XmlElement node)
 {
     node.RemoveAll();
     node.SetAttribute("ScaleX", ScaleX.ToString());
     node.SetAttribute("ScaleY", ScaleY.ToString());
     if (viewChannelsGrid != null)
     {
         viewChannelsGrid.SaveState(node.AppendChild(node.OwnerDocument.CreateElement("Channels")) as XmlElement);
     }
 }
            public override int GetHashCode()
            {
                int hashCode = -1889935131;

                hashCode = hashCode * -1521134295 + X.GetHashCode();
                hashCode = hashCode * -1521134295 + Y.GetHashCode();
                hashCode = hashCode * -1521134295 + Rotation.GetHashCode();
                hashCode = hashCode * -1521134295 + ScaleX.GetHashCode();
                hashCode = hashCode * -1521134295 + ScaleY.GetHashCode();
                return(hashCode);
            }
Beispiel #7
0
        public override int GetHashCode()
        {
            int hashCode = -62375069;

            hashCode = hashCode * -1521134295 + ScaleX.GetHashCode();
            hashCode = hashCode * -1521134295 + SkewX.GetHashCode();
            hashCode = hashCode * -1521134295 + TransX.GetHashCode();
            hashCode = hashCode * -1521134295 + SkewY.GetHashCode();
            hashCode = hashCode * -1521134295 + ScaleY.GetHashCode();
            hashCode = hashCode * -1521134295 + TransY.GetHashCode();
            hashCode = hashCode * -1521134295 + Persp0.GetHashCode();
            hashCode = hashCode * -1521134295 + Persp1.GetHashCode();
            hashCode = hashCode * -1521134295 + Persp2.GetHashCode();
            return(hashCode);
        }
Beispiel #8
0
 private void ScaleY_MouseMove(object sender, MouseEventArgs e)
 {
     if (ScaleYispress)
     {
         Point point = ScaleY.PointToClient(Control.MousePosition);
         ScaleY.Text = (point.X + tempScaleY).ToString();
         var Proinstance = nodeGraph2.Nodes[Member];
         if (ProType.Equals("ADD"))
         {
         }
         else
         {
             (Proinstance.Properties[EditedPropertise] as ZDProperty_Transform).Value.Scale.Y = Convert.ToSingle(ScaleY.Text);
         }
     }
 }
Beispiel #9
0
 public bool Equals(Matrix2D other)
 {
     if (other == null)
     {
         return(false);
     }
     return(ScaleX.Equals(other.ScaleX) &&
            SkewX.Equals(other.SkewX) &&
            TransX.Equals(other.TransX) &&
            SkewY.Equals(other.SkewY) &&
            ScaleY.Equals(other.ScaleY) &&
            TransY.Equals(other.TransY) &&
            Persp0.Equals(other.Persp0) &&
            Persp1.Equals(other.Persp1) &&
            Persp2.Equals(other.Persp2));
 }
Beispiel #10
0
            /// <summary>
            /// JointName is only checked if in both objects JointName is not NULL. Everything else is checked regardless
            /// </summary>
            /// <param name="obj"></param>
            /// <returns></returns>
            public override bool Equals(object obj)
            {
                if (!(obj is BoneAnimation animation))
                {
                    return(false);
                }
                bool result = TranslationX.SequenceEqual(animation.TranslationX) &&
                              TranslationY.SequenceEqual(animation.TranslationY) &&
                              TranslationZ.SequenceEqual(animation.TranslationZ) &&
                              RotationX.SequenceEqual(animation.RotationX) &&
                              RotationY.SequenceEqual(animation.RotationY) &&
                              RotationZ.SequenceEqual(animation.RotationZ) &&
                              ScaleX.SequenceEqual(animation.ScaleX) &&
                              ScaleY.SequenceEqual(animation.ScaleY) &&
                              ScaleZ.SequenceEqual(animation.ScaleZ);

                return(result && ((JointName != null && animation.JointName != null) ? JointName.Equals(animation.JointName) : true));
            }
Beispiel #11
0
            public Storyboard CreateHiding(OverlaidContent target)
            {
                var content         = (PictureViewContent)target;
                var duration        = 250;
                var exponentialEase = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseOut, Exponent = 5
                };
                var transform = content.PicturePreviewControl.GetTransformTo(content.SourceControl);

                ApplyUniformToFillRule(content.PicturePreviewControl.RenderSize, content.SourceControl.RenderSize, transform);

                var translateX = new TranslateX(content.PicturePreviewControl)
                {
                    To = transform.TranslateX, Duration = duration, EasingFunction = exponentialEase
                };
                var translateY = new TranslateY(content.PicturePreviewControl)
                {
                    To = transform.TranslateY, Duration = duration, EasingFunction = exponentialEase
                };
                var scaleX = new ScaleX(content.PicturePreviewControl)
                {
                    From = 1, To = transform.ScaleX, Duration = duration, EasingFunction = exponentialEase
                };
                var scaleY = new ScaleY(content.PicturePreviewControl)
                {
                    From = 1, To = transform.ScaleY, Duration = duration, EasingFunction = exponentialEase
                };
                var background = new ValueSetterAnimation(content.LayoutControl, nameof(Background))
                {
                    Value = new SolidColorBrush(Colors.Transparent)
                };

                var storyboard = new Storyboard();

                storyboard.Children.Add(translateX.GetTimeline());
                storyboard.Children.Add(translateY.GetTimeline());
                storyboard.Children.Add(scaleX.GetTimeline());
                storyboard.Children.Add(scaleY.GetTimeline());
                storyboard.Children.Add(background.GetTimeline());
                return(storyboard);
            }
Beispiel #12
0
        internal void Write(EndianBinaryWriter writer)
        {
            writer.Write((short)Shader);
            writer.Write(UnkownFlag);

            ScaleXOrigin.Write(writer);
            ScaleYOrigin.Write(writer);

            PositionX.Write(writer);
            PositionY.Write(writer);

            Rotation.Write(writer);

            ScaleX.Write(writer);
            ScaleY.Write(writer);

            Opacity.Write(writer);

            writer.Write(UnknownInt);
        }
Beispiel #13
0
        public void DisplayInfo(Player p)
        {
            p.Message("Bot {0} &S({1}) has:", ColoredName, name);
            p.Message("  Owner: &f{0}", string.IsNullOrEmpty(Owner) ? "no one" : p.FormatNick(Owner));
            if (!String.IsNullOrEmpty(AIName))
            {
                p.Message("  AI: &f{0}", AIName);
            }
            if (hunt || kill)
            {
                p.Message("  Hunt: &f{0}&S, Kill: %f{1}", hunt, kill);
            }
            if (SkinName != name)
            {
                p.Message("  Skin: &f{0}", SkinName);
            }
            if (Model != "humanoid")
            {
                p.Message("  Model: &f{0}", Model);
            }
            if (!(ScaleX == 0 && ScaleY == 0 && ScaleZ == 0))
            {
                p.Message("  X scale: &a{0}&S, Y scale: &a{1}&S, Z scale: &a{2}",
                          ScaleX == 0 ? "none" : ScaleX.ToString(),
                          ScaleY == 0 ? "none" : ScaleY.ToString(),
                          ScaleZ == 0 ? "none" : ScaleZ.ToString()
                          );
            }

            if (String.IsNullOrEmpty(ClickedOnText))
            {
                return;
            }
            ItemPerms perms = CommandExtraPerms.Find("About", 1) ?? new ItemPerms(LevelPermission.AdvBuilder);

            if (!perms.UsableBy(p.Rank))
            {
                return;                          //don't show bot's ClickedOnText if player isn't allowed to see message block contents
            }
            p.Message("  Clicked-on text: {0}", ClickedOnText);
        }
        internal void Write(EndianBinaryWriter writer)
        {
            TransferMode.Write(writer);

            if (writer.AddressSpace == AddressSpace.Int64)
            {
                writer.WriteNulls(4);
            }

            AnchorX.Write(writer);
            AnchorY.Write(writer);
            PositionX.Write(writer);
            PositionY.Write(writer);
            Rotation.Write(writer);
            ScaleX.Write(writer);
            ScaleY.Write(writer);
            Opacity.Write(writer);

            writer.ScheduleWriteOffsetIf(Video3D != null, 8, AlignmentMode.Left, () =>
            {
                Video3D.Write(writer);
            });
        }
Beispiel #15
0
        private Storyboard CreateInteractionIndicationAnimation()
        {
            var scaleX = new ScaleX(LayoutControl)
            {
                From = 1, To = 1.3, Duration = 250, EasingFunction = new BackEase()
                {
                    EasingMode = EasingMode.EaseOut
                }
            };
            var scaleY = new ScaleY(LayoutControl)
            {
                From = 1, To = 1.3, Duration = 250, EasingFunction = new BackEase()
                {
                    EasingMode = EasingMode.EaseOut
                }
            };

            var storyboard = new Storyboard();

            storyboard.Children.Add(scaleX.GetTimeline());
            storyboard.Children.Add(scaleY.GetTimeline());
            return(storyboard);
        }
        internal void Read(EndianBinaryReader reader)
        {
            TransferMode.Read(reader);

            if (reader.AddressSpace == AddressSpace.Int64)
            {
                reader.SeekCurrent(4);
            }

            AnchorX.Read(reader);
            AnchorY.Read(reader);
            PositionX.Read(reader);
            PositionY.Read(reader);
            Rotation.Read(reader);
            ScaleX.Read(reader);
            ScaleY.Read(reader);
            Opacity.Read(reader);

            reader.ReadOffset(() =>
            {
                Video3D = new LayerVideo3D();
                Video3D.Read(reader);
            });
        }
Beispiel #17
0
    private void Update()
    {
        if (AnimationDir == 1)
        {
            T += Time.deltaTime * AnimationSpeed;
            if (T >= 1.0f)
            {
                T = 1.0f;
                if (ReverseOnFinish)
                {
                    AnimationDir = -1;
                }
                else
                {
                    AnimationDir = 0;
                }
            }
        }
        else if (AnimationDir == -1)
        {
            T -= Time.deltaTime * AnimationSpeed;
            if (T <= 0.0f)
            {
                T            = 0.0f;
                AnimationDir = 0;
            }
        }

        tr.localPosition = new Vector3(PosX.Evaluate(T), PosY.Evaluate(T), PosZ.Evaluate(T)) +
                           startPos;
        tr.localScale = new Vector3(startScale.x * ScaleX.Evaluate(T),
                                    startScale.y * ScaleY.Evaluate(T),
                                    startScale.z * ScaleZ.Evaluate(T));
        tr.localEulerAngles = new Vector3(tr.localEulerAngles.x, tr.localEulerAngles.y,
                                          startRot + Rot.Evaluate(T));
    }
Beispiel #18
0
        public string ToRawAss(string styleFormat = DefaultAssStyleFormat)
        {
            var sb = new StringBuilder();

            sb.Append("Style: ");
            var format = styleFormat.ToLowerInvariant().Substring(8).Split(',');

            for (int i = 0; i < format.Length; i++)
            {
                string f = format[i].Trim();
                if (f == "name")
                {
                    sb.Append(Name);
                }
                else if (f == "fontname")
                {
                    sb.Append(FontName);
                }
                else if (f == "fontsize")
                {
                    sb.Append(FontSize.ToString(CultureInfo.InvariantCulture));
                }
                else if (f == "primarycolour")
                {
                    sb.Append(AdvancedSubStationAlpha.GetSsaColorString(Primary));
                }
                else if (f == "secondarycolour")
                {
                    sb.Append(AdvancedSubStationAlpha.GetSsaColorString(Secondary));
                }
                else if (f == "outlinecolour")
                {
                    sb.Append(AdvancedSubStationAlpha.GetSsaColorString(Outline));
                }
                else if (f == "backcolour")
                {
                    sb.Append(AdvancedSubStationAlpha.GetSsaColorString(Background));
                }
                else if (f == "bold")
                {
                    sb.Append(BoolToRawSsa(Bold));
                }
                else if (f == "italic")
                {
                    sb.Append(BoolToRawSsa(Italic));
                }
                else if (f == "underline")
                {
                    sb.Append(BoolToRawSsa(Underline));
                }
                else if (f == "strikeout")
                {
                    sb.Append(BoolToRawSsa(Strikeout));
                }
                else if (f == "outline")
                {
                    sb.Append(OutlineWidth.ToString(CultureInfo.InvariantCulture));
                }
                else if (f == "shadow")
                {
                    sb.Append(ShadowWidth.ToString(CultureInfo.InvariantCulture));
                }
                else if (f == "alignment")
                {
                    sb.Append(Alignment);
                }
                else if (f == "marginl")
                {
                    sb.Append(MarginLeft);
                }
                else if (f == "marginr")
                {
                    sb.Append(MarginRight);
                }
                else if (f == "marginv")
                {
                    sb.Append(MarginVertical);
                }
                else if (f == "borderstyle")
                {
                    sb.Append(BorderStyle);
                }
                else if (f == "encoding")
                {
                    sb.Append('1');
                }
                else if (f == "strikeout")
                {
                    sb.Append('0');
                }
                else if (f == "scalex")
                {
                    sb.Append(ScaleX.ToString(CultureInfo.InvariantCulture));
                }
                else if (f == "scaley")
                {
                    sb.Append(ScaleY.ToString(CultureInfo.InvariantCulture));
                }
                else if (f == "spacing")
                {
                    sb.Append(Spacing.ToString(CultureInfo.InvariantCulture));
                }
                else if (f == "angle")
                {
                    sb.Append(Angle.ToString(CultureInfo.InvariantCulture));
                }

                sb.Append(',');
            }

            var s = sb.ToString().Trim();

            return(s.Substring(0, s.Length - 1));
        }