C# Класс Platformer.PrimitiveLine

A class to make primitive 2D objects out of lines.
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
Colour Color
Depth float
Position Vector2

Открытые методы

Метод Описание
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.

Описание методов

AddVector() публичный Метод

Adds a vector to the primive live object.
public AddVector ( Vector2 vector ) : void
vector Vector2 The vector to add.
Результат void

ClearVectors() публичный Метод

Clears all vectors from the primitive line object.
public ClearVectors ( ) : void
Результат void

CreateCircle() публичный Метод

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).
Результат void

InsertVector() публичный Метод

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.
Результат void

PrimitiveLine() публичный Метод

Creates a new primitive line object.
public PrimitiveLine ( GraphicsDevice graphicsDevice ) : System
graphicsDevice GraphicsDevice The Graphics Device object to use.
Результат System

RemoveVector() публичный Метод

Removes a vector from the primitive line object.
public RemoveVector ( Vector2 vector ) : void
vector Vector2 The vector to remove.
Результат void

RemoveVector() публичный Метод

Removes a vector from the primitive line object.
public RemoveVector ( int index ) : void
index int The index of the vector to remove.
Результат void

Render() публичный Метод

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.
Результат void

Описание свойств

Colour публичное свойство

Gets/sets the colour of the primitive line object.
public Color Colour
Результат Color

Depth публичное свойство

Gets/sets the render depth of the primitive line object (0 = front, 1 = back)
public float Depth
Результат float

Position публичное свойство

Gets/sets the position of the primitive line object.
public Vector2 Position
Результат Vector2