C# Класс fliXNA_xbox.FlxObject

Наследование: FlxBasic
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
acceleration FlxPoint
allowCollisions uint
angle float
angularAcceleration float
angularDrag float
angularVelocity float
drag FlxPoint
elasticity float
health float
height float
immovable bool
last FlxPoint
mass float
maxAngular float
maxVelocity FlxPoint
moves bool
path FlxPath
pathAngle float
pathSpeed float
scrollFactor FlxPoint
touching uint
velocity FlxPoint
wasTouching uint
width float
x float
y float

Защищенные свойства (Protected)

Свойство Тип Описание
_flicker bool
_flickerTimer float
_pZero FlxPoint
_pathInc int
_pathMode uint
_pathNodeIndex int
_pathRotate bool
_point FlxPoint
_rect FlxRect

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

Метод Описание
FlxObject ( float X, float Y, float Width, float Height ) : System

Instantiates a FlxObject

destroy ( ) : void

Override to null out variables manually

draw ( ) : void

Rarely called. Not yet implemented like AS3 Flixel

drawDebug ( FlxCamera Camera = null ) : void

Not yet implemented

flicker ( float Duration = 1.0f ) : void

Flicker this object

followPath ( FlxPath Path, float Speed = 100, uint Mode = PATH_FORWARD, bool AutoRotate = false ) : void
getMidpoint ( FlxPoint Point = null ) : FlxPoint

Retrieve midpoint of this object in world coordinates

getScreenXY ( FlxPoint Point = null, FlxCamera Camera = null ) : FlxPoint

Call this to figure out the on-screen position of the object

hurt ( float Damage ) : void

Reduces the health

isTouching ( uint Direction ) : bool

Check to see if this object is touching a particular surface

justTouched ( uint Direction ) : bool

Check to see if this object just touched a particular surface

onScreen ( FlxCamera Camera = null ) : bool

Check to see if this object is currently on the screen

overlaps ( FlxBasic ObjectOrGroup, bool InScreenSpace = false, FlxCamera Camera = null ) : bool

Checks to see if some FlxObject overlaps this FlxObject or FlxGroup. If the group has a LOT of things in it, it might be faster to use FlxG.ovelaps()

overlapsAt ( float X, float Y, FlxBasic ObjectOrGroup, bool InScreenSpace = false, FlxCamera Camera = null ) : bool

Checks to see if this FlxObject were located at the given position

overlapsPoint ( FlxPoint Point, bool InScreenSpace = false, FlxCamera Camera = null ) : bool

Check to see if a point in 2D world space overlaps this FlxObject

postUpdate ( ) : void

Called right after update()

preUpdate ( ) : void

Called right before update()

reset ( float X, float Y ) : void

Handy function for reviving game objects. Resets their existence flags and position

separate ( FlxObject Object1, FlxObject Object2 ) : bool

The main collision resolution function

separateX ( FlxObject Object1, FlxObject Object2 ) : bool

X-axis component of the object separation process

separateY ( FlxObject Object1, FlxObject Object2 ) : bool

Y-axis component of the object separation process

stopFollowingPath ( bool DestroyPath = false ) : void
update ( ) : void

Защищенные методы

Метод Описание
advancePath ( bool Snap = true ) : FlxPoint
updatePathMotion ( ) : void

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

Метод Описание
updateMotion ( ) : void

Internal function for updating the position and speed of this object.

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

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

Instantiates a FlxObject
public FlxObject ( float X, float Y, float Width, float Height ) : System
X float X-coordinate of the object in space
Y float y-coordinate of the object in space
Width float Desired width of the rectangle
Height float Desired height of the rectangle
Результат System

advancePath() защищенный Метод

protected advancePath ( bool Snap = true ) : FlxPoint
Snap bool
Результат FlxPoint

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

Override to null out variables manually
public destroy ( ) : void
Результат void

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

Rarely called. Not yet implemented like AS3 Flixel
public draw ( ) : void
Результат void

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

Not yet implemented
public drawDebug ( FlxCamera Camera = null ) : void
Camera FlxCamera Which Camera - currently only one exists
Результат void

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

Flicker this object
public flicker ( float Duration = 1.0f ) : void
Duration float How many seconds
Результат void

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

public followPath ( FlxPath Path, float Speed = 100, uint Mode = PATH_FORWARD, bool AutoRotate = false ) : void
Path FlxPath
Speed float
Mode uint
AutoRotate bool
Результат void

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

Retrieve midpoint of this object in world coordinates
public getMidpoint ( FlxPoint Point = null ) : FlxPoint
Point FlxPoint
Результат FlxPoint

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

Call this to figure out the on-screen position of the object
public getScreenXY ( FlxPoint Point = null, FlxCamera Camera = null ) : FlxPoint
Point FlxPoint Take a FlxPoint object and assign the post-scrolled X and Y values of this object to it
Camera FlxCamera Which Camera - currently only one exists
Результат FlxPoint

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

Reduces the health
public hurt ( float Damage ) : void
Damage float Amount to reduce by
Результат void

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

Check to see if this object is touching a particular surface
public isTouching ( uint Direction ) : bool
Direction uint Any of the collision flags (e.g. LEFT, FLOOR, etc)
Результат bool

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

Check to see if this object just touched a particular surface
public justTouched ( uint Direction ) : bool
Direction uint Any of the collision flags (e.g. LEFT, FLOOR, etc)
Результат bool

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

Check to see if this object is currently on the screen
public onScreen ( FlxCamera Camera = null ) : bool
Camera FlxCamera Which Camera - currently only one exists
Результат bool

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

Checks to see if some FlxObject overlaps this FlxObject or FlxGroup. If the group has a LOT of things in it, it might be faster to use FlxG.ovelaps()
public overlaps ( FlxBasic ObjectOrGroup, bool InScreenSpace = false, FlxCamera Camera = null ) : bool
ObjectOrGroup FlxBasic The object or group being tested
InScreenSpace bool Whether to take scroll factors into account.
Camera FlxCamera Which Camera - currently only one exists
Результат bool

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

Checks to see if this FlxObject were located at the given position
public overlapsAt ( float X, float Y, FlxBasic ObjectOrGroup, bool InScreenSpace = false, FlxCamera Camera = null ) : bool
X float X position you want to check
Y float Y position you want to check
ObjectOrGroup FlxBasic The object or group being tested
InScreenSpace bool Whether to take scroll factors into account.
Camera FlxCamera Which Camera - currently only one exists
Результат bool

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

Check to see if a point in 2D world space overlaps this FlxObject
public overlapsPoint ( FlxPoint Point, bool InScreenSpace = false, FlxCamera Camera = null ) : bool
Point FlxPoint The point in world space you want to check
InScreenSpace bool Whether to take scroll factors into account.
Camera FlxCamera Which Camera - currently only one exists
Результат bool

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

Called right after update()
public postUpdate ( ) : void
Результат void

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

Called right before update()
public preUpdate ( ) : void
Результат void

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

Handy function for reviving game objects. Resets their existence flags and position
public reset ( float X, float Y ) : void
X float
Y float
Результат void

separate() публичный статический Метод

The main collision resolution function
public static separate ( FlxObject Object1, FlxObject Object2 ) : bool
Object1 FlxObject
Object2 FlxObject
Результат bool

separateX() публичный статический Метод

X-axis component of the object separation process
public static separateX ( FlxObject Object1, FlxObject Object2 ) : bool
Object1 FlxObject
Object2 FlxObject
Результат bool

separateY() публичный статический Метод

Y-axis component of the object separation process
public static separateY ( FlxObject Object1, FlxObject Object2 ) : bool
Object1 FlxObject
Object2 FlxObject
Результат bool

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

public stopFollowingPath ( bool DestroyPath = false ) : void
DestroyPath bool
Результат void

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

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

updatePathMotion() защищенный Метод

protected updatePathMotion ( ) : void
Результат void

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

_flicker защищенное свойство

Internal helper for Retro-styled flickering
protected bool _flicker
Результат bool

_flickerTimer защищенное свойство

Internal helper for Retro-styled flickering
protected float _flickerTimer
Результат float

_pZero защищенное статическое свойство

Should always represent (0,0) - useful for different things, for avoideing unnecessary new calls
protected static FlxPoint _pZero
Результат FlxPoint

_pathInc защищенное свойство

Internal helper for node navigation, specifically yoyo and backwards movement
protected int _pathInc
Результат int

_pathMode защищенное свойство

Internal tracker for path behavior flags (looping, horizontal only, etc)
protected uint _pathMode
Результат uint

_pathNodeIndex защищенное свойство

Internal helper, tracks which node of the path this object is moving toward
protected int _pathNodeIndex
Результат int

_pathRotate защищенное свойство

Internal flag for whether the object's angle should be adjusted to the path angle during path follow behavior
protected bool _pathRotate
Результат bool

_point защищенное свойство

Pre-allocated x-y point container to be used however you like
protected FlxPoint _point
Результат FlxPoint

_rect защищенное свойство

Pre-allocated rectangle container to be used however you like
protected FlxRect,fliXNA_xbox _rect
Результат FlxRect

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

How fast the speed of this object is changing. Useful for smooth movement and gravity
public FlxPoint acceleration
Результат FlxPoint

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

Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating collision directions. Use bitwise operators to check the values stored here. Useful for things like one-way platforms (e.g. allowCollisions = UP;) The accessor "solid" just flips this variable between NONE and ANY/
public uint allowCollisions
Результат uint

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

The angle of the sprite, used for rotation
public float angle
Результат float

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

How fast the spin should change
public float angularAcceleration
Результат float

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

Like drag but for spinning
public float angularDrag
Результат float

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

How fast you want the sprite to spin
public float angularVelocity
Результат float

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

This is like deceleration that is only applied when acceleration is not affecting the sprite.
public FlxPoint drag
Результат FlxPoint

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

The bounciness of this object, Only affects collisions. Default is 0, or "not bouncy at all."
public float elasticity
Результат float

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

Handy for storing health percentage or armor points or whatever
public float health
Результат float

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

The height of this object
public float height
Результат float

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

Whether this object will move/alter position after a collision
public bool immovable
Результат bool

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

Important variable for collision processing. Set automatically during preUpdate()
public FlxPoint last
Результат FlxPoint

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

Virtual mass of this object. Defauly value is 1. Currently only used with elasticity during collision resolution. Change at your own risk; effects seem crazy unpredictable so far!
public float mass
Результат float

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

Use in conjunction with angularAcceleration fir fluid spin speed control
public float maxAngular
Результат float

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

Max speed of this object
public FlxPoint maxVelocity
Результат FlxPoint

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

Set this to false if you want to skip automatic motion/movement stuff. Default is true for FlxObject and FlxSprite. Default is false for FlxText, FlxTileblock, FlxTilemap, and FlxSound.
public bool moves
Результат bool

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

A reference to a path object. Null by default, assigned by followPath()
public FlxPath path
Результат FlxPath

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

The angle in degrees between this object and the next node, where 0 is directly North, 90 is East
public float pathAngle
Результат float

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

The speed at which the object is moving on the path. When an object completes a non-looping path circuit, the pathSpeed will be zeroed out, but the path reference will NOT be nulled out. So pathSpeed is a good way to check if this object is currently following a path of not
public float pathSpeed
Результат float

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

How much this object is affected by the camera subsystem. 0 means it never moves, like a HUD element or background graphic. 1 means it scrolls along at the same speed as the foreground layer. (1,1) by default. CURRENTLY NOT IMPLEMENTED
public FlxPoint scrollFactor
Результат FlxPoint

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

Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating surface contacts. Use bitwise operators to check the values stored here, or use touching(), justStartedTouching(), etc. You can even use them broadly as boolean values if you're feeling saucy!
public uint touching
Результат uint

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

Basic speed of this object
public FlxPoint velocity
Результат FlxPoint

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

Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating surface contacts from the previous game loop step. Use bitwise operators to check the values stored here, or use touching(), justStartedTouching(), etc. You can even use them broadly as boolean values if you're feeling saucy!
public uint wasTouching
Результат uint

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

The width of this object
public float width
Результат float

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

X position of the upper left corner of this object in world space
public float x
Результат float

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

Y position of the upper left corner of this object in world space
public float y
Результат float