C#Code
C#Code
Public Member Functions | Protected Attributes | Private Attributes
Libraries.Mouse.BaseMouse Class Reference
Inheritance diagram for Libraries.Mouse.BaseMouse:
Libraries.Mouse.SpriteMouse TheForum.GameCode.GameMouse Libraries.Mouse.MenuMouse TheForum.GameCode.GameMouse

List of all members.

Public Member Functions

 BaseMouse ()
Vector2 GetScreenPos ()
Point GetScreenPixelPos ()
void SetScreenPixelPos (Point pos)
void SetScreenPixelPos (Vector2 pos)
void SetScreenRestrictions (Vector2 topLeft, Vector2 dims)
void SetScreenRestrictionUsed (bool use)
virtual bool Load (Microsoft.Xna.Framework.Graphics.GraphicsDevice device, Libraries.AssetManager assetM, Libraries.Messaging.MouseInputMessageHandler mouseInputM)
virtual void Render (Microsoft.Xna.Framework.Graphics.GraphicsDevice device, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
virtual void Update (int timePassed)
virtual void HandleMouseInputDelegate (object message)
virtual void HandleControllerInputDelegate (object message)
void StoreProperty (BaseMouseProperty prop)
virtual void Clear ()
void SetAllowDisplay (bool allowDisplay)
 BaseMouse ()
Point GetScreenPixelPos ()
void SetScreenPixelPos (Point pos)
abstract bool Load (Microsoft.Xna.Framework.Graphics.GraphicsDevice device, Libraries.AssetManager assetM)
virtual void Render (Microsoft.Xna.Framework.Graphics.GraphicsDevice device, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
virtual void Update (int timePassed)
virtual void HandleMouseInputDelegate (object message)
void StoreProperty (BaseMouseProperty prop)

Protected Attributes

bool m_allowDisplay
 Wether the mouse is allowed to display. Mouse can still be used even if it isn't shown. Value is true if it allowed to display, false if not.
Libraries.Messaging.MouseInputMessageHandler m_mouseInputM
 The mouse input manager the mouse can send data back to.

Private Attributes

Microsoft.Xna.Framework.Vector2 m_screenPixelPos
 Pixel position the mouse is at.
Vector2 m_restrictScreenTopL
 Top left pixel of the area of restriction.
Vector2 m_restrictDims
 Restriction dimensions, in pixels.
bool m_restrictMouseArea
 True if where the mouse is allowed to move is restricted, false if not.
MouseProperties m_properties
 Non-standard mouse properties. Add the properties you want.
Point m_screenPixelPos
 Pixel position the mouse is at.
Point m_restrictScreenTopL
 Top left pixel of the area of restriction.
Point m_restrictDims
 Restriction dimensions, in pixels.

Detailed Description

Base mouse class. Derive to create mouse cursors.


Constructor & Destructor Documentation

Libraries.Mouse.BaseMouse.BaseMouse ( )

Default constructor.

Libraries.Mouse.BaseMouse.BaseMouse ( )

Default constructor.


Member Function Documentation

virtual void Libraries.Mouse.BaseMouse.Clear ( ) [virtual]

Unload the mouse. Free up objects.

Reimplemented in TheForum.GameCode.GameMouse, Libraries.Mouse.MenuMouse, and Libraries.Mouse.SpriteMouse.

Point Libraries.Mouse.BaseMouse.GetScreenPixelPos ( )

Returns the last known screen position of the mouse. The float position gets cast to ints.

Return:
Value is the lasat known pixel position of the mouse.

Point Libraries.Mouse.BaseMouse.GetScreenPixelPos ( )

Returns the last known screen pixel position of the mouse.

Return:
Value is the lasat known pixel position of the mouse.

Vector2 Libraries.Mouse.BaseMouse.GetScreenPos ( )

Returns the last known screen pixel position of the mouse.

Return:
Value is the last known position of the mouse.

virtual void Libraries.Mouse.BaseMouse.HandleControllerInputDelegate ( object  message) [virtual]

Used for a delegate to handle a input messages from a game pad controller. Like using the sticks to move the mouse.

message - Message to handle. Should be of type MouseInputMessage.

Reimplemented in Libraries.Mouse.MenuMouse.

virtual void Libraries.Mouse.BaseMouse.HandleMouseInputDelegate ( object  message) [virtual]

Used for a delegate to handle a input messages.

message - Message to handle. Should be of type MouseInputMessage.

Reimplemented in TheForum.GameCode.GameMouse, Libraries.Mouse.MenuMouse, and TheForum.GameCode.GameMouse.

virtual void Libraries.Mouse.BaseMouse.HandleMouseInputDelegate ( object  message) [virtual]

Used for a delegate to handle a input messages.

message - Message to handle. Should be of type MouseInputMessage.

Reimplemented in TheForum.GameCode.GameMouse, Libraries.Mouse.MenuMouse, and TheForum.GameCode.GameMouse.

abstract bool Libraries.Mouse.BaseMouse.Load ( Microsoft.Xna.Framework.Graphics.GraphicsDevice  device,
Libraries.AssetManager  assetM 
) [pure virtual]

Load the mouse cursor, setting up textures, sprites, etc.

device - Device to load with.
assetM - Asset manager to use for loading the mouse graphic.
virtual bool Libraries.Mouse.BaseMouse.Load ( Microsoft.Xna.Framework.Graphics.GraphicsDevice  device,
Libraries.AssetManager  assetM,
Libraries.Messaging.MouseInputMessageHandler  mouseInputM 
) [virtual]

Load the mouse cursor, setting up textures, sprites, etc.

device - Device to load with.
assetM - Asset manager to use for loading the mouse graphic.
mouseInputM - Sometimes a mouse needs to send mouse data back to the mouse input manager. This will be stored by the mouse for that.

Reimplemented in Libraries.Mouse.SpriteMouse.

virtual void Libraries.Mouse.BaseMouse.Render ( Microsoft.Xna.Framework.Graphics.GraphicsDevice  device,
Microsoft.Xna.Framework.Graphics.SpriteBatch  spriteBatch 
) [virtual]

Display the mouse.

device - Device to render 3D with.
spriteBatch - Spritebatch to draw sprites with.

Reimplemented in TheForum.GameCode.GameMouse, Libraries.Mouse.MenuMouse, Libraries.Mouse.SpriteMouse, and TheForum.GameCode.GameMouse.

virtual void Libraries.Mouse.BaseMouse.Render ( Microsoft.Xna.Framework.Graphics.GraphicsDevice  device,
Microsoft.Xna.Framework.Graphics.SpriteBatch  spriteBatch 
) [virtual]

Display the mouse.

device - Device to render 3D with.
spriteBatch - Spritebatch to draw sprites with.

Reimplemented in TheForum.GameCode.GameMouse, Libraries.Mouse.MenuMouse, Libraries.Mouse.SpriteMouse, and TheForum.GameCode.GameMouse.

void Libraries.Mouse.BaseMouse.SetAllowDisplay ( bool  allowDisplay)

Set wether the mouse draws. Value is true if it does, false if not.

void Libraries.Mouse.BaseMouse.SetScreenPixelPos ( Point  pos)

Sets the current screen pixel position of the mouse to be the given position. If restrictions are set then they will be applied.

void Libraries.Mouse.BaseMouse.SetScreenPixelPos ( Vector2  pos)

Sets the current screen pixel position of the mouse to be the given position. If restrictions are set then they will be applied.

pos - Position to store.
void Libraries.Mouse.BaseMouse.SetScreenPixelPos ( Point  pos)

Sets the current screen pixel position of the mouse to be the given position. If restrictions are set then they will be applied.

pos - Position to store.
void Libraries.Mouse.BaseMouse.SetScreenRestrictions ( Vector2  topLeft,
Vector2  dims 
)

Set the screen restriction area properties. This doesn't turn on the restriction, just what where the restriction would be when on.

topLeft - Top left pixel of the restricted area. Mouse isn't allowed to the left or above this point.
dims - Dimensions of the restricted area.
void Libraries.Mouse.BaseMouse.SetScreenRestrictionUsed ( bool  use)

Turn on/off using screen restrction (the mouse forced to be in a set area of the screen).

use - True if the screen restrictions should be used, false if not.
void Libraries.Mouse.BaseMouse.StoreProperty ( BaseMouseProperty  prop)

Store the given sprite property.

prop - Property to store.
void Libraries.Mouse.BaseMouse.StoreProperty ( BaseMouseProperty  prop)

Store the given sprite property.

prop - Property to store.
virtual void Libraries.Mouse.BaseMouse.Update ( int  timePassed) [virtual]

Update the mouse.

timePassed - How long the update is for.

Reimplemented in Libraries.Mouse.SpriteMouse, and TheForum.GameCode.GameMouse.

virtual void Libraries.Mouse.BaseMouse.Update ( int  timePassed) [virtual]

Update the mouse.

Reimplemented in Libraries.Mouse.SpriteMouse, and TheForum.GameCode.GameMouse.


Member Data Documentation

Wether the mouse is allowed to display. Mouse can still be used even if it isn't shown. Value is true if it allowed to display, false if not.

The mouse input manager the mouse can send data back to.

Non-standard mouse properties. Add the properties you want.

Non-standard sprite properties. Add the properties you want.

Restriction dimensions, in pixels.

Restriction dimensions, in pixels.

True if where the mouse is allowed to move is restricted, false if not.

Top left pixel of the area of restriction.

Top left pixel of the area of restriction.

Microsoft.Xna.Framework.Vector2 Libraries.Mouse.BaseMouse.m_screenPixelPos [private]

Pixel position the mouse is at.

Pixel position the mouse is at.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Properties