XNACS1Lib

CSS Logo XNACS1Lib Library Documentation
XNACS1Lib Namespace

Game-Themed Introductory Programming Project

This is the namespace where all of the utilities in XNACS1Lib are defined in. You should use this namespace in all of your source code files.

Namespace hierarchy

Classes

Class | Description
XNACS1Base | This is the base class for your program. To work with the XNACS1Lib, your main class must subclass from this class.
XNACS1Base.World | This this the class for setting, inquiring, and changing information corresponding to the "World", including: Coordinate System, Background color/texture, Clamping/colliding with the boundary, and removing all primitives from the AutoDraw set.
XNACS1Circle | A circle primitive.
XNACS1Primitive | This is the base class for the behavior of Primitives (circle, rectangle, and primitive-set).
XNACS1PrimitiveSet | XNACS1PrimitiveSet supports hiding/unhiding a collection of Primitives (Circle, or Rectangle).
XNACS1Rectangle | A Rectangle primitive.

Enumerations

Enumeration | Description
BoundCollideStatus | Enum data type for collision results between a Primitive and the world bound Status returned by ClampAtWorldBound() and CollideWorldBound.

Send comments on this topic.

MS Logo This work is supported in part by a grant from Microsoft Research under the Computer Gaming Curriculum in Computer Science RFP, Award Number 15871 and 16531.


BoundCollideStatus Enumeration

BoundCollideStatus Enumeration

Enum data type for collision results between a Primitive and the world bound Status returned by ClampAtWorldBound() and CollideWorldBound.

public enum BoundCollideStatus

Members

Member Name | Description
CollideLeft | Primitive has collided with the left-world boundary.
CollideRight | Primitive has collided with the right-world boundary.
CollideBottom | Primitive has collided with the bottom-world boundary.
CollideTop | Primitive has collided with the top-world boundary.
InsideBound | Primitive is inside the world boundary.

Requirements

Namespace: XNACS1Lib

Assembly: XNACS1Lib_PC (in XNACS1Lib_PC.dll)

See Also

XNACS1Lib Namespace


XNACS1Base Class

XNACS1Base Class

This is the base class for your program. To work with the XNACS1Lib, your main class must subclass from this class.

For a list of all members of this type, see XNACS1Base Members.

System.Object
XNACS1Base

public class XNACS1Base : IDisposable

Requirements

Namespace: XNACS1Lib

Assembly: XNACS1Lib_PC (in XNACS1Lib_PC.dll)

See Also

XNACS1Base Members | XNACS1Lib Namespace


XNACS1Base Members

XNACS1Base Members

XNACS1Base overview

Public Static Properties

GamePad For accessing the state of the XBOX 360 GamePad Controller. In the absence of a GamePad controller, the keyboard will be polled according to the default mapping.

Public Static Methods

EchoToBottomStatus | Echo message to the status area located at the bottom of the drawing window.
EchoToTopStatus | Echo message to the status area located at the top of the drawing window.
PlayACue | Play the spcified audio cue for the specified length of seconds.
PlayBackgroundAudio | Plays the specific audo file name continuously as the background audio.
RandomFloat | Overloaded. Returns a random number between 0.0 to 1.0
RandomInt | Overloaded. Returns a random integer between 0 and some VERY LARGE number.
SetBottomEchoColor | Sets the bottom status echo font color.
SetTopEchoColor | Sets the top status echo font color.

Public Instance Constructors

XNACS1Base Constructor This is the constructor of the base class for the library.

Public Instance Methods

Dispose | Immediately release all resources. This method is called automatically during the destruction of the application.
Exit | Quits the application. This is the last method you will call.
Run | Begins the application. As programmer, you should instantiate an instance of XNACS1Base object, and then call this method to begin the application. This is the first method you should call to begin the application.

Protected Instance Methods

DrawWorld | subclass can override this to customize the redrawing of the world. This function is called 40 times a second.
InitializeWorld | Subclass should override this to define the World Cooridnate origin and width, and to allocate and otherwise initialize the application state. This method is called once at the beginning of the application.
UpdateWorld | Subclass should override this method to update the world. This function is called 40 times a second.

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base Constructor

XNACS1Base Constructor

This is the constructor of the base class for the library.

public XNACS1Base();

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base Properties

XNACS1Base Properties

The properties of the XNACS1Base class are listed below. For a complete list of XNACS1Base class members, see the XNACS1Base Members topic.

Public Static Properties

GamePad For accessing the state of the XBOX 360 GamePad Controller. In the absence of a GamePad controller, the keyboard will be polled according to the default mapping.

See Also

XNACS1Base Class | XNACS1Lib Namespace


GamePad Property

XNACS1Base.GamePad Property

For accessing the state of the XBOX 360 GamePad Controller. In the absence of a GamePad controller, the keyboard will be polled according to the default mapping.

public static GamePadStruct GamePad {get;}

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base Methods

XNACS1Base Methods

The methods of the XNACS1Base class are listed below. For a complete list of XNACS1Base class members, see the XNACS1Base Members topic.

Public Static Methods

EchoToBottomStatus | Echo message to the status area located at the bottom of the drawing window.
EchoToTopStatus | Echo message to the status area located at the top of the drawing window.
PlayACue | Play the spcified audio cue for the specified length of seconds.
PlayBackgroundAudio | Plays the specific audo file name continuously as the background audio.
RandomFloat | Overloaded. Returns a random number between 0.0 to 1.0
RandomInt | Overloaded. Returns a random integer between 0 and some VERY LARGE number.
SetBottomEchoColor | Sets the bottom status echo font color.
SetTopEchoColor | Sets the top status echo font color.

Public Instance Methods

Dispose | Immediately release all resources. This method is called automatically during the destruction of the application.
Exit | Quits the application. This is the last method you will call.
Run | Begins the application. As programmer, you should instantiate an instance of XNACS1Base object, and then call this method to begin the application. This is the first method you should call to begin the application.

Protected Instance Methods

DrawWorld | subclass can override this to customize the redrawing of the world. This function is called 40 times a second.
InitializeWorld | Subclass should override this to define the World Cooridnate origin and width, and to allocate and otherwise initialize the application state. This method is called once at the beginning of the application.
UpdateWorld | Subclass should override this method to update the world. This function is called 40 times a second.

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.Dispose Method

XNACS1Base.Dispose Method

Immediately release all resources. This method is called automatically during the destruction of the application.

public void Dispose();

Implements

IDisposable.

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.DrawWorld Method

XNACS1Base.DrawWorld Method

subclass can override this to customize the redrawing of the world. This function is called 40 times a second.

protected virtual void DrawWorld();

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.EchoToBottomStatus Method

XNACS1Base.EchoToBottomStatus Method

Echo message to the status area located at the bottom of the drawing window.

public static void EchoToBottomStatus(
String msg
);

Parameters

msg
Message to be echoed.

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.EchoToTopStatus Method

XNACS1Base.EchoToTopStatus Method

Echo message to the status area located at the top of the drawing window.

public static void EchoToTopStatus(
String msg
);

Parameters

msg
Message to be echoed.

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.Exit Method

XNACS1Base.Exit Method

Quits the application. This is the last method you will call.

public void Exit();

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.InitializeWorld Method

XNACS1Base.InitializeWorld Method

Subclass should override this to define the World Cooridnate origin and width, and to allocate and otherwise initialize the application state. This method is called once at the beginning of the application.

protected virtual void InitializeWorld();

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.PlayACue Method

XNACS1Base.PlayACue Method

Play the spcified audio cue for the specified length of seconds.

public static void PlayACue(
String cueName
);

Parameters

cueName
Name of the audio cue (wav filename without the .wav extension).

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.PlayBackgroundAudio Method

XNACS1Base.PlayBackgroundAudio Method

Plays the specific audo file name continuously as the background audio.

public static void PlayBackgroundAudio(
String bgAudio,
Single level
);

Parameters

bgAudio
Name of the file to be used as background music.
level
The loudness of bg music (1.0 is loudest, 0.0 is silent).

Remarks

Pass in a null string (null) to stop the background audio.

See Also

XNACS1Base Class | XNACS1Lib Namespace


RandomFloat Method

XNACS1Base.RandomFloat Method

Returns a random number between 0.0 to 1.0

Overload List

Returns a random number between 0.0 to 1.0

public static float RandomFloat();

Returns a random float between 0 and max. This function may return 0, or may return a number that's close to max, but will never return max itself

public static float RandomFloat(Single);

Returns a float between min and max. This function may return min, or may return a number that's close to max, but will never return max itself

public static float RandomFloat(Single,Single);

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.RandomFloat Method ()

XNACS1Base.RandomFloat Method ()

Game-Themed Introductory Programming Project

Returns a random number between 0.0 to 1.0

public static float RandomFloat();

Return Value

A random number between 0.0 to 1.0.

See Also

XNACS1Base Class | XNACS1Lib Namespace | XNACS1Base.RandomFloat Overload List


XNACS1Base.RandomFloat Method (Single)

XNACS1Base.RandomFloat Method (Single)

Game-Themed Introductory Programming Project

Returns a random float between 0 and max. This function may return 0, or may return a number that's close to max, but will never return max itself

public static float RandomFloat(
Single max
);

Parameters

max
Max number to be returned.

Return Value

A random number between 0 and max.

See Also

XNACS1Base Class | XNACS1Lib Namespace | XNACS1Base.RandomFloat Overload List


XNACS1Base.RandomFloat Method (Single, Single)

XNACS1Base.RandomFloat Method (Single, Single)

Game-Themed Introductory Programming Project

Returns a float between min and max. This function may return min, or may return a number that's close to max, but will never return max itself

public static float RandomFloat(
Single min,
Single max
);

Parameters

min
Min number to be returned.
max
Max number to be returned.

Return Value

A random number between min and max.

See Also

XNACS1Base Class | XNACS1Lib Namespace | XNACS1Base.RandomFloat Overload List


RandomInt Method

XNACS1Base.RandomInt Method

Returns a random integer between 0 and some VERY LARGE number.

Overload List

Returns a random integer between 0 and some VERY LARGE number.

public static int RandomInt();

Returns a random integer between 0 and max.

public static int RandomInt(Int32);

Returns a random integer between min and max.

public static int RandomInt(Int32,Int32);

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.RandomInt Method ()

XNACS1Base.RandomInt Method ()

Game-Themed Introductory Programming Project

Returns a random integer between 0 and some VERY LARGE number.

public static int RandomInt();

Return Value

A random integer between 0 and some very large number.

See Also

XNACS1Base Class | XNACS1Lib Namespace | XNACS1Base.RandomInt Overload List


XNACS1Base.RandomInt Method (Int32)

XNACS1Base.RandomInt Method (Int32)

Game-Themed Introductory Programming Project

Returns a random integer between 0 and max.

public static int RandomInt(
Int32 max
);

Parameters

max
Max integer to be returned.

Return Value

Returns a random integer between 0 and max.

See Also

XNACS1Base Class | XNACS1Lib Namespace | XNACS1Base.RandomInt Overload List


XNACS1Base.RandomInt Method (Int32, Int32)

XNACS1Base.RandomInt Method (Int32, Int32)

Game-Themed Introductory Programming Project

Returns a random integer between min and max.

public static int RandomInt(
Int32 min,
Int32 max
);

Parameters

min
Min integer to be returned.
max
Max integer to be returned.

Return Value

Returns a random integer between min and max.

See Also

XNACS1Base Class | XNACS1Lib Namespace | XNACS1Base.RandomInt Overload List


XNACS1Base.Run Method

XNACS1Base.Run Method

Begins the application. As programmer, you should instantiate an instance of XNACS1Base object, and then call this method to begin the application. This is the first method you should call to begin the application.

public void Run();

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.SetBottomEchoColor Method

XNACS1Base.SetBottomEchoColor Method

Sets the bottom status echo font color.

public static void SetBottomEchoColor(
Color bottomEchoColor
);

Parameters

bottomEchoColor
Color of the bottom echo font.

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.SetTopEchoColor Method

XNACS1Base.SetTopEchoColor Method

Sets the top status echo font color.

public static void SetTopEchoColor(
Color topEchoColor
);

Parameters

topEchoColor
Color of the top echo font.

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.UpdateWorld Method

XNACS1Base.UpdateWorld Method

Subclass should override this method to update the world. This function is called 40 times a second.

protected virtual void UpdateWorld();

See Also

XNACS1Base Class | XNACS1Lib Namespace


XNACS1Base.World Class

XNACS1Base.World Class

This this the class for setting, inquiring, and changing information corresponding to the "World", including: Coordinate System, Background color/texture, Clamping/colliding with the boundary, and removing all primitives from the AutoDraw set.

For a list of all members of this type, see XNACS1Base.World Members.

System.Object
XNACS1Base.World

public static class XNACS1Base.World

Requirements

Namespace: XNACS1Lib

Assembly: XNACS1Lib_PC (in XNACS1Lib_PC.dll)

See Also

XNACS1Base.World Members | XNACS1Lib Namespace


XNACS1Base.World Members

XNACS1Base.World Members

XNACS1Base.World overview

Public Static Fields

TicksInASecond Number of ticks in one second.

Public Static Properties

Paused | Pausing the World Update (ShouldTravel primitive will stop moving).
WorldMin | Get the coodinate position that corresponds to the lower-left corner of the world.
WorldMax | Get the coordinate position that corresponds to the upper-right corner of the world.
WorldDimension | Get the dimension (width/height) of the world.

Public Static Methods

ClampAtWorldBound | Ensures that the inputPrimitive is kept within bounds of the world. If inputPrimitive position is outside of the world bound, This function will determine the distances to the closes bound and force the inputPrimitive to be insde that world bound.
CollideWorldBound | Collide the inputPrimitive with the worldBound and return which of the worldBound (left/right/top/bottom or inside) did this primitive intersect with.
OutsideWorldBound | Returns true if the inputPrimitive is outside of the worldBound.
RemoveAllFromDrawSet | Remove all Primitives from the default draw set. After this funciton, you will observe a blank screen.
SetBackgroundColor | Sets the background color.
SetBackgroundTexture | Set the background texture. The texture image will cover the entire background such that the background color will not be visible.
SetWorldCoordinate | Defines the world coordinate system to draw in.
SetZuneToLandscape | When on the Zune, run in landscape mode (default is portait mode)

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


XNACS1Base.World Fields

XNACS1Base.World Fields

The fields of the XNACS1Base.World class are listed below. For a complete list of XNACS1Base.World class members, see the XNACS1Base.World Members topic.

Public Static Fields

TicksInASecond Number of ticks in one second.

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


XNACS1Base.World.TicksInASecond Field

XNACS1Base.World.TicksInASecond Field

Number of ticks in one second.

public const Int32 TicksInASecond = 40;

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


XNACS1Base.World Properties

XNACS1Base.World Properties

The properties of the XNACS1Base.World class are listed below. For a complete list of XNACS1Base.World class members, see the XNACS1Base.World Members topic.

Public Static Properties

Paused | Pausing the World Update (ShouldTravel primitive will stop moving).
WorldMin | Get the coodinate position that corresponds to the lower-left corner of the world.
WorldMax | Get the coordinate position that corresponds to the upper-right corner of the world.
WorldDimension | Get the dimension (width/height) of the world.

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


Paused Property

XNACS1Base.World.Paused Property

Pausing the World Update (ShouldTravel primitive will stop moving).

public static Boolean Paused {get; set;}

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


WorldDimension Property

XNACS1Base.World.WorldDimension Property

Get the dimension (width/height) of the world.

public static Vector2 WorldDimension {get;}

See Also

XNACS1Base.World Class | XNACS1Lib Namespace | WorldMin | WorldMax


WorldMax Property

XNACS1Base.World.WorldMax Property

Get the coordinate position that corresponds to the upper-right corner of the world.

public static Vector2 WorldMax {get;}

See Also

XNACS1Base.World Class | XNACS1Lib Namespace | WorldMin | WorldDimension


WorldMin Property

XNACS1Base.World.WorldMin Property

Get the coodinate position that corresponds to the lower-left corner of the world.

public static Vector2 WorldMin {get;}

See Also

XNACS1Base.World Class | XNACS1Lib Namespace | WorldMax | WorldDimension


XNACS1Base.World Methods

XNACS1Base.World Methods

The methods of the XNACS1Base.World class are listed below. For a complete list of XNACS1Base.World class members, see the XNACS1Base.World Members topic.

Public Static Methods

ClampAtWorldBound | Ensures that the inputPrimitive is kept within bounds of the world. If inputPrimitive position is outside of the world bound, This function will determine the distances to the closes bound and force the inputPrimitive to be insde that world bound.
CollideWorldBound | Collide the inputPrimitive with the worldBound and return which of the worldBound (left/right/top/bottom or inside) did this primitive intersect with.
OutsideWorldBound | Returns true if the inputPrimitive is outside of the worldBound.
RemoveAllFromDrawSet | Remove all Primitives from the default draw set. After this funciton, you will observe a blank screen.
SetBackgroundColor | Sets the background color.
SetBackgroundTexture | Set the background texture. The texture image will cover the entire background such that the background color will not be visible.
SetWorldCoordinate | Defines the world coordinate system to draw in.
SetZuneToLandscape | When on the Zune, run in landscape mode (default is portait mode)

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


XNACS1Base.World.ClampAtWorldBound Method

XNACS1Base.World.ClampAtWorldBound Method

Ensures that the inputPrimitive is kept within bounds of the world. If inputPrimitive position is outside of the world bound, This function will determine the distances to the closes bound and force the inputPrimitive to be insde that world bound.

public static BoundCollideStatus ClampAtWorldBound(
XNACS1Primitive inputPrimitive
);

Parameters

inputPrimitive
The primtive to be tested

Return Value

Which of the world bound that the inputPrimitive has moved out of.

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


XNACS1Base.World.CollideWorldBound Method

XNACS1Base.World.CollideWorldBound Method

Collide the inputPrimitive with the worldBound and return which of the worldBound (left/right/top/bottom or inside) did this primitive intersect with.

public static BoundCollideStatus CollideWorldBound(
XNACS1Primitive inputPrimitive
);

Parameters

inputPrimitive
Primitive to be tested

Return Value

The side upon which the primitive has collided with (or if the primitive is inside the world bound).

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


XNACS1Base.World.OutsideWorldBound Method

XNACS1Base.World.OutsideWorldBound Method

Returns true if the inputPrimitive is outside of the worldBound.

public static bool OutsideWorldBound(
XNACS1Primitive inputPrimitive
);

Parameters

inputPrimitive
the primitive to check

Return Value

True if inputPrimitive is outside the world bound, otherwise returns false.

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


XNACS1Base.World.RemoveAllFromDrawSet Method

XNACS1Base.World.RemoveAllFromDrawSet Method

Remove all Primitives from the default draw set. After this funciton, you will observe a blank screen.

public static void RemoveAllFromDrawSet();

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


XNACS1Base.World.SetBackgroundColor Method

XNACS1Base.World.SetBackgroundColor Method

Sets the background color.

public static void SetBackgroundColor(
Color bgColor
);

Parameters

bgColor
The specified color for the entire background.

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


XNACS1Base.World.SetBackgroundTexture Method

XNACS1Base.World.SetBackgroundTexture Method

Set the background texture. The texture image will cover the entire background such that the background color will not be visible.

public static void SetBackgroundTexture(
String tex
);

Parameters

tex
name of the background texture image.

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


XNACS1Base.World.SetWorldCoordinate Method

XNACS1Base.World.SetWorldCoordinate Method

Defines the world coordinate system to draw in.

public static void SetWorldCoordinate(
Vector2 min,
Single width
);

Parameters

min
Coordinate position of the lower left corner of the drawing window.
width
Width represented by the drawing window.

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


XNACS1Base.World.SetZuneToLandscape Method

XNACS1Base.World.SetZuneToLandscape Method

When on the Zune, run in landscape mode (default is portait mode)

public static void SetZuneToLandscape(
Boolean toLandscape
);

Parameters

toLandscape
if true, sets the Zune to run in landscape mode

See Also

XNACS1Base.World Class | XNACS1Lib Namespace


XNACS1Circle Class

XNACS1Circle Class

A circle primitive.

For a list of all members of this type, see XNACS1Circle Members.

System.Object
XNACS1Primitive
XNACS1Circle

public class XNACS1Circle : XNACS1Primitive

Requirements

Namespace: XNACS1Lib

Assembly: XNACS1Lib_PC (in XNACS1Lib_PC.dll)

See Also

XNACS1Circle Members | XNACS1Lib Namespace


XNACS1Circle Members

XNACS1Circle Members

XNACS1Circle overview

Public Instance Constructors

XNACS1Circle Overloaded. Initializes a new instance of the XNACS1Circle class.

Public Instance Properties

Center (inherited from XNACS1Primitive) | Center of the primitive.
CenterX (inherited from XNACS1Primitive) | X coordinate of the center position of the primitive.
CenterY (inherited from XNACS1Primitive) | Y coordinate of the center position of the primitive.
Color (inherited from XNACS1Primitive) | Color of the primitive. (undefined for PrimitiveSet).
FrontDirection (inherited from XNACS1Primitive) | Sets the front direction of the primitive. Setting FrontDireciton will cause the RotateAngle of the primitive to be updated accordingly. y default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction
Label (inherited from XNACS1Primitive) | Annotated text label to be associated with the primitive.
LabelColor (inherited from XNACS1Primitive) | Color of the anontated text label.
MaxBound (inherited from XNACS1Primitive) | Upper left corner of the primitive.
MinBound (inherited from XNACS1Primitive) | Lower left corner of the Primitive.
Radius | Radius of the circle.
RotateAngle (inherited from XNACS1Primitive) | Rotate the primitive by the Angle specified (in degree). After the rotation, the FrontDirection of the primitive will be udpated accordingly. By default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction
ShouldTravel (inherited from XNACS1Primitive) | Defines if the primitive should move by its current velocity. Defaults to false.
Speed (inherited from XNACS1Primitive) | Get/Set the speed (magnitude of the Velocity vector) for the velocity.
Texture (inherited from XNACS1Primitive) | Texture file name (without the "." or the extension) to cover the primitive.
Velocity (inherited from XNACS1Primitive) | Velocity of a primitive. This is a true velocity: with magnitude (speed) and direction for tavel.
VelocityDirection (inherited from XNACS1Primitive) | Get/Set the direction of the velocity.
VelocityX (inherited from XNACS1Primitive) | Get/Set the x-component of the primitive velocity.
VelocityY (inherited from XNACS1Primitive) | Get/Set the y-component of the primitive velocity.
Visible (inherited from XNACS1Primitive) | Whether the primitive is visible.

Public Instance Methods

Above (inherited from XNACS1Primitive) | Returns if the center of this primitive is "above" (in y) in relation to the center of otherPrimitive.
AddToAutoDrawSet (inherited from XNACS1Primitive) | Add this primitive to the AutoDrawSet. If this primitive already exists in the draw set, this function call is ignored. By default, all primitive are added into the AutoDrawSet.
Below (inherited from XNACS1Primitive) | Returns if the center of this primitive is "below" (in y) in relation to the center of otherPrimitive.
Collided (inherited from XNACS1Primitive) | Overloaded. Determines if this primitive collides with the otherPrimitive. If true, pos is the colliding position.
Draw (inherited from XNACS1Primitive) | If visible, draws the primitive with the associated text label.
HasNonZeroVelocity (inherited from XNACS1Primitive) | Retruns if the current velocity is non-zero.
IsInAutoDrawSet (inherited from XNACS1Primitive) | Determines if this primitive is in the AutoDrawSet.
LeftOf (inherited from XNACS1Primitive) | Returns if the center of this primitive is "to the left" (in x) in relation to the center of otherPrimtive
RemoveFromAutoDrawSet (inherited from XNACS1Primitive) | Remove this primitive from the AutoDrawSet. After this function call, this primitive will not be drawn in the application window.
RightOf (inherited from XNACS1Primitive) | Returns if the center of this primitive is "to the right" (in x) in relation to the center of otherPrimitive
TopOfAutoDrawSet (inherited from XNACS1Primitive) | Make sure this primitive is drawn on top of all other primitives.
TravelPrimitive (inherited from XNACS1Primitive) | Moves the primitive during each update cycle. This function is automacially called for all visible primitives. Default behavior is to move the primitive if: . Primitive is visible (invivislble primitive is not updated) . ShouldTravel is true . HasNonZeroVelocity() is true

Protected Instance Methods

DrawPrimitive Draws the circle.

Protected Internal Instance Properties

Size (inherited from XNACS1Primitive) | Get/Set width/height of the primitive.
SizeX (inherited from XNACS1Primitive) | Width of the primitive.
SizeY (inherited from XNACS1Primitive) | Height of the primitive. For PrimitiveCircle (diameter), PrimitiveRectangle (height), PrimitiveSet (undefined).

See Also

XNACS1Circle Class | XNACS1Lib Namespace


XNACS1Circle Constructor

XNACS1Circle Constructor

Contstructs a circle.

Overload List

Constructs a circle, with center located at (0,0), and radius of 1.0.

public XNACS1Circle();

Constructs a circle.

public XNACS1Circle(Vector2,Single);

Contstructs a circle.

public XNACS1Circle(Vector2,Single,String);

See Also

XNACS1Circle Class | XNACS1Lib Namespace


XNACS1Circle Constructor (Vector2, Single, String)

XNACS1Circle Constructor (Vector2, Single, String)

Game-Themed Introductory Programming Project

Contstructs a circle.

public XNACS1Circle(
Vector2 center,
Single radius,
String tex
);

Parameters

center
center of the circle.
radius
radius of the circle.
tex
texture to be used for the circle.

See Also

XNACS1Circle Class | XNACS1Lib Namespace | XNACS1Circle Constructor Overload List


XNACS1Circle Constructor (Vector2, Single)

XNACS1Circle Constructor (Vector2, Single)

Game-Themed Introductory Programming Project

Constructs a circle.

public XNACS1Circle(
Vector2 center,
Single radius
);

Parameters

center
center of the circle.
radius
radius of the circle.

See Also

XNACS1Circle Class | XNACS1Lib Namespace | XNACS1Circle Constructor Overload List


XNACS1Circle Constructor ()

XNACS1Circle Constructor ()

Game-Themed Introductory Programming Project

Constructs a circle, with center located at (0,0), and radius of 1.0.

public XNACS1Circle();

See Also

XNACS1Circle Class | XNACS1Lib Namespace | XNACS1Circle Constructor Overload List


XNACS1Circle Properties

XNACS1Circle Properties

The properties of the XNACS1Circle class are listed below. For a complete list of XNACS1Circle class members, see the XNACS1Circle Members topic.

Public Instance Properties

Center (inherited from XNACS1Primitive) | Center of the primitive.
CenterX (inherited from XNACS1Primitive) | X coordinate of the center position of the primitive.
CenterY (inherited from XNACS1Primitive) | Y coordinate of the center position of the primitive.
Color (inherited from XNACS1Primitive) | Color of the primitive. (undefined for PrimitiveSet).
FrontDirection (inherited from XNACS1Primitive) | Sets the front direction of the primitive. Setting FrontDireciton will cause the RotateAngle of the primitive to be updated accordingly. y default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction
Label (inherited from XNACS1Primitive) | Annotated text label to be associated with the primitive.
LabelColor (inherited from XNACS1Primitive) | Color of the anontated text label.
MaxBound (inherited from XNACS1Primitive) | Upper left corner of the primitive.
MinBound (inherited from XNACS1Primitive) | Lower left corner of the Primitive.
Radius | Radius of the circle.
RotateAngle (inherited from XNACS1Primitive) | Rotate the primitive by the Angle specified (in degree). After the rotation, the FrontDirection of the primitive will be udpated accordingly. By default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction
ShouldTravel (inherited from XNACS1Primitive) | Defines if the primitive should move by its current velocity. Defaults to false.
Speed (inherited from XNACS1Primitive) | Get/Set the speed (magnitude of the Velocity vector) for the velocity.
Texture (inherited from XNACS1Primitive) | Texture file name (without the "." or the extension) to cover the primitive.
Velocity (inherited from XNACS1Primitive) | Velocity of a primitive. This is a true velocity: with magnitude (speed) and direction for tavel.
VelocityDirection (inherited from XNACS1Primitive) | Get/Set the direction of the velocity.
VelocityX (inherited from XNACS1Primitive) | Get/Set the x-component of the primitive velocity.
VelocityY (inherited from XNACS1Primitive) | Get/Set the y-component of the primitive velocity.
Visible (inherited from XNACS1Primitive) | Whether the primitive is visible.

Protected Internal Instance Properties

Size (inherited from XNACS1Primitive) | Get/Set width/height of the primitive.
SizeX (inherited from XNACS1Primitive) | Width of the primitive.
SizeY (inherited from XNACS1Primitive) | Height of the primitive. For PrimitiveCircle (diameter), PrimitiveRectangle (height), PrimitiveSet (undefined).

See Also

XNACS1Circle Class | XNACS1Lib Namespace


Radius Property

XNACS1Circle.Radius Property

Radius of the circle.

public Single Radius {get; set;}

See Also

XNACS1Circle Class | XNACS1Lib Namespace


XNACS1Circle Methods

XNACS1Circle Methods

The methods of the XNACS1Circle class are listed below. For a complete list of XNACS1Circle class members, see the XNACS1Circle Members topic.

Public Instance Methods

Above (inherited from XNACS1Primitive) | Returns if the center of this primitive is "above" (in y) in relation to the center of otherPrimitive.
AddToAutoDrawSet (inherited from XNACS1Primitive) | Add this primitive to the AutoDrawSet. If this primitive already exists in the draw set, this function call is ignored. By default, all primitive are added into the AutoDrawSet.
Below (inherited from XNACS1Primitive) | Returns if the center of this primitive is "below" (in y) in relation to the center of otherPrimitive.
Collided (inherited from XNACS1Primitive) | Overloaded. Determines if this primitive collides with the otherPrimitive. If true, pos is the colliding position.
Draw (inherited from XNACS1Primitive) | If visible, draws the primitive with the associated text label.
HasNonZeroVelocity (inherited from XNACS1Primitive) | Retruns if the current velocity is non-zero.
IsInAutoDrawSet (inherited from XNACS1Primitive) | Determines if this primitive is in the AutoDrawSet.
LeftOf (inherited from XNACS1Primitive) | Returns if the center of this primitive is "to the left" (in x) in relation to the center of otherPrimtive
RemoveFromAutoDrawSet (inherited from XNACS1Primitive) | Remove this primitive from the AutoDrawSet. After this function call, this primitive will not be drawn in the application window.
RightOf (inherited from XNACS1Primitive) | Returns if the center of this primitive is "to the right" (in x) in relation to the center of otherPrimitive
TopOfAutoDrawSet (inherited from XNACS1Primitive) | Make sure this primitive is drawn on top of all other primitives.
TravelPrimitive (inherited from XNACS1Primitive) | Moves the primitive during each update cycle. This function is automacially called for all visible primitives. Default behavior is to move the primitive if: . Primitive is visible (invivislble primitive is not updated) . ShouldTravel is true . HasNonZeroVelocity() is true

Protected Instance Methods

DrawPrimitive Draws the circle.

See Also

XNACS1Circle Class | XNACS1Lib Namespace


XNACS1Circle.DrawPrimitive Method

XNACS1Circle.DrawPrimitive Method

Draws the circle.

protected override void DrawPrimitive();

See Also

XNACS1Circle Class | XNACS1Lib Namespace


XNACS1Primitive Class

XNACS1Primitive Class

This is the base class for the behavior of Primitives (circle, rectangle, and primitive-set).

For a list of all members of this type, see XNACS1Primitive Members.

System.Object
XNACS1Primitive
XNACS1Circle
XNACS1Rectangle

public class XNACS1Primitive

Requirements

Namespace: XNACS1Lib

Assembly: XNACS1Lib_PC (in XNACS1Lib_PC.dll)

See Also

XNACS1Primitive Members | XNACS1Lib Namespace


XNACS1Primitive Members

XNACS1Primitive Members

XNACS1Primitive overview

Public Instance Properties

Center | Center of the primitive.
CenterX | X coordinate of the center position of the primitive.
CenterY | Y coordinate of the center position of the primitive.
Color | Color of the primitive. (undefined for PrimitiveSet).
FrontDirection | Sets the front direction of the primitive. Setting FrontDireciton will cause the RotateAngle of the primitive to be updated accordingly. y default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction
Label | Annotated text label to be associated with the primitive.
LabelColor | Color of the anontated text label.
MaxBound | Upper left corner of the primitive.
MinBound | Lower left corner of the Primitive.
RotateAngle | Rotate the primitive by the Angle specified (in degree). After the rotation, the FrontDirection of the primitive will be udpated accordingly. By default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction
ShouldTravel | Defines if the primitive should move by its current velocity. Defaults to false.
Speed | Get/Set the speed (magnitude of the Velocity vector) for the velocity.
Texture | Texture file name (without the "." or the extension) to cover the primitive.
Velocity | Velocity of a primitive. This is a true velocity: with magnitude (speed) and direction for tavel.
VelocityDirection | Get/Set the direction of the velocity.
VelocityX | Get/Set the x-component of the primitive velocity.
VelocityY | Get/Set the y-component of the primitive velocity.
Visible | Whether the primitive is visible.

Public Instance Methods

Above | Returns if the center of this primitive is "above" (in y) in relation to the center of otherPrimitive.
AddToAutoDrawSet | Add this primitive to the AutoDrawSet. If this primitive already exists in the draw set, this function call is ignored. By default, all primitive are added into the AutoDrawSet.
Below | Returns if the center of this primitive is "below" (in y) in relation to the center of otherPrimitive.
Collided | Overloaded. Determines if this primitive collides with the otherPrimitive. If true, pos is the colliding position.
Draw | If visible, draws the primitive with the associated text label.
HasNonZeroVelocity | Retruns if the current velocity is non-zero.
IsInAutoDrawSet | Determines if this primitive is in the AutoDrawSet.
LeftOf | Returns if the center of this primitive is "to the left" (in x) in relation to the center of otherPrimtive
RemoveFromAutoDrawSet | Remove this primitive from the AutoDrawSet. After this function call, this primitive will not be drawn in the application window.
RightOf | Returns if the center of this primitive is "to the right" (in x) in relation to the center of otherPrimitive
TopOfAutoDrawSet | Make sure this primitive is drawn on top of all other primitives.
TravelPrimitive | Moves the primitive during each update cycle. This function is automacially called for all visible primitives. Default behavior is to move the primitive if: . Primitive is visible (invivislble primitive is not updated) . ShouldTravel is true . HasNonZeroVelocity() is true

Protected Instance Methods

DrawPrimitive Draws the primitive.

Protected Internal Instance Properties

Size | Get/Set width/height of the primitive.
SizeX | Width of the primitive.
SizeY | Height of the primitive. For PrimitiveCircle (diameter), PrimitiveRectangle (height), PrimitiveSet (undefined).

See Also

XNACS1Primitive Class | XNACS1Lib Namespace


XNACS1Primitive Properties

XNACS1Primitive Properties

The properties of the XNACS1Primitive class are listed below. For a complete list of XNACS1Primitive class members, see the XNACS1Primitive Members topic.

Public Instance Properties

Center | Center of the primitive.
CenterX | X coordinate of the center position of the primitive.
CenterY | Y coordinate of the center position of the primitive.
Color | Color of the primitive. (undefined for PrimitiveSet).
FrontDirection | Sets the front direction of the primitive. Setting FrontDireciton will cause the RotateAngle of the primitive to be updated accordingly. y default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction
Label | Annotated text label to be associated with the primitive.
LabelColor | Color of the anontated text label.
MaxBound | Upper left corner of the primitive.
MinBound | Lower left corner of the Primitive.
RotateAngle | Rotate the primitive by the Angle specified (in degree). After the rotation, the FrontDirection of the primitive will be udpated accordingly. By default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction
ShouldTravel | Defines if the primitive should move by its current velocity. Defaults to false.
Speed | Get/Set the speed (magnitude of the Velocity vector) for the velocity.
Texture | Texture file name (without the "." or the extension) to cover the primitive.
Velocity | Velocity of a primitive. This is a true velocity: with magnitude (speed) and direction for tavel.
VelocityDirection | Get/Set the direction of the velocity.
VelocityX | Get/Set the x-component of the primitive velocity.
VelocityY | Get/Set the y-component of the primitive velocity.
Visible | Whether the primitive is visible.

Protected Internal Instance Properties

Size | Get/Set width/height of the primitive.
SizeX | Width of the primitive.
SizeY | Height of the primitive. For PrimitiveCircle (diameter), PrimitiveRectangle (height), PrimitiveSet (undefined).

See Also

XNACS1Primitive Class | XNACS1Lib Namespace


Center Property

XNACS1Primitive.Center Property

Center of the primitive.

public Vector2 Center {get; set;}

Remarks

For PrimitiveCircle (center), PrimitiveRectangle (center), PrimitiveSet (undefined).

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | CenterX | CenterY | XNACS1Rectangle | XNACS1Circle


CenterX Property

XNACS1Primitive.CenterX Property

X coordinate of the center position of the primitive.

public Single CenterX {get; set;}

Remarks

For PrimitiveCircle (x-position of center), PrimitiveRectangle (x-position of center), PrimitiveSet (undefined).

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | Center | XNACS1Rectangle | XNACS1Circle


CenterY Property

XNACS1Primitive.CenterY Property

Y coordinate of the center position of the primitive.

public Single CenterY {get; set;}

Remarks

For PrimitiveCircle (y-position of center), PrimitiveRectangle (y-position of center), PrimitiveSet (undefined).

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | Center | XNACS1Rectangle | XNACS1Circle


Color Property

XNACS1Primitive.Color Property

Color of the primitive. (undefined for PrimitiveSet).

public Color Color {get; set;}

Remarks

When texture file name is valid, Color inforamtion is ignored.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | Color | Texture


FrontDirection Property

XNACS1Primitive.FrontDirection Property

Sets the front direction of the primitive. Setting FrontDireciton will cause the RotateAngle of the primitive to be updated accordingly. y default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction

public Vector2 FrontDirection {get; set;}

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | RotateAngle


Label Property

XNACS1Primitive.Label Property

Annotated text label to be associated with the primitive.

public String Label {get; set;}

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | LabelColor


LabelColor Property

XNACS1Primitive.LabelColor Property

Color of the anontated text label.

public Color LabelColor {get; set;}

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | Label


MaxBound Property

XNACS1Primitive.MaxBound Property

Upper left corner of the primitive.

public Vector2 MaxBound {get;}

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | MinBound | XNACS1Rectangle | XNACS1Circle


MinBound Property

XNACS1Primitive.MinBound Property

Lower left corner of the Primitive.

public Vector2 MinBound {get;}

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | MaxBound | XNACS1Rectangle | XNACS1Circle


RotateAngle Property

XNACS1Primitive.RotateAngle Property

Rotate the primitive by the Angle specified (in degree). After the rotation, the FrontDirection of the primitive will be udpated accordingly. By default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction

public Single RotateAngle {get; set;}

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | FrontDirection


ShouldTravel Property

XNACS1Primitive.ShouldTravel Property

Defines if the primitive should move by its current velocity. Defaults to false.

public Boolean ShouldTravel {get; set;}

Remarks

Must be set to true for a primitive to move.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | Velocity


Size Property

XNACS1Primitive.Size Property

Get/Set width/height of the primitive.

protected internal Vector2 Size {get; set;}

Remarks

For PrimitiveCircle (diameter), PrimitiveRectangle (width/height), PrimitiveSet (undefined)

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | SizeX | SizeY | XNACS1Rectangle | XNACS1Circle


SizeX Property

XNACS1Primitive.SizeX Property

Width of the primitive.

protected internal Single SizeX {get; set;}

Remarks

For PrimitiveCircle (diameter), PrimitiveRectangle (width), PrimitiveSet (undefined).

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | Size | XNACS1Rectangle | XNACS1Circle


SizeY Property

XNACS1Primitive.SizeY Property

Height of the primitive. For PrimitiveCircle (diameter), PrimitiveRectangle (height), PrimitiveSet (undefined).

protected internal Single SizeY {get; set;}

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | Size | XNACS1Rectangle | XNACS1Circle


Speed Property

XNACS1Primitive.Speed Property

Get/Set the speed (magnitude of the Velocity vector) for the velocity.

public Single Speed {get; set;}

Remarks

The direction which the primitive is traveling will not change, just how fast it is moving will be updated. Primitive with non-zero velocity will move only when ShouldTravel is set to true.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | Velocity | VelocityDirection | ShouldTravel


Texture Property

XNACS1Primitive.Texture Property

Texture file name (without the "." or the extension) to cover the primitive.

public String Texture {get; set;}

Remarks

When texture file name is valid, Color inforamtion is ignored.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | Color


Velocity Property

XNACS1Primitive.Velocity Property

Velocity of a primitive. This is a true velocity: with magnitude (speed) and direction for tavel.

public Vector2 Velocity {get; set;}

Remarks

Primitive with non-zero velocity will move only when ShouldTravel is set to true.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | ShouldTravel | VelocityX | VelocityY | VelocityDirection | Speed


VelocityDirection Property

XNACS1Primitive.VelocityDirection Property

Get/Set the direction of the velocity.

public Vector2 VelocityDirection {get; set;}

Remarks

The speed upon which the primitive travels will not change, only the direction will be updated. Primitive with non-zero velocity will move only when ShouldTravel is set to true.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | ShouldTravel | Velocity | Speed


VelocityX Property

XNACS1Primitive.VelocityX Property

Get/Set the x-component of the primitive velocity.

public Single VelocityX {get; set;}

Remarks

Primitive with non-zero velocity will move only when ShouldTravel is set to true.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | Velocity | ShouldTravel


VelocityY Property

XNACS1Primitive.VelocityY Property

Get/Set the y-component of the primitive velocity.

public Single VelocityY {get; set;}

Remarks

Primitive with non-zero velocity will move only when ShouldTravel is set to true.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | Velocity | ShouldTravel


Visible Property

XNACS1Primitive.Visible Property

Whether the primitive is visible.

public Boolean Visible {get; set;}

See Also

XNACS1Primitive Class | XNACS1Lib Namespace


XNACS1Primitive Methods

XNACS1Primitive Methods

The methods of the XNACS1Primitive class are listed below. For a complete list of XNACS1Primitive class members, see the XNACS1Primitive Members topic.

Public Instance Methods

Above | Returns if the center of this primitive is "above" (in y) in relation to the center of otherPrimitive.
AddToAutoDrawSet | Add this primitive to the AutoDrawSet. If this primitive already exists in the draw set, this function call is ignored. By default, all primitive are added into the AutoDrawSet.
Below | Returns if the center of this primitive is "below" (in y) in relation to the center of otherPrimitive.
Collided | Overloaded. Determines if this primitive collides with the otherPrimitive. If true, pos is the colliding position.
Draw | If visible, draws the primitive with the associated text label.
HasNonZeroVelocity | Retruns if the current velocity is non-zero.
IsInAutoDrawSet | Determines if this primitive is in the AutoDrawSet.
LeftOf | Returns if the center of this primitive is "to the left" (in x) in relation to the center of otherPrimtive
RemoveFromAutoDrawSet | Remove this primitive from the AutoDrawSet. After this function call, this primitive will not be drawn in the application window.
RightOf | Returns if the center of this primitive is "to the right" (in x) in relation to the center of otherPrimitive
TopOfAutoDrawSet | Make sure this primitive is drawn on top of all other primitives.
TravelPrimitive | Moves the primitive during each update cycle. This function is automacially called for all visible primitives. Default behavior is to move the primitive if: . Primitive is visible (invivislble primitive is not updated) . ShouldTravel is true . HasNonZeroVelocity() is true

Protected Instance Methods

DrawPrimitive Draws the primitive.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace


XNACS1Primitive.Above Method

XNACS1Primitive.Above Method

Returns if the center of this primitive is "above" (in y) in relation to the center of otherPrimitive.

public bool Above(
XNACS1Primitive otherPrimitive
);

Parameters

otherPrimitive
the other primitive.

Return Value

True: if the center's y value of this primitive is greater than the y value of the max bound of otherPrimitive, returns false otherwise.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace


XNACS1Primitive.AddToAutoDrawSet Method

XNACS1Primitive.AddToAutoDrawSet Method

Add this primitive to the AutoDrawSet. If this primitive already exists in the draw set, this function call is ignored. By default, all primitive are added into the AutoDrawSet.

public virtual void AddToAutoDrawSet();

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | TopOfAutoDrawSet | IsInAutoDrawSet | RemoveFromAutoDrawSet


XNACS1Primitive.Below Method

XNACS1Primitive.Below Method

Returns if the center of this primitive is "below" (in y) in relation to the center of otherPrimitive.

public bool Below(
XNACS1Primitive otherPrmitive
);

Parameters

otherPrmitive
the other primitive.

Return Value

True: if the center's y value of this primitive is smaller than the y value of the min bound of otherPrimitive, returns false otherwise.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace


Collided Method

XNACS1Primitive.Collided Method

Determines if this primitive collides with otherPrimitive.

Overload List

Determines if this primitive collides with otherPrimitive.

public bool Collided(XNACS1Primitive);

Determines if this primitive collides with the otherPrimitive. If true, pos is the colliding position.

public bool Collided(XNACS1Primitive,Vector2);

See Also

XNACS1Primitive Class | XNACS1Lib Namespace


XNACS1Primitive.Collided Method (XNACS1Primitive)

XNACS1Primitive.Collided Method (XNACS1Primitive)

Game-Themed Introductory Programming Project

Determines if this primitive collides with otherPrimitive.

public bool Collided(
XNACS1Primitive otherPrimitive
);

Parameters

otherPrimitive
the other primitive.

Return Value

True: if the two primitives has collided. False: if the two primitives do not collide.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | XNACS1Primitive.Collided Overload List


XNACS1Primitive.Collided Method (XNACS1Primitive, Vector2)

XNACS1Primitive.Collided Method (XNACS1Primitive, Vector2)

Game-Themed Introductory Programming Project

Determines if this primitive collides with the otherPrimitive. If true, pos is the colliding position.

public bool Collided(
XNACS1Primitive otherPrimitive,
Vector2 pos
);

Parameters

otherPrimitive
the other primitive.
pos
If two primitives collide, this is the "average" of all the possible colliding positions.

Return Value

True: if the two primitives has collided. Pos is the approximated colliding position. False: if the two primitives do not collide, (Pos is undefined in this case).

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | XNACS1Primitive.Collided Overload List


XNACS1Primitive.Draw Method

XNACS1Primitive.Draw Method

If visible, draws the primitive with the associated text label.

public void Draw();

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | Label


XNACS1Primitive.DrawPrimitive Method

XNACS1Primitive.DrawPrimitive Method

Draws the primitive.

protected abstract void DrawPrimitive();

See Also

XNACS1Primitive Class | XNACS1Lib Namespace


XNACS1Primitive.HasNonZeroVelocity Method

XNACS1Primitive.HasNonZeroVelocity Method

Retruns if the current velocity is non-zero.

public bool HasNonZeroVelocity();

Return Value

True, if velocity is non-zero, otherwise, returns false.

Remarks

When a primitive is moving very slowly (speed at 1/100,000 of world dimension), its velocity will be set to zero. This avoids final "jittering" of primitives that are moving very slowly.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace


XNACS1Primitive.IsInAutoDrawSet Method

XNACS1Primitive.IsInAutoDrawSet Method

Determines if this primitive is in the AutoDrawSet.

public virtual bool IsInAutoDrawSet();

Return Value

True: if this primitive is in the AutoDrawSet, otherwise returns false.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | AddToAutoDrawSet | TopOfAutoDrawSet | RemoveFromAutoDrawSet


XNACS1Primitive.LeftOf Method

XNACS1Primitive.LeftOf Method

Returns if the center of this primitive is "to the left" (in x) in relation to the center of otherPrimtive

public bool LeftOf(
XNACS1Primitive otherPrimitive
);

Parameters

otherPrimitive
the other primitive

Return Value

True: if the center's x value of this primitive is smaller than the x value of the min bound of otherPrimitive

See Also

XNACS1Primitive Class | XNACS1Lib Namespace


XNACS1Primitive.RemoveFromAutoDrawSet Method

XNACS1Primitive.RemoveFromAutoDrawSet Method

Remove this primitive from the AutoDrawSet. After this function call, this primitive will not be drawn in the application window.

public virtual void RemoveFromAutoDrawSet();

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | AddToAutoDrawSet | TopOfAutoDrawSet | IsInAutoDrawSet


XNACS1Primitive.RightOf Method

XNACS1Primitive.RightOf Method

Returns if the center of this primitive is "to the right" (in x) in relation to the center of otherPrimitive

public bool RightOf(
XNACS1Primitive otherPrimitive
);

Parameters

otherPrimitive
the other primitive

Return Value

True: if the center's x value of this primitive is larger than the x value of the max bound of the otherPrimitive.

See Also

XNACS1Primitive Class | XNACS1Lib Namespace


XNACS1Primitive.TopOfAutoDrawSet Method

XNACS1Primitive.TopOfAutoDrawSet Method

Make sure this primitive is drawn on top of all other primitives.

public virtual void TopOfAutoDrawSet();

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | AddToAutoDrawSet | IsInAutoDrawSet | RemoveFromAutoDrawSet


XNACS1Primitive.TravelPrimitive Method

XNACS1Primitive.TravelPrimitive Method

Moves the primitive during each update cycle. This function is automacially called for all visible primitives. Default behavior is to move the primitive if: . Primitive is visible (invivislble primitive is not updated) . ShouldTravel is true . HasNonZeroVelocity() is true

public virtual void TravelPrimitive();

See Also

XNACS1Primitive Class | XNACS1Lib Namespace | Visible | ShouldTravel | HasNonZeroVelocity


XNACS1PrimitiveSet Class

XNACS1PrimitiveSet Class

XNACS1PrimitiveSet supports hiding/unhiding a collection of Primitives (Circle, or Rectangle).

For a list of all members of this type, see XNACS1PrimitiveSet Members.

System.Object
XNACS1PrimitiveSet

public class XNACS1PrimitiveSet

Remarks

This class is designed to be used where related primitives can be added/removed from the AutoDrawSet as a group. Typically, you would insert related primitives (e.g., all primitives associated with a car) into a PrimitiveSet. By default all the prmitives in the PrimitiveSet will be drawn in the application window. When required to hide this group of primitives (e.g., car moved out of world bound), you can remove the PrimitiveSet from the AutoDrawSet resutling in hiding all the primitives inthe set. Later on, you can add this PrimitiveSet back into the AutoDrawSet to unhide the primitives (e.g., the car moved back into the world bound). Removing all primitives from this set will result in the primitives being removed from the AutoDrawSet.

Requirements

Namespace: XNACS1Lib

Assembly: XNACS1Lib_PC (in XNACS1Lib_PC.dll)

See Also

XNACS1PrimitiveSet Members | XNACS1Lib Namespace


XNACS1PrimitiveSet Members

XNACS1PrimitiveSet Members

XNACS1PrimitiveSet overview

Public Instance Constructors

XNACS1PrimitiveSet Constructor Defines a collection structure for storing a group of XNACS1Primitives (Circle, Rectangle, or other PrimitiveSet).

Public Instance Methods

AddAllToAutoDraw | Add all primitives in the set to the AutoDrawSet. If the primitives in this set are already in the AutoDrawSet then nothing will happen.
AddToSet | Adds the thePrimitive to this set.
IsInDrawSet | Determs if thePrimitive is already in the draw set.
RemoveAllFromAutoDrawSet | Remove all primitives in this set from the AutoDrawSet. After this call, none of the primitives in this set will be visible in the appliation window.
RemoveAllFromSet | Remove all the prmitives from this set. Will aslo remove all the primitives from the AutoDrawSet.
RemoveFromSet | Remove thePrimitive from this set. Will also remove the primitive from the AutoDrawSet.
SetSize | Returns the number of primitives in this set.

See Also

XNACS1PrimitiveSet Class | XNACS1Lib Namespace


XNACS1PrimitiveSet Constructor

XNACS1PrimitiveSet Constructor

Defines a collection structure for storing a group of XNACS1Primitives (Circle, Rectangle, or other PrimitiveSet).

public XNACS1PrimitiveSet();

See Also

XNACS1PrimitiveSet Class | XNACS1Lib Namespace


XNACS1PrimitiveSet Methods

XNACS1PrimitiveSet Methods

The methods of the XNACS1PrimitiveSet class are listed below. For a complete list of XNACS1PrimitiveSet class members, see the XNACS1PrimitiveSet Members topic.

Public Instance Methods

AddAllToAutoDraw | Add all primitives in the set to the AutoDrawSet. If the primitives in this set are already in the AutoDrawSet then nothing will happen.
AddToSet | Adds the thePrimitive to this set.
IsInDrawSet | Determs if thePrimitive is already in the draw set.
RemoveAllFromAutoDrawSet | Remove all primitives in this set from the AutoDrawSet. After this call, none of the primitives in this set will be visible in the appliation window.
RemoveAllFromSet | Remove all the prmitives from this set. Will aslo remove all the primitives from the AutoDrawSet.
RemoveFromSet | Remove thePrimitive from this set. Will also remove the primitive from the AutoDrawSet.
SetSize | Returns the number of primitives in this set.

See Also

XNACS1PrimitiveSet Class | XNACS1Lib Namespace


XNACS1PrimitiveSet.AddAllToAutoDraw Method

XNACS1PrimitiveSet.AddAllToAutoDraw Method

Add all primitives in the set to the AutoDrawSet. If the primitives in this set are already in the AutoDrawSet then nothing will happen.

public virtual void AddAllToAutoDraw();

See Also

XNACS1PrimitiveSet Class | XNACS1Lib Namespace


XNACS1PrimitiveSet.AddToSet Method

XNACS1PrimitiveSet.AddToSet Method

Adds the thePrimitive to this set.

public void AddToSet(
XNACS1Primitive thePrimitive
);

Parameters

thePrimitive
The primitive to be added.

See Also

XNACS1PrimitiveSet Class | XNACS1Lib Namespace


XNACS1PrimitiveSet.IsInDrawSet Method

XNACS1PrimitiveSet.IsInDrawSet Method

Determs if thePrimitive is already in the draw set.

public bool IsInDrawSet(
XNACS1Primitive thePrimitive
);

Parameters

thePrimitive
Primitive to be tested

Return Value

True: if thePrmitive is already in the set, else returns False.

See Also

XNACS1PrimitiveSet Class | XNACS1Lib Namespace


XNACS1PrimitiveSet.RemoveAllFromAutoDrawSet Method

XNACS1PrimitiveSet.RemoveAllFromAutoDrawSet Method

Remove all primitives in this set from the AutoDrawSet. After this call, none of the primitives in this set will be visible in the appliation window.

public virtual void RemoveAllFromAutoDrawSet();

See Also

XNACS1PrimitiveSet Class | XNACS1Lib Namespace


XNACS1PrimitiveSet.RemoveAllFromSet Method

XNACS1PrimitiveSet.RemoveAllFromSet Method

Remove all the prmitives from this set. Will aslo remove all the primitives from the AutoDrawSet.

public void RemoveAllFromSet();

See Also

XNACS1PrimitiveSet Class | XNACS1Lib Namespace


XNACS1PrimitiveSet.RemoveFromSet Method

XNACS1PrimitiveSet.RemoveFromSet Method

Remove thePrimitive from this set. Will also remove the primitive from the AutoDrawSet.

public void RemoveFromSet(
XNACS1Primitive thePrimitive
);

Parameters

thePrimitive
The primitive to be removed from this set.

See Also

XNACS1PrimitiveSet Class | XNACS1Lib Namespace


XNACS1PrimitiveSet.SetSize Method

XNACS1PrimitiveSet.SetSize Method

Returns the number of primitives in this set.

public int SetSize();

Return Value

Numver of primitives in this set.

See Also

XNACS1PrimitiveSet Class | XNACS1Lib Namespace


XNACS1Rectangle Class

XNACS1Rectangle Class

A Rectangle primitive.

For a list of all members of this type, see XNACS1Rectangle Members.

System.Object
XNACS1Primitive
XNACS1Rectangle

public class XNACS1Rectangle : XNACS1Primitive

Requirements

Namespace: XNACS1Lib

Assembly: XNACS1Lib_PC (in XNACS1Lib_PC.dll)

See Also

XNACS1Rectangle Members | XNACS1Lib Namespace


XNACS1Rectangle Members

XNACS1Rectangle Members

XNACS1Rectangle overview

Public Instance Constructors

XNACS1Rectangle Overloaded. Initializes a new instance of the XNACS1Rectangle class.

Public Instance Properties

Center (inherited from XNACS1Primitive) | Center of the primitive.
CenterX (inherited from XNACS1Primitive) | X coordinate of the center position of the primitive.
CenterY (inherited from XNACS1Primitive) | Y coordinate of the center position of the primitive.
Color (inherited from XNACS1Primitive) | Color of the primitive. (undefined for PrimitiveSet).
FrontDirection (inherited from XNACS1Primitive) | Sets the front direction of the primitive. Setting FrontDireciton will cause the RotateAngle of the primitive to be updated accordingly. y default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction
Height | Height of the rectangle.
Label (inherited from XNACS1Primitive) | Annotated text label to be associated with the primitive.
LabelColor (inherited from XNACS1Primitive) | Color of the anontated text label.
LowerLeft | Lower left corner of the rectangle.
MaxBound (inherited from XNACS1Primitive) | Upper left corner of the primitive.
MinBound (inherited from XNACS1Primitive) | Lower left corner of the Primitive.
RotateAngle (inherited from XNACS1Primitive) | Rotate the primitive by the Angle specified (in degree). After the rotation, the FrontDirection of the primitive will be udpated accordingly. By default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction
ShouldTravel (inherited from XNACS1Primitive) | Defines if the primitive should move by its current velocity. Defaults to false.
Speed (inherited from XNACS1Primitive) | Get/Set the speed (magnitude of the Velocity vector) for the velocity.
Texture (inherited from XNACS1Primitive) | Texture file name (without the "." or the extension) to cover the primitive.
Velocity (inherited from XNACS1Primitive) | Velocity of a primitive. This is a true velocity: with magnitude (speed) and direction for tavel.
VelocityDirection (inherited from XNACS1Primitive) | Get/Set the direction of the velocity.
VelocityX (inherited from XNACS1Primitive) | Get/Set the x-component of the primitive velocity.
VelocityY (inherited from XNACS1Primitive) | Get/Set the y-component of the primitive velocity.
Visible (inherited from XNACS1Primitive) | Whether the primitive is visible.
Width | Width of the rectangle.

Public Instance Methods

Above (inherited from XNACS1Primitive) | Returns if the center of this primitive is "above" (in y) in relation to the center of otherPrimitive.
AddToAutoDrawSet (inherited from XNACS1Primitive) | Add this primitive to the AutoDrawSet. If this primitive already exists in the draw set, this function call is ignored. By default, all primitive are added into the AutoDrawSet.
Below (inherited from XNACS1Primitive) | Returns if the center of this primitive is "below" (in y) in relation to the center of otherPrimitive.
Collided (inherited from XNACS1Primitive) | Overloaded. Determines if this primitive collides with the otherPrimitive. If true, pos is the colliding position.
Draw (inherited from XNACS1Primitive) | If visible, draws the primitive with the associated text label.
HasNonZeroVelocity (inherited from XNACS1Primitive) | Retruns if the current velocity is non-zero.
IsInAutoDrawSet (inherited from XNACS1Primitive) | Determines if this primitive is in the AutoDrawSet.
LeftOf (inherited from XNACS1Primitive) | Returns if the center of this primitive is "to the left" (in x) in relation to the center of otherPrimtive
RemoveFromAutoDrawSet (inherited from XNACS1Primitive) | Remove this primitive from the AutoDrawSet. After this function call, this primitive will not be drawn in the application window.
RightOf (inherited from XNACS1Primitive) | Returns if the center of this primitive is "to the right" (in x) in relation to the center of otherPrimitive
SetEndPoints | aPos and bPos are two end positions on the opposite edges of the rectangle. Width is the width of the edge.
TopOfAutoDrawSet (inherited from XNACS1Primitive) | Make sure this primitive is drawn on top of all other primitives.
TravelPrimitive (inherited from XNACS1Primitive) | Moves the primitive during each update cycle. This function is automacially called for all visible primitives. Default behavior is to move the primitive if: . Primitive is visible (invivislble primitive is not updated) . ShouldTravel is true . HasNonZeroVelocity() is true

Protected Instance Methods

DrawPrimitive Draws the Rectangle.

Protected Internal Instance Properties

Size (inherited from XNACS1Primitive) | Get/Set width/height of the primitive.
SizeX (inherited from XNACS1Primitive) | Width of the primitive.
SizeY (inherited from XNACS1Primitive) | Height of the primitive. For PrimitiveCircle (diameter), PrimitiveRectangle (height), PrimitiveSet (undefined).

See Also

XNACS1Rectangle Class | XNACS1Lib Namespace


XNACS1Rectangle Constructor

XNACS1Rectangle Constructor

Constructs a rectangle.

Overload List

Constrcuts a 1x1 rectangle with center located at (0,0).

public XNACS1Rectangle();

Constructs a rectangle with end points located at aPos and bPos, and width.

public XNACS1Rectangle(Vector2,Vector2,Single,String);

Constructs a rectangle.

public XNACS1Rectangle(Vector2,Single,Single);

Constructs a rectangle.

public XNACS1Rectangle(Vector2,Single,Single,String);

See Also

XNACS1Rectangle Class | XNACS1Lib Namespace


XNACS1Rectangle Constructor (Vector2, Single, Single, String)

XNACS1Rectangle Constructor (Vector2, Single, Single, String)

Game-Themed Introductory Programming Project

Constructs a rectangle.

public XNACS1Rectangle(
Vector2 center,
Single width,
Single height,
String tex
);

Parameters

center
center of the rectangle.
width
width of the rectangle.
height
height of the rectangle.
tex
texture to be used to cover the rectangle.

See Also

XNACS1Rectangle Class | XNACS1Lib Namespace | XNACS1Rectangle Constructor Overload List


XNACS1Rectangle Constructor (Vector2, Single, Single)

XNACS1Rectangle Constructor (Vector2, Single, Single)

Game-Themed Introductory Programming Project

Constructs a rectangle.

public XNACS1Rectangle(
Vector2 center,
Single width,
Single height
);

Parameters

center
center of the rectangle.
width
width of the rectangle.
height
height of the rectangle.

See Also

XNACS1Rectangle Class | XNACS1Lib Namespace | XNACS1Rectangle Constructor Overload List


XNACS1Rectangle Constructor (Vector2, Vector2, Single, String)

XNACS1Rectangle Constructor (Vector2, Vector2, Single, String)

Game-Themed Introductory Programming Project

Constructs a rectangle with end points located at aPos and bPos, and width.

public XNACS1Rectangle(
Vector2 aPos,
Vector2 bPos,
Single width,
String tex
);

Parameters

aPos
End position of rectangle.
bPos
End position of rectangle.
width
Width of rectangle.
tex
texture image to be used to cover the rectangle.

See Also

XNACS1Rectangle Class | XNACS1Lib Namespace | XNACS1Rectangle Constructor Overload List


XNACS1Rectangle Constructor ()

XNACS1Rectangle Constructor ()

Game-Themed Introductory Programming Project

Constrcuts a 1x1 rectangle with center located at (0,0).

public XNACS1Rectangle();

See Also

XNACS1Rectangle Class | XNACS1Lib Namespace | XNACS1Rectangle Constructor Overload List


XNACS1Rectangle Properties

XNACS1Rectangle Properties

The properties of the XNACS1Rectangle class are listed below. For a complete list of XNACS1Rectangle class members, see the XNACS1Rectangle Members topic.

Public Instance Properties

Center (inherited from XNACS1Primitive) | Center of the primitive.
CenterX (inherited from XNACS1Primitive) | X coordinate of the center position of the primitive.
CenterY (inherited from XNACS1Primitive) | Y coordinate of the center position of the primitive.
Color (inherited from XNACS1Primitive) | Color of the primitive. (undefined for PrimitiveSet).
FrontDirection (inherited from XNACS1Primitive) | Sets the front direction of the primitive. Setting FrontDireciton will cause the RotateAngle of the primitive to be updated accordingly. y default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction
Height | Height of the rectangle.
Label (inherited from XNACS1Primitive) | Annotated text label to be associated with the primitive.
LabelColor (inherited from XNACS1Primitive) | Color of the anontated text label.
LowerLeft | Lower left corner of the rectangle.
MaxBound (inherited from XNACS1Primitive) | Upper left corner of the primitive.
MinBound (inherited from XNACS1Primitive) | Lower left corner of the Primitive.
RotateAngle (inherited from XNACS1Primitive) | Rotate the primitive by the Angle specified (in degree). After the rotation, the FrontDirection of the primitive will be udpated accordingly. By default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction]. E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or rotated 90-degress in the anit-clockwise direction
ShouldTravel (inherited from XNACS1Primitive) | Defines if the primitive should move by its current velocity. Defaults to false.
Speed (inherited from XNACS1Primitive) | Get/Set the speed (magnitude of the Velocity vector) for the velocity.
Texture (inherited from XNACS1Primitive) | Texture file name (without the "." or the extension) to cover the primitive.
Velocity (inherited from XNACS1Primitive) | Velocity of a primitive. This is a true velocity: with magnitude (speed) and direction for tavel.
VelocityDirection (inherited from XNACS1Primitive) | Get/Set the direction of the velocity.
VelocityX (inherited from XNACS1Primitive) | Get/Set the x-component of the primitive velocity.
VelocityY (inherited from XNACS1Primitive) | Get/Set the y-component of the primitive velocity.
Visible (inherited from XNACS1Primitive) | Whether the primitive is visible.
Width | Width of the rectangle.

Protected Internal Instance Properties

Size (inherited from XNACS1Primitive) | Get/Set width/height of the primitive.
SizeX (inherited from XNACS1Primitive) | Width of the primitive.
SizeY (inherited from XNACS1Primitive) | Height of the primitive. For PrimitiveCircle (diameter), PrimitiveRectangle (height), PrimitiveSet (undefined).

See Also

XNACS1Rectangle Class | XNACS1Lib Namespace


Height Property

XNACS1Rectangle.Height Property

Height of the rectangle.

public Single Height {get; set;}

See Also

XNACS1Rectangle Class | XNACS1Lib Namespace | Width | SetEndPoints | LowerLeft


LowerLeft Property

XNACS1Rectangle.LowerLeft Property

Lower left corner of the rectangle.

public Vector2 LowerLeft {get; set;}

See Also

XNACS1Rectangle Class | XNACS1Lib Namespace


Width Property

XNACS1Rectangle.Width Property

Width of the rectangle.

public Single Width {get; set;}

See Also

XNACS1Rectangle Class | XNACS1Lib Namespace | Height | SetEndPoints | LowerLeft


XNACS1Rectangle Methods

XNACS1Rectangle Methods

The methods of the XNACS1Rectangle class are listed below. For a complete list of XNACS1Rectangle class members, see the XNACS1Rectangle Members topic.

Public Instance Methods

Above (inherited from XNACS1Primitive) | Returns if the center of this primitive is "above" (in y) in relation to the center of otherPrimitive.
AddToAutoDrawSet (inherited from XNACS1Primitive) | Add this primitive to the AutoDrawSet. If this primitive already exists in the draw set, this function call is ignored. By default, all primitive are added into the AutoDrawSet.
Below (inherited from XNACS1Primitive) | Returns if the center of this primitive is "below" (in y) in relation to the center of otherPrimitive.
Collided (inherited from XNACS1Primitive) | Overloaded. Determines if this primitive collides with the otherPrimitive. If true, pos is the colliding position.
Draw (inherited from XNACS1Primitive) | If visible, draws the primitive with the associated text label.
HasNonZeroVelocity (inherited from XNACS1Primitive) | Retruns if the current velocity is non-zero.
IsInAutoDrawSet (inherited from XNACS1Primitive) | Determines if this primitive is in the AutoDrawSet.
LeftOf (inherited from XNACS1Primitive) | Returns if the center of this primitive is "to the left" (in x) in relation to the center of otherPrimtive
RemoveFromAutoDrawSet (inherited from XNACS1Primitive) | Remove this primitive from the AutoDrawSet. After this function call, this primitive will not be drawn in the application window.
RightOf (inherited from XNACS1Primitive) | Returns if the center of this primitive is "to the right" (in x) in relation to the center of otherPrimitive
SetEndPoints | aPos and bPos are two end positions on the opposite edges of the rectangle. Width is the width of the edge.
TopOfAutoDrawSet (inherited from XNACS1Primitive) | Make sure this primitive is drawn on top of all other primitives.
TravelPrimitive (inherited from XNACS1Primitive) | Moves the primitive during each update cycle. This function is automacially called for all visible primitives. Default behavior is to move the primitive if: . Primitive is visible (invivislble primitive is not updated) . ShouldTravel is true . HasNonZeroVelocity() is true

Protected Instance Methods

DrawPrimitive Draws the Rectangle.

See Also

XNACS1Rectangle Class | XNACS1Lib Namespace


XNACS1Rectangle.DrawPrimitive Method

XNACS1Rectangle.DrawPrimitive Method

Draws the Rectangle.

protected override void DrawPrimitive();

See Also

XNACS1Rectangle Class | XNACS1Lib Namespace


XNACS1Rectangle.SetEndPoints Method

XNACS1Rectangle.SetEndPoints Method

aPos and bPos are two end positions on the opposite edges of the rectangle. Width is the width of the edge.

public void SetEndPoints(
Vector2 aPos,
Vector2 bPos,
Single width
);

Parameters

aPos
Center of one end position.
bPos
Center of the opposite end position.
width
Width of the rectangle.

See Also

XNACS1Rectangle Class | XNACS1Lib Namespace


XNACS1Lib.XNACS1Lib.GamePadSupport

XNACS1Lib.XNACS1Lib.GamePadSupport Namespace

This is the namespace defined to support the interface to the XBOX 360 GamePad Controller.

Namespace hierarchy

Classes

Class | Description
GamePadStruct | State information for all input mechanisms on the XBOX 360 game pad controller.

Structures

Structure | Description
AllButtonsOnGamePad | Records the states (pressed or release) of all the buttons on a XBOX 360 game pad.
DPadOnGamePad | States (depressed or released) of the DPad-buttons (left, right, top, down) on the XBOX 360 game pad.
ThumbSticksOnGamePad | Positions of the left and right thumbSticks on the XBOX 360 controller.
TriggersOnGamePad | Positions of the left and right triggers on the XBOX 360 controller.


AllButtonsOnGamePad Structure

AllButtonsOnGamePad Structure

Records the states (pressed or release) of all the buttons on a XBOX 360 game pad.

For a list of all members of this type, see AllButtonsOnGamePad Members.

System.Object
ValueType
AllButtonsOnGamePad

public struct AllButtonsOnGamePad

Requirements

Namespace: XNACS1Lib.XNACS1Lib.GamePadSupport

Assembly: XNACS1Lib_PC (in XNACS1Lib_PC.dll)

See Also

AllButtonsOnGamePad Members | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


AllButtonsOnGamePad Members

AllButtonsOnGamePad Members

AllButtonsOnGamePad overview

Public Instance Fields

A | State of the A-Button (pressed or released).
B | State of the B-Button (pressed or released).
Back | State of the back-Button (pressed or released).
LeftShoulder | State of the leftShoulder-Button (pressed or released).
LeftStick | State of the LeftStick-Button (pressed or released).
RightShoulder | State of the RightShoulder-Button (pressed or released).
RightStick | State of the RightStick-Button (pressed or released).
Start | State of the Start-Button (pressed or released).
X | State of the X-Button (pressed or released).
Y | State of the Y-Button (pressed or released).

See Also

AllButtonsOnGamePad Structure | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


AllButtonsOnGamePad Fields

AllButtonsOnGamePad Fields

The fields of the AllButtonsOnGamePad structure are listed below. For a complete list of AllButtonsOnGamePad structure members, see the AllButtonsOnGamePad Members topic.

Public Instance Fields

A | State of the A-Button (pressed or released).
B | State of the B-Button (pressed or released).
Back | State of the back-Button (pressed or released).
LeftShoulder | State of the leftShoulder-Button (pressed or released).
LeftStick | State of the LeftStick-Button (pressed or released).
RightShoulder | State of the RightShoulder-Button (pressed or released).
RightStick | State of the RightStick-Button (pressed or released).
Start | State of the Start-Button (pressed or released).
X | State of the X-Button (pressed or released).
Y | State of the Y-Button (pressed or released).

See Also

AllButtonsOnGamePad Structure | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


AllButtonsOnGamePad.A Field

AllButtonsOnGamePad.A Field

State of the A-Button (pressed or released).

public ButtonState A;

See Also

AllButtonsOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


AllButtonsOnGamePad.B Field

AllButtonsOnGamePad.B Field

State of the B-Button (pressed or released).

public ButtonState B;

See Also

AllButtonsOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


AllButtonsOnGamePad.Back Field

AllButtonsOnGamePad.Back Field

State of the back-Button (pressed or released).

public ButtonState Back;

See Also

AllButtonsOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


AllButtonsOnGamePad.LeftShoulder Field

AllButtonsOnGamePad.LeftShoulder Field

State of the leftShoulder-Button (pressed or released).

public ButtonState LeftShoulder;

See Also

AllButtonsOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


AllButtonsOnGamePad.LeftStick Field

AllButtonsOnGamePad.LeftStick Field

State of the LeftStick-Button (pressed or released).

public ButtonState LeftStick;

See Also

AllButtonsOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


AllButtonsOnGamePad.RightShoulder Field

AllButtonsOnGamePad.RightShoulder Field

State of the RightShoulder-Button (pressed or released).

public ButtonState RightShoulder;

See Also

AllButtonsOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


AllButtonsOnGamePad.RightStick Field

AllButtonsOnGamePad.RightStick Field

State of the RightStick-Button (pressed or released).

public ButtonState RightStick;

See Also

AllButtonsOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


AllButtonsOnGamePad.Start Field

AllButtonsOnGamePad.Start Field

State of the Start-Button (pressed or released).

public ButtonState Start;

See Also

AllButtonsOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


AllButtonsOnGamePad.X Field

AllButtonsOnGamePad.X Field

State of the X-Button (pressed or released).

public ButtonState X;

See Also

AllButtonsOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


AllButtonsOnGamePad.Y Field

AllButtonsOnGamePad.Y Field

State of the Y-Button (pressed or released).

public ButtonState Y;

See Also

AllButtonsOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


DPadOnGamePad Structure

DPadOnGamePad Structure

States (depressed or released) of the DPad-buttons (left, right, top, down) on the XBOX 360 game pad.

For a list of all members of this type, see DPadOnGamePad Members.

System.Object
ValueType
DPadOnGamePad

public struct DPadOnGamePad

Requirements

Namespace: XNACS1Lib.XNACS1Lib.GamePadSupport

Assembly: XNACS1Lib_PC (in XNACS1Lib_PC.dll)

See Also

DPadOnGamePad Members | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


DPadOnGamePad Members

DPadOnGamePad Members

DPadOnGamePad overview

Public Instance Fields

Down | State of the DPad Down-Button (pressed or released).
Left | State of the DPad Left-Button (pressed or released).
Right | State of the DPad Right-Button (pressed or released).
Up | State of the DPad Up-Button (pressed or released).

See Also

DPadOnGamePad Structure | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


DPadOnGamePad Fields

DPadOnGamePad Fields

The fields of the DPadOnGamePad structure are listed below. For a complete list of DPadOnGamePad structure members, see the DPadOnGamePad Members topic.

Public Instance Fields

Down | State of the DPad Down-Button (pressed or released).
Left | State of the DPad Left-Button (pressed or released).
Right | State of the DPad Right-Button (pressed or released).
Up | State of the DPad Up-Button (pressed or released).

See Also

DPadOnGamePad Structure | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


DPadOnGamePad.Down Field

DPadOnGamePad.Down Field

State of the DPad Down-Button (pressed or released).

public ButtonState Down;

See Also

DPadOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


DPadOnGamePad.Left Field

DPadOnGamePad.Left Field

State of the DPad Left-Button (pressed or released).

public ButtonState Left;

See Also

DPadOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


DPadOnGamePad.Right Field

DPadOnGamePad.Right Field

State of the DPad Right-Button (pressed or released).

public ButtonState Right;

See Also

DPadOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


DPadOnGamePad.Up Field

DPadOnGamePad.Up Field

State of the DPad Up-Button (pressed or released).

public ButtonState Up;

See Also

DPadOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct Class

GamePadStruct Class

State information for all input mechanisms on the XBOX 360 game pad controller.

For a list of all members of this type, see GamePadStruct Members.

System.Object
GamePadStruct

public class GamePadStruct

Requirements

Namespace: XNACS1Lib.XNACS1Lib.GamePadSupport

Assembly: XNACS1Lib_PC (in XNACS1Lib_PC.dll)

See Also

GamePadStruct Members | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct Members

GamePadStruct Members

GamePadStruct overview

Public Instance Fields

Buttons | States of all the buttons on the XBOX 360 game pad.
Dpad | States of all the buttons on the DPad on the XBOX 360 game pad.
ThumbSticks | Positions of the left and right thumbsticks on the XBOX 360 game pad.
Triggers | Positions of the left and right triggers on the XBOX 360 game pad.

Public Instance Methods

ButtonAClicked | If Button-A has been clicked.
ButtonBackClicked | If the back button has been clicked.
ButtonBClicked | If Button-B has been clicked.
ButtonStartClicked | If the start button has been clicked.
ButtonXClicked | If Button-X has been clicked.
ButtonYClicked | If Button-Y has been clicked.

See Also

GamePadStruct Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct Fields

GamePadStruct Fields

The fields of the GamePadStruct class are listed below. For a complete list of GamePadStruct class members, see the GamePadStruct Members topic.

Public Instance Fields

Buttons | States of all the buttons on the XBOX 360 game pad.
Dpad | States of all the buttons on the DPad on the XBOX 360 game pad.
ThumbSticks | Positions of the left and right thumbsticks on the XBOX 360 game pad.
Triggers | Positions of the left and right triggers on the XBOX 360 game pad.

See Also

GamePadStruct Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct.Buttons Field

GamePadStruct.Buttons Field

States of all the buttons on the XBOX 360 game pad.

public AllButtonsOnGamePad Buttons;

See Also

GamePadStruct Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct.Dpad Field

GamePadStruct.Dpad Field

States of all the buttons on the DPad on the XBOX 360 game pad.

public DPadOnGamePad Dpad;

See Also

GamePadStruct Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct.ThumbSticks Field

GamePadStruct.ThumbSticks Field

Positions of the left and right thumbsticks on the XBOX 360 game pad.

public ThumbSticksOnGamePad ThumbSticks;

See Also

GamePadStruct Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct.Triggers Field

GamePadStruct.Triggers Field

Positions of the left and right triggers on the XBOX 360 game pad.

public TriggersOnGamePad Triggers;

See Also

GamePadStruct Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct Methods

GamePadStruct Methods

The methods of the GamePadStruct class are listed below. For a complete list of GamePadStruct class members, see the GamePadStruct Members topic.

Public Instance Methods

ButtonAClicked | If Button-A has been clicked.
ButtonBackClicked | If the back button has been clicked.
ButtonBClicked | If Button-B has been clicked.
ButtonStartClicked | If the start button has been clicked.
ButtonXClicked | If Button-X has been clicked.
ButtonYClicked | If Button-Y has been clicked.

See Also

GamePadStruct Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct.ButtonAClicked Method

GamePadStruct.ButtonAClicked Method

If Button-A has been clicked.

public bool ButtonAClicked();

Return Value

T/F on if the button has been clicked.

See Also

GamePadStruct Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct.ButtonBackClicked Method

GamePadStruct.ButtonBackClicked Method

If the back button has been clicked.

public bool ButtonBackClicked();

Return Value

T/F on if the button has been clicked.

See Also

GamePadStruct Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct.ButtonBClicked Method

GamePadStruct.ButtonBClicked Method

If Button-B has been clicked.

public bool ButtonBClicked();

Return Value

T/F on if the button has been clicked.

See Also

GamePadStruct Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct.ButtonStartClicked Method

GamePadStruct.ButtonStartClicked Method

If the start button has been clicked.

public bool ButtonStartClicked();

Return Value

T/F on if the button has been clicked.

See Also

GamePadStruct Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct.ButtonXClicked Method

GamePadStruct.ButtonXClicked Method

If Button-X has been clicked.

public bool ButtonXClicked();

Return Value

T/F on if the button has been clicked.

See Also

GamePadStruct Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


GamePadStruct.ButtonYClicked Method

GamePadStruct.ButtonYClicked Method

If Button-Y has been clicked.

public bool ButtonYClicked();

Return Value

T/F on if the button has been clicked.

See Also

GamePadStruct Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


ThumbSticksOnGamePad Structure

ThumbSticksOnGamePad Structure

Positions of the left and right thumbSticks on the XBOX 360 controller.

For a list of all members of this type, see ThumbSticksOnGamePad Members.

System.Object
ValueType
ThumbSticksOnGamePad

public struct ThumbSticksOnGamePad

Requirements

Namespace: XNACS1Lib.XNACS1Lib.GamePadSupport

Assembly: XNACS1Lib_PC (in XNACS1Lib_PC.dll)

See Also

ThumbSticksOnGamePad Members | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


ThumbSticksOnGamePad Members

ThumbSticksOnGamePad Members

ThumbSticksOnGamePad overview

Public Instance Fields

Left | Position of the left thumbStick (X/Y values between -1 and +1).
Right | Position of the right thumbStick (X/Y values between -1 and +1).

See Also

ThumbSticksOnGamePad Structure | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


ThumbSticksOnGamePad Fields

ThumbSticksOnGamePad Fields

The fields of the ThumbSticksOnGamePad structure are listed below. For a complete list of ThumbSticksOnGamePad structure members, see the ThumbSticksOnGamePad Members topic.

Public Instance Fields

Left | Position of the left thumbStick (X/Y values between -1 and +1).
Right | Position of the right thumbStick (X/Y values between -1 and +1).

See Also

ThumbSticksOnGamePad Structure | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


ThumbSticksOnGamePad.Left Field

ThumbSticksOnGamePad.Left Field

Position of the left thumbStick (X/Y values between -1 and +1).

public Vector2 Left;

See Also

ThumbSticksOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


ThumbSticksOnGamePad.Right Field

ThumbSticksOnGamePad.Right Field

Position of the right thumbStick (X/Y values between -1 and +1).

public Vector2 Right;

See Also

ThumbSticksOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


TriggersOnGamePad Structure

TriggersOnGamePad Structure

Positions of the left and right triggers on the XBOX 360 controller.

For a list of all members of this type, see TriggersOnGamePad Members.

System.Object
ValueType
TriggersOnGamePad

public struct TriggersOnGamePad

Requirements

Namespace: XNACS1Lib.XNACS1Lib.GamePadSupport

Assembly: XNACS1Lib_PC (in XNACS1Lib_PC.dll)

See Also

TriggersOnGamePad Members | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


TriggersOnGamePad Members

TriggersOnGamePad Members

TriggersOnGamePad overview

Public Instance Fields

Left | Position of the left trigger (value between 0 to 1).
Right | Position of the right trigger (value betwen 0 to 1).

See Also

TriggersOnGamePad Structure | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


TriggersOnGamePad Fields

TriggersOnGamePad Fields

The fields of the TriggersOnGamePad structure are listed below. For a complete list of TriggersOnGamePad structure members, see the TriggersOnGamePad Members topic.

Public Instance Fields

Left | Position of the left trigger (value between 0 to 1).
Right | Position of the right trigger (value betwen 0 to 1).

See Also

TriggersOnGamePad Structure | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


TriggersOnGamePad.Left Field

TriggersOnGamePad.Left Field

Position of the left trigger (value between 0 to 1).

public Single Left;

See Also

TriggersOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


TriggersOnGamePad.Right Field

TriggersOnGamePad.Right Field

Position of the right trigger (value betwen 0 to 1).

public Single Right;

See Also

TriggersOnGamePad Class | XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


Hierarchy

Hierarchy

System.Object
System.ValueType
XNACS1Lib.XNACS1Lib.GamePadSupport.AllButtonsOnGamePad
XNACS1Lib.XNACS1Lib.GamePadSupport.DPadOnGamePad
XNACS1Lib.XNACS1Lib.GamePadSupport.ThumbSticksOnGamePad
XNACS1Lib.XNACS1Lib.GamePadSupport.TriggersOnGamePad
XNACS1Lib.XNACS1Lib.GamePadSupport.GamePadStruct

See Also

XNACS1Lib.XNACS1Lib.GamePadSupport Namespace


Hierarchy

Hierarchy

System.Object
System.ValueType
System.Enum ---- System.IComparable, System.IConvertible, System.IFormattable
XNACS1Lib.BoundCollideStatus
XNACS1Lib.XNACS1Base ---- System.IDisposable
XNACS1Lib.XNACS1Base.World
XNACS1Lib.XNACS1Primitive
XNACS1Lib.XNACS1Circle
XNACS1Lib.XNACS1Rectangle
XNACS1Lib.XNACS1PrimitiveSet

See Also

XNACS1Lib Namespace