C# Class Platformer.PrimitiveLine

A class to make primitive 2D objects out of lines.
Show file Open project: zmthy/play-dead

Public Properties

Property Type Description
Colour Color
Depth float
Position Vector2

Public Methods

Method Description
AddVector ( Vector2 vector ) : void

Adds a vector to the primive live object.

ClearVectors ( ) : void

Clears all vectors from the primitive line object.

CreateCircle ( float radius, int sides ) : void

Creates a circle starting from 0, 0.

InsertVector ( int index, Vector2 vector ) : void

Insers a vector into the primitive line object.

PrimitiveLine ( GraphicsDevice graphicsDevice ) : System

Creates a new primitive line object.

RemoveVector ( Vector2 vector ) : void

Removes a vector from the primitive line object.

RemoveVector ( int index ) : void

Removes a vector from the primitive line object.

Render ( SpriteBatch spriteBatch ) : void

Renders the primtive line object.

Method Details

AddVector() public method

Adds a vector to the primive live object.
public AddVector ( Vector2 vector ) : void
vector Vector2 The vector to add.
return void

ClearVectors() public method

Clears all vectors from the primitive line object.
public ClearVectors ( ) : void
return void

CreateCircle() public method

Creates a circle starting from 0, 0.
public CreateCircle ( float radius, int sides ) : void
radius float The radius (half the width) of the circle.
sides int The number of sides on the circle (the more the detailed).
return void

InsertVector() public method

Insers a vector into the primitive line object.
public InsertVector ( int index, Vector2 vector ) : void
index int The index to insert it at.
vector Vector2 The vector to insert.
return void

PrimitiveLine() public method

Creates a new primitive line object.
public PrimitiveLine ( GraphicsDevice graphicsDevice ) : System
graphicsDevice GraphicsDevice The Graphics Device object to use.
return System

RemoveVector() public method

Removes a vector from the primitive line object.
public RemoveVector ( Vector2 vector ) : void
vector Vector2 The vector to remove.
return void

RemoveVector() public method

Removes a vector from the primitive line object.
public RemoveVector ( int index ) : void
index int The index of the vector to remove.
return void

Render() public method

Renders the primtive line object.
public Render ( SpriteBatch spriteBatch ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to use to render the primitive line object.
return void

Property Details

Colour public property

Gets/sets the colour of the primitive line object.
public Color Colour
return Color

Depth public property

Gets/sets the render depth of the primitive line object (0 = front, 1 = back)
public float Depth
return float

Position public property

Gets/sets the position of the primitive line object.
public Vector2 Position
return Vector2