C# Class FontEffectsLib.SpriteTypes.Panel

Create an expandable / collapsable panel.
Inheritance: SlidingSprite, IStateful
Datei anzeigen Open project: GreatMindsRobotics/FontEffectsLib

Protected Properties

Property Type Description
_minScale Vector2
_speed Vector2
_state PanelState

Public Methods

Method Description
Collapse ( ) : bool

Collapse the panel. Panel must be in Open or Expanding states.

Expand ( ) : bool

Expand the panel. The panel must be in Collapsed or Collapsing state.

Panel ( GraphicsDevice graphics, Vector2 size, Vector2 speed, Vector2 position, Color color ) : System

Creates an expandable/collapsable panel

Update ( GameTime gameTime ) : void

Standard XNA Game loop Update method.

Protected Methods

Method Description
switchState ( PanelState panelState ) : void

Switches the current state of the panel, and fires StateChanged event, if there are any subscribers.

Method Details

Collapse() public method

Collapse the panel. Panel must be in Open or Expanding states.
public Collapse ( ) : bool
return bool

Expand() public method

Expand the panel. The panel must be in Collapsed or Collapsing state.
public Expand ( ) : bool
return bool

Panel() public method

Creates an expandable/collapsable panel
public Panel ( GraphicsDevice graphics, Vector2 size, Vector2 speed, Vector2 position, Color color ) : System
graphics GraphicsDevice Graphics device
size Vector2 Size of panel when fully expanded
speed Vector2 Speed of expansion/collapse
position Vector2 Position of center of the panel. Panel expands/collapses from/to this point
color Color Color of the panel
return System

Update() public method

Standard XNA Game loop Update method.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime GameTime object for current game.
return void

switchState() protected method

Switches the current state of the panel, and fires StateChanged event, if there are any subscribers.
protected switchState ( PanelState panelState ) : void
panelState PanelState New state for the current panel.
return void

Property Details

_minScale protected_oe property

The smallest scale value to scale this panel to in Collapsed state. Default is Vector2.One
protected Vector2 _minScale
return Vector2

_speed protected_oe property

Speed with which to expand/collapse the panel.
protected Vector2 _speed
return Vector2

_state protected_oe property

Panel's current state.
protected PanelState _state
return PanelState