Example #1
0
 /// <summary>
 /// This method is called when the <see cref="VisibilityChanged"/> event is raised.
 /// </summary>
 /// <param name="sender"> The <see cref="GuiItem"/> that raised the event. </param>
 /// <param name="e"> The new visibility of the <see cref="GuiItem"/>. </param>
 protected virtual void OnVisibilityChanged(GuiItem sender, ValueChangedEventArgs<bool> e)
 {
     visible = e.NewValue;
 }
Example #2
0
 /// <summary>
 /// This method is called when the <see cref="Rotated"/> event is raised.
 /// </summary>
 /// <param name="sender"> The <see cref="GuiItem"/> that raised the event. </param>
 /// <param name="e"> The new rotation (in radians). </param>
 protected virtual void OnRotationChanged(GuiItem sender, ValueChangedEventArgs<float> e)
 {
     rotation = e.NewValue;
 }
Example #3
0
 /// <summary>
 /// This method is called when the <see cref="Resize"/> event is raised.
 /// </summary>
 /// <param name="sender"> The <see cref="GuiItem"/> that raised the event. </param>
 /// <param name="e"> The new size of the <see cref="GuiItem"/>. </param>
 protected virtual void OnResize(GuiItem sender, ValueChangedEventArgs<Rectangle> e)
 {
     CheckBounds(e.NewValue);
     bounds = e.NewValue;
     backColorImage = Drawing.FromColor(backColor, Size, device);
     foregroundTexture = Drawing.FromColor(foreColor, Size, device);
 }
Example #4
0
 /// <summary>
 /// This method is called when the <see cref="NameChanged"/> event is raised.
 /// </summary>
 /// <param name="sender"> The <see cref="GuiItem"/> that raised the event. </param>
 /// <param name="e"> The new name for the <see cref="GuiItem"/>. </param>
 protected virtual void OnNameChange(GuiItem sender, ValueChangedEventArgs<string> e)
 {
     name = e.NewValue;
 }
Example #5
0
 /// <summary>
 /// This method is called when the <see cref="Move"/> event is raised.
 /// </summary>
 /// <param name="sender"> The <see cref="GuiItem"/> that raised the event. </param>
 /// <param name="e"> The new position of the <see cref="GuiItem"/>. </param>
 protected virtual void OnMove(GuiItem sender, ValueChangedEventArgs<Vector2> e)
 {
     bounds.X = (int)e.NewValue.X;
     bounds.Y = (int)e.NewValue.Y;
 }
Example #6
0
 /// <summary>
 /// This method is called when the <see cref="ForeColorChanged"/> event is raised.
 /// </summary>
 /// <param name="sender"> The <see cref="GuiItem"/> that raised the event. </param>
 /// <param name="e"> The new <see cref="Color"/> for the foreground. </param>
 protected virtual void OnForeColorChanged(GuiItem sender, ValueChangedEventArgs<Color> e)
 {
     foreColor = e.NewValue;
     foregroundTexture = Drawing.FromColor(foreColor, Size, device);
 }
Example #7
0
 /// <summary>
 /// This method is called when the <see cref="BackgroundImageChanged"/> event is raised.
 /// </summary>
 /// <param name="sender"> The <see cref="GuiItem"/> that raised the event. </param>
 /// <param name="e"> The new <see cref="Texture2D"/> to use as background. </param>
 protected virtual void OnBackgroundImageChaned(GuiItem sender, ValueChangedEventArgs<Texture2D> e)
 {
     backgroundImage = e.NewValue;
 }
Example #8
0
 /// <summary>
 /// This method is called when the <see cref="BackColorChanged"/> event is raised.
 /// </summary>
 /// <param name="sender"> The <see cref="GuiItem"/> that raised the event. </param>
 /// <param name="e"> The new <see cref="Color"/> for the background. </param>
 protected virtual void OnBackColorChanged(GuiItem sender, ValueChangedEventArgs<Color> e)
 {
     backColor = e.NewValue;
     backColorImage = Drawing.FromColor(backColor, Size, device);
 }