Пример #1
0
 public LinearInterpolation(PropertyInfo info, GuiScalar from, GuiScalar to, float time)
     : base(info)
 {
     this.from = from;
     this.to   = to;
     this.time = time;
 }
Пример #2
0
        protected Area(SerializationInfo info, StreamingContext context)
        {
            serializationOptions = (WidgetSerialization)info.GetValue("SerializeOptions", typeof(WidgetSerialization));
            zOrder      = info.GetUInt32("ZOrder");
            parent      = (IWidget)info.GetValue("Parent", typeof(IWidget));
            description = info.GetString("Description");
            containedDescriptionShowUpTime  = info.GetSingle("ContainedDescriptionShowUpTime");
            containedDescriptionPositioning = (LayoutAnchor)info.GetValue("ContainedDescriptionPositioning", typeof(LayoutAnchor));
            containedDescriptionObject      = (IDisplayObject)info.GetValue("ContainedDescriptionObject", typeof(IDisplayObject));
            anchor        = (LayoutAnchor)info.GetValue("Anchor", typeof(LayoutAnchor));
            minSize       = (GuiVector2)info.GetValue("MinSize", typeof(GuiVector2));
            maxSize       = (GuiVector2)info.GetValue("MaxSize", typeof(GuiVector2));
            preferredSize = (GuiVector2)info.GetValue("PreferredSize", typeof(GuiVector2));
            preserveRatio = info.GetBoolean("PreserveRatio");
            preferredRect = (GuiRect)info.GetValue("PreferredRect", typeof(GuiRect));
            marginLeft    = (GuiScalar)info.GetValue("MarginLeft", typeof(GuiScalar));
            marginRight   = (GuiScalar)info.GetValue("MarginRight", typeof(GuiScalar));
            marginTop     = (GuiScalar)info.GetValue("MarginTop", typeof(GuiScalar));
            marginBottom  = (GuiScalar)info.GetValue("MarginBottom", typeof(GuiScalar));

            if ((serializationOptions & WidgetSerialization.PersistAllStyles) > 0)
            {
                style = (Style)info.GetValue("Style", typeof(Style));
            }
            else if ((serializationOptions & WidgetSerialization.PersistNonThemeStyles) > 0)
            {
                style = (Style)info.GetValue("Style", typeof(Style));
            }

            if ((serializationOptions & WidgetSerialization.PersistRenderer) > 0)
            {
                renderer = (Themes.IGuiRenderer)info.GetValue("Renderer", typeof(Themes.IGuiRenderer));
            }

            if ((serializationOptions & WidgetSerialization.PersistState) > 0)
            {
                isVisible = info.GetBoolean("IsVisible");
            }

            if ((serializationOptions & WidgetSerialization.PersistAnimations) > 0)
            {
                animationState   = (StyleAnimationController)info.GetValue("StyleAnimationController", typeof(StyleAnimationController));
                activeAnimations = (List <AnimationProcess>)info.GetValue("ActiveAnimations", typeof(List <AnimationProcess>));
            }

            if ((serializationOptions & WidgetSerialization.PersistEventBindings) > 0)
            {
                onChange       = (Action <IPreChangeNotifier>)info.GetValue("OnChange", typeof(Action <IPreChangeNotifier>));
                onMouseOver    = (Action2 <Area, IPointer>)info.GetValue("OnMouseOver", typeof(Action2 <Area, IPointer>));
                onMouseLeave   = (Action2 <Area, IPointer>)info.GetValue("OnMouseLeave", typeof(Action2 <Area, IPointer>));
                onMousePressed = (Action4 <Area, IPointer, uint, InputEventModifier>)info.GetValue("OnMousePressed",
                                                                                                   typeof(Action4 <Area, IPointer, uint, InputEventModifier>));
                onMouseReleased = (Action3 <Area, IPointer, uint>)info.GetValue("OnMouseReleased", typeof(Action3 <Area, IPointer, uint>));
                onWheel         = (Action3 <Area, IPointer, float>)info.GetValue("OnWheel", typeof(Action3 <Area, IPointer, float>));
                onMouseMove     = (Action3 <Area, IPointer, Vector2f>)info.GetValue("OnMouseMove", typeof(Action3 <Area, IPointer, Vector2f>));
                onFocusGain     = (Action <Area>)info.GetValue("OnFocusGain", typeof(Action <Area>));
                onFocusLost     = (Action <Area>)info.GetValue("OnFocusLost", typeof(Action <Area>));
                onKeyPressed    = (Action5 <Area, IPointer, KeyCodes, KeyboardModifiers, InputEventModifier>)info.GetValue(
                    "OnKeyPressed", typeof(Action5 <Area, IPointer, KeyCodes, KeyboardModifiers, InputEventModifier>));
                onKeyReleased      = (Action4 <Area, IPointer, KeyCodes, KeyboardModifiers>)info.GetValue("OnKeyReleased", typeof(Action4 <Area, IPointer, KeyCodes, KeyboardModifiers>));
                onDescriptionShow  = (Action2 <Area, IWidget>)info.GetValue("OnDescriptionShow", typeof(Action2 <Area, IWidget>));
                onDescriptionHide  = (Action2 <Area, IWidget>)info.GetValue("OnDescriptionHide", typeof(Action2 <Area, IWidget>));
                onStyleStateChange = (Action3 <Area, StyleState, StyleState>)info.GetValue("OnStyleStateChange", typeof(Action3 <Area, StyleState, StyleState>));
            }
        }
Пример #3
0
 /// <summary>
 /// Pointer sensitivity constructor.
 /// </summary>
 /// <param name="mouseSensitivity"></param>
 /// <param name="wheelSensitivity"></param>
 /// <param name="repeatKeyPressFirstTime"></param>
 /// <param name="repeatKeyPress"></param>
 public Sensitivity(GuiVector2 mouseSensitivity, GuiScalar wheelSensitivity)
 {
     this.mouseSensitivity = mouseSensitivity;
     this.wheelSensitivity = wheelSensitivity;
 }