C# Класс Nez.LineRenderer

Renders a trail behind a moving object Adapted from http://www.paradeofrain.com/2010/01/28/update-on-continuous-2d-trails-in-xna/
Наследование: RenderableComponent
Показать файл Открыть проект

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

Метод Описание
addPoint ( Vector2 point, float width = 20 ) : LineRenderer

adds a point to the line. If start/end widths are not set each point should have a width set here.

addPoint ( Vector2 point, float width, Microsoft.Xna.Framework.Color color ) : LineRenderer

adds a point to the line. If start/end widths are not set each point should have a width set here. If start/end colors are not set a color should be set as well.

addPoints ( Vector2 points ) : LineRenderer
calculateVertices ( ) : void
clearPoints ( ) : LineRenderer

clears all the points

clearStartEndColors ( ) : LineRenderer

clears the global start/end colors and goes back to using the individual point colors

clearStartEndWidths ( ) : LineRenderer

clears the global start/end widths and goes back to using the individual point widths

debugRender ( Graphics graphics ) : void
isVisibleFromCamera ( Camera camera ) : bool
onAddedToEntity ( ) : void
onEntityTransformChanged ( Transform comp ) : void
render ( Graphics graphics, Camera camera ) : void
setCutoffAngleForEndCapSubdivision ( float cutoffAngleForEndCapSubdivision ) : LineRenderer

sets the cutoff angle for use with EndCapType.JaggedWithCutoff. Any angles less than the cutoff angle will have jagged joints and all others will have standard.

setDegreesPerSubdivision ( float degreesPerSubdivision ) : LineRenderer

sets the number of degrees between each subdivision for use with EndCapType.Smooth

setEndCapType ( EndCapType endCapType ) : LineRenderer

sets the EndCapType used for rendering the line

setPoints ( Vector2 points ) : LineRenderer
setStartEndColors ( Microsoft.Xna.Framework.Color startColor, Microsoft.Xna.Framework.Color endColor ) : LineRenderer

sets the start and end color. If these are set, the individual point colors will be ignored.

setStartEndWidths ( float startWidth, float endWidth ) : LineRenderer

sets the start and end width. If these are set, the individual point widths will be ignored.

setTexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : LineRenderer

sets the texture. Textures should be horizontally tileable. Pass in null to unset the texture.

setUseWorldSpace ( bool useWorldSpace ) : LineRenderer

sets whether local or world space will be used for rendering. Defaults to world space. Using local space will take into account all the Transform properties including scale/rotation/position.

updatePoint ( int index, Vector2 point ) : LineRenderer

updates a points properties

updatePoint ( int index, Vector2 point, float width ) : LineRenderer

updates a points properties

updatePoint ( int index, Vector2 point, float width, Microsoft.Xna.Framework.Color color ) : LineRenderer

updates a points properties

Приватные методы

Метод Описание
addFirstSegment ( Segment &segment, Segment &nextSegment, int &vertIndex ) : void
addSegment ( Segment &segment, int &vertIndex ) : void
addSingleSegmentLine ( Segment &segment, Microsoft.Xna.Framework.Color nextPointColor ) : void
addVert ( int index, Vector2 position, Vector2 texCoord, Microsoft.Xna.Framework.Color col ) : void
patchJaggedJoint ( Segment &segment, int &vertIndex ) : void
patchJoint ( Segment &segment, int &vertIndex ) : void
patchSmoothJoint ( Segment &segment, int &vertIndex ) : void
patchStandardJoint ( Segment &segment, int &vertIndex ) : void

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

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

adds a point to the line. If start/end widths are not set each point should have a width set here.
public addPoint ( Vector2 point, float width = 20 ) : LineRenderer
point Microsoft.Xna.Framework.Vector2 Point.
width float Width.
Результат LineRenderer

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

adds a point to the line. If start/end widths are not set each point should have a width set here. If start/end colors are not set a color should be set as well.
public addPoint ( Vector2 point, float width, Microsoft.Xna.Framework.Color color ) : LineRenderer
point Microsoft.Xna.Framework.Vector2 Point.
width float Width.
color Microsoft.Xna.Framework.Color Color.
Результат LineRenderer

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

public addPoints ( Vector2 points ) : LineRenderer
points Microsoft.Xna.Framework.Vector2
Результат LineRenderer

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

public calculateVertices ( ) : void
Результат void

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

clears all the points
public clearPoints ( ) : LineRenderer
Результат LineRenderer

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

clears the global start/end colors and goes back to using the individual point colors
public clearStartEndColors ( ) : LineRenderer
Результат LineRenderer

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

clears the global start/end widths and goes back to using the individual point widths
public clearStartEndWidths ( ) : LineRenderer
Результат LineRenderer

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

public debugRender ( Graphics graphics ) : void
graphics Graphics
Результат void

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

public isVisibleFromCamera ( Camera camera ) : bool
camera Camera
Результат bool

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

public onAddedToEntity ( ) : void
Результат void

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

public onEntityTransformChanged ( Transform comp ) : void
comp Transform
Результат void

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

public render ( Graphics graphics, Camera camera ) : void
graphics Graphics
camera Camera
Результат void

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

sets the cutoff angle for use with EndCapType.JaggedWithCutoff. Any angles less than the cutoff angle will have jagged joints and all others will have standard.
public setCutoffAngleForEndCapSubdivision ( float cutoffAngleForEndCapSubdivision ) : LineRenderer
cutoffAngleForEndCapSubdivision float Cutoff angle for end cap subdivision.
Результат LineRenderer

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

sets the number of degrees between each subdivision for use with EndCapType.Smooth
public setDegreesPerSubdivision ( float degreesPerSubdivision ) : LineRenderer
degreesPerSubdivision float Degrees per subdivision.
Результат LineRenderer

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

sets the EndCapType used for rendering the line
public setEndCapType ( EndCapType endCapType ) : LineRenderer
endCapType EndCapType End cap type.
Результат LineRenderer

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

public setPoints ( Vector2 points ) : LineRenderer
points Microsoft.Xna.Framework.Vector2
Результат LineRenderer

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

sets the start and end color. If these are set, the individual point colors will be ignored.
public setStartEndColors ( Microsoft.Xna.Framework.Color startColor, Microsoft.Xna.Framework.Color endColor ) : LineRenderer
startColor Microsoft.Xna.Framework.Color Start color.
endColor Microsoft.Xna.Framework.Color End color.
Результат LineRenderer

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

sets the start and end width. If these are set, the individual point widths will be ignored.
public setStartEndWidths ( float startWidth, float endWidth ) : LineRenderer
startWidth float Start width.
endWidth float End width.
Результат LineRenderer

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

sets the texture. Textures should be horizontally tileable. Pass in null to unset the texture.
public setTexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : LineRenderer
texture Microsoft.Xna.Framework.Graphics.Texture2D Texture.
Результат LineRenderer

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

sets whether local or world space will be used for rendering. Defaults to world space. Using local space will take into account all the Transform properties including scale/rotation/position.
public setUseWorldSpace ( bool useWorldSpace ) : LineRenderer
useWorldSpace bool If set to true use world space.
Результат LineRenderer

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

updates a points properties
public updatePoint ( int index, Vector2 point ) : LineRenderer
index int Index.
point Microsoft.Xna.Framework.Vector2 Point.
Результат LineRenderer

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

updates a points properties
public updatePoint ( int index, Vector2 point, float width ) : LineRenderer
index int Index.
point Microsoft.Xna.Framework.Vector2 Point.
width float Width.
Результат LineRenderer

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

updates a points properties
public updatePoint ( int index, Vector2 point, float width, Microsoft.Xna.Framework.Color color ) : LineRenderer
index int Index.
point Microsoft.Xna.Framework.Vector2 Point.
width float Width.
color Microsoft.Xna.Framework.Color Color.
Результат LineRenderer