C# 클래스 flxSharp.flxSharp.FlxPath

This is a simple path data container. Basically a list of points that a FlxObject can follow. Also has code for drawing debug visuals. FlxTilemap.findPath() returns a path object, but you can also just make your own, using the add() functions below or by creating your own array of points.
파일 보기 프로젝트 열기: jlorek/flxSharp 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_point FlxPoint

공개 메소드들

메소드 설명
Add ( float x, float y ) : void

Add a new node to the end of the path at the specified location.

AddAt ( float x, float y, int index ) : void

Add a new node to the path at the specified location and index within the path.

AddPoint ( FlxPoint node, bool asReference = false ) : void

Sometimes its easier or faster to just pass a point object instead of separate X and Y coordinates. This also gives you the option of not creating a new node but actually adding that specific FlxPoint object to the path. This allows you to do neat things, like dynamic paths.

AddPointAt ( FlxPoint node, int index, bool asReference = false ) : void

Sometimes its easier or faster to just pass a point object instead of separate X and Y coordinates. This also gives you the option of not creating a new node but actually adding that specific FlxPoint object to the path. This allows you to do neat things, like dynamic paths.

DrawDebug ( FlxCamera camera ) : void

While this doesn't override FlxBasic.DrawDebug(), the behavior is very similar. Based on this path data, it draws a simple lines-and-boxes representation of the path if the visual debug mode was toggled in the debugger overlay. You can use DebugColor and DebugScrollFactor to control the path's appearance.

FlxPath ( IEnumerable nodes = null ) : System

Instantiate a new path object.

Head ( ) : FlxPoint

Get the first node in the list.

Remove ( FlxPoint node ) : FlxPoint

Remove a node from the path. NOTE: only works with points added by reference or with references from nodes itself!

RemoveAt ( int index ) : FlxPoint

Remove a node from the path using the specified position in the list of path nodes.

Tail ( ) : FlxPoint

Get the last node in the list.

destroy ( ) : void

메소드 상세

Add() 공개 메소드

Add a new node to the end of the path at the specified location.
public Add ( float x, float y ) : void
x float X position of the new path point in world coordinates.
y float Y position of the new path point in world coordinates.
리턴 void

AddAt() 공개 메소드

Add a new node to the path at the specified location and index within the path.
public AddAt ( float x, float y, int index ) : void
x float X position of the new path point in world coordinates.
y float Y position of the new path point in world coordinates.
index int Where within the list of path nodes to insert this new point.
리턴 void

AddPoint() 공개 메소드

Sometimes its easier or faster to just pass a point object instead of separate X and Y coordinates. This also gives you the option of not creating a new node but actually adding that specific FlxPoint object to the path. This allows you to do neat things, like dynamic paths.
public AddPoint ( FlxPoint node, bool asReference = false ) : void
node FlxPoint The point in world coordinates you want to add to the path.
asReference bool Whether to add the point as a reference, or to create a new point with the specified values.
리턴 void

AddPointAt() 공개 메소드

Sometimes its easier or faster to just pass a point object instead of separate X and Y coordinates. This also gives you the option of not creating a new node but actually adding that specific FlxPoint object to the path. This allows you to do neat things, like dynamic paths.
public AddPointAt ( FlxPoint node, int index, bool asReference = false ) : void
node FlxPoint The point in world coordinates you want to add to the path.
index int Where within the list of path nodes to insert this new point.
asReference bool Whether to add the point as a reference, or to create a new point with the specified values.
리턴 void

DrawDebug() 공개 메소드

While this doesn't override FlxBasic.DrawDebug(), the behavior is very similar. Based on this path data, it draws a simple lines-and-boxes representation of the path if the visual debug mode was toggled in the debugger overlay. You can use DebugColor and DebugScrollFactor to control the path's appearance.
public DrawDebug ( FlxCamera camera ) : void
camera FlxCamera The camera object the path will draw to.
리턴 void

FlxPath() 공개 메소드

Instantiate a new path object.
public FlxPath ( IEnumerable nodes = null ) : System
nodes IEnumerable Optional, can specify all the points for the path up front if you want.
리턴 System

Head() 공개 메소드

Get the first node in the list.
public Head ( ) : FlxPoint
리턴 FlxPoint

Remove() 공개 메소드

Remove a node from the path. NOTE: only works with points added by reference or with references from nodes itself!
public Remove ( FlxPoint node ) : FlxPoint
node FlxPoint The point object you want to remove from the path.
리턴 FlxPoint

RemoveAt() 공개 메소드

Remove a node from the path using the specified position in the list of path nodes.
public RemoveAt ( int index ) : FlxPoint
index int Where within the list of path nodes you want to remove a node.
리턴 FlxPoint

Tail() 공개 메소드

Get the last node in the list.
public Tail ( ) : FlxPoint
리턴 FlxPoint

destroy() 공개 메소드

public destroy ( ) : void
리턴 void

프로퍼티 상세

_point 보호되어 있는 프로퍼티

protected FlxPoint,flxSharp.flxSharp _point
리턴 FlxPoint