Property | Type | Description | |
---|---|---|---|
camera | Microsoft.Xna.Framework.Vector2 | ||
visible | System.Boolean |
Method | Description | |
---|---|---|
World ( ) : System |
constructor
|
|
add ( Entity e ) : Entity |
Adds the Entity to the World at the end of the frame.
|
|
addGraphic ( |
Adds an Entity to the World with the Graphic object.
|
|
addList ( ) : void |
Adds multiple Entities to the world.
|
|
addMask ( |
Adds an Entity to the World with the Mask object.
|
|
begin ( ) : void |
Override this; called when World is switch to, and set to the currently active world.
|
|
bringForward ( Entity e ) : System.Boolean |
Shifts the Entity one place towards the front of its contained layer.
|
|
bringToFront ( Entity e ) : System.Boolean |
Brings the Entity to the front of its contained layer.
|
|
classCount ( string name ) : uint |
Returns the amount of Entities of the Class are in the World.
|
|
classFirst ( string name ) : Entity |
The first Entity of the Class.
|
|
clearRecycled ( string classType ) : void |
Clears stored reycled Entities of the Class type.
|
|
clearRecycledAll ( ) : void |
Clears stored recycled Entities of all Class types.
|
|
collideLine ( string type, int fromX, int fromY, int toX, int toY, int precision = 1, PunkX p = null ) : Entity |
Returns the first Entity found that collides with the line.
|
|
collidePoint ( string type, float pX, float pY ) : Entity |
Returns the first Entity found that collides with the position.
|
|
collidePointInto ( string type, float pX, float pY, Object &into ) : void |
Populates an array with all Entities that collide with the position. This function does not empty the array, that responsibility is left to the user.
|
|
collideRect ( string type, float rX, float rY, int rWidth, int rHeight ) : Entity |
Returns the first Entity that collides with the rectangular area.
|
|
collideRectInto ( string type, float rX, float rY, int rWidth, int rHeight, Object &into ) : void |
Populates an array with all Entities that collide with the rectangle. This function does not empty the array, that responsibility is left to the user.
|
|
create ( string classType, System.Boolean addToWorld = true ) : Entity |
Returns a new Entity, or a stored recycled Entity if one exists.
|
|
end ( ) : void |
Override this; called when World is changed, and the active world is no longer this.
|
|
getAll ( Object &into ) : void |
Pushes all Entities in the World into the array.
|
|
getClass ( string name, Object &into ) : void |
Pushes all Entities in the World of the Class into the Array or Vector.
|
|
getLayer ( int layer, Object &into ) : void |
Pushes all Entities in the World on the layer into the Array or Vector.
|
|
getType ( string type, Object &into ) : void |
Pushes all Entities in the World of the type into the Array or Vector.
|
|
isAtBack ( Entity e ) : System.Boolean |
If the Entity as at the back of its layer.
|
|
isAtFront ( Entity e ) : System.Boolean |
If the Entity as at the front of its layer.
|
|
layerCount ( int layer ) : uint |
Returns the amount of Entities are on the layer in the World.
|
|
layerFirst ( int layer ) : Entity |
The first Entity on the Layer.
|
|
layerLast ( int layer ) : Entity |
The last Entity on the Layer.
|
|
nearestToEntity ( string type, Entity e, System.Boolean useHitboxes = false ) : Entity |
Finds the Entity nearest to another.
|
|
nearestToPoint ( string type, float x, float y, System.Boolean useHitboxes = false ) : Entity |
Finds the Entity nearest to the position.
|
|
nearestToRect ( string type, float x, float y, int width, int height ) : Entity |
Finds the Entity nearest to the rectangle.
|
|
recycle ( Entity e ) : Entity |
Removes the Entity from the World at the end of the frame and recycles it. The recycled Entity can then be fetched again by calling the create() function.
|
|
remove ( Entity e ) : Entity |
Removes the Entity from the World at the end of the frame.
|
|
removeAll ( ) : void |
Removes all Entities from the World at the end of the frame.
|
|
removeList ( ) : void |
Removes multiple Entities from the world.
|
|
render ( ) : void |
Performed by the game loop, renders all contained Entities. If you override this to give your World render code, remember to call super.render() or your Entities will not be rendered.
|
|
sendBackward ( Entity e ) : System.Boolean |
Shifts the Entity one place towards the back of its contained layer.
|
|
sendToBack ( Entity e ) : System.Boolean |
Sends the Entity to the back of its contained layer.
|
|
typeCount ( string type ) : uint |
Returns the amount of Entities of the type are in the World.
|
|
typeFirst ( string type ) : Entity |
The first Entity of the type.
|
|
update ( ) : void |
Performed by the game loop, updates all contained Entities. If you override this to give your World update code, remember to call super.update() or your Entities will not be updated.
|
|
updateLists ( ) : void |
Updates the add/remove lists at the end of the frame.
|
Method | Description | |
---|---|---|
addRender ( Entity e ) : void |
Adds Entity to the render list.
|
|
addType ( Entity e ) : void |
Adds Entity to the type list.
|
|
addUpdate ( Entity e ) : void |
Adds Entity to the update list.
|
|
removeRender ( Entity e ) : void |
Removes Entity from the render list.
|
|
removeType ( Entity e ) : void |
Removes Entity from the type list.
|
|
removeUpdate ( Entity e ) : void |
Removes Entity from the update list.
|
|
squarePointRect ( float px, float py, float rx, float ry, int rw, int rh ) : float |
Calculates the squared distance between a rectangle and a point.
|
|
squarePoints ( float x1, float y1, float x2, float y2 ) : float |
Calculates the squared distance between two points.
|
|
squareRects ( float x1, float y1, int w1, int h1, float x2, float y2, int w2, int h2 ) : float |
Calculates the squared distance between two rectangles.
|
public add ( Entity e ) : Entity | ||
e | Entity | Entity object you want to add. |
return | Entity |
public addGraphic ( |
||
graphic | Graphic to assign the Entity. | |
layer | int | Layer of the Entity. |
x | float | X position of the Entity. |
y | float | Y position of the Entity. |
return | Entity |
public addMask ( |
||
mask | Mask to assign the Entity. | |
type | string | Collision type of the Entity. |
x | float | X position of the Entity. |
y | float | Y position of the Entity. |
return | Entity |
public bringForward ( Entity e ) : System.Boolean | ||
e | Entity | The Entity to shift. |
return | System.Boolean |
public bringToFront ( Entity e ) : System.Boolean | ||
e | Entity | The Entity to shift. |
return | System.Boolean |
public classCount ( string name ) : uint | ||
name | string | The Class type to count. |
return | uint |
public classFirst ( string name ) : Entity | ||
name | string | The Class type to check. |
return | Entity |
public clearRecycled ( string classType ) : void | ||
classType | string | The Class type to clear. |
return | void |
public collideLine ( string type, int fromX, int fromY, int toX, int toY, int precision = 1, PunkX p = null ) : Entity | ||
type | string | The Entity type to check for. |
fromX | int | Start x of the line. |
fromY | int | Start y of the line. |
toX | int | End x of the line. |
toY | int | End y of the line. |
precision | int | fixme |
p | PunkX | fixme |
return | Entity |
public collidePoint ( string type, float pX, float pY ) : Entity | ||
type | string | The Entity type to check for. |
pX | float | X position. |
pY | float | Y position. |
return | Entity |
public collidePointInto ( string type, float pX, float pY, Object &into ) : void | ||
type | string | The Entity type to check for. |
pX | float | X position. |
pY | float | Y position. |
into | Object | The Array or Vector to populate with collided Entities. |
return | void |
public collideRect ( string type, float rX, float rY, int rWidth, int rHeight ) : Entity | ||
type | string | The Entity type to check for. |
rX | float | X position of the rectangle. |
rY | float | Y position of the rectangle. |
rWidth | int | Width of the rectangle. |
rHeight | int | Height of the rectangle. |
return | Entity |
public collideRectInto ( string type, float rX, float rY, int rWidth, int rHeight, Object &into ) : void | ||
type | string | The Entity type to check for. |
rX | float | X position of the rectangle. |
rY | float | Y position of the rectangle. |
rWidth | int | Width of the rectangle. |
rHeight | int | Height of the rectangle. |
into | Object | The Array or Vector to populate with collided Entities. |
return | void |
public create ( string classType, System.Boolean addToWorld = true ) : Entity | ||
classType | string | The Class of the Entity you want to add. |
addToWorld | System.Boolean | Add it to the World immediately. |
return | Entity |
public getAll ( Object &into ) : void | ||
into | Object | The Array or Vector to populate. |
return | void |
public getClass ( string name, Object &into ) : void | ||
name | string | The Class type to check. |
into | Object | The Array or Vector to populate. |
return | void |
public getLayer ( int layer, Object &into ) : void | ||
layer | int | The layer to check. |
into | Object | The Array or Vector to populate. |
return | void |
public getType ( string type, Object &into ) : void | ||
type | string | The type to check. |
into | Object | The Array or Vector to populate. |
return | void |
public isAtBack ( Entity e ) : System.Boolean | ||
e | Entity | The Entity to check. |
return | System.Boolean |
public isAtFront ( Entity e ) : System.Boolean | ||
e | Entity | The Entity to check. |
return | System.Boolean |
public layerCount ( int layer ) : uint | ||
layer | int | The layer to count Entities on. |
return | uint |
public layerFirst ( int layer ) : Entity | ||
layer | int | The layer to check. |
return | Entity |
public layerLast ( int layer ) : Entity | ||
layer | int | The layer to check. |
return | Entity |
public nearestToEntity ( string type, Entity e, System.Boolean useHitboxes = false ) : Entity | ||
type | string | The Entity type to check for. |
e | Entity | The Entity to find the nearest to. |
useHitboxes | System.Boolean | If the Entities' hitboxes should be used to determine the distance. If false, their x/y coordinates are used. |
return | Entity |
public nearestToPoint ( string type, float x, float y, System.Boolean useHitboxes = false ) : Entity | ||
type | string | The Entity type to check for. |
x | float | X position. |
y | float | Y position. |
useHitboxes | System.Boolean | If the Entities' hitboxes should be used to determine the distance. If false, their x/y coordinates are used. |
return | Entity |
public nearestToRect ( string type, float x, float y, int width, int height ) : Entity | ||
type | string | The Entity type to check for. |
x | float | X position of the rectangle. |
y | float | Y position of the rectangle. |
width | int | Width of the rectangle. |
height | int | Height of the rectangle. |
return | Entity |
public recycle ( Entity e ) : Entity | ||
e | Entity | The Entity to recycle. |
return | Entity |
public remove ( Entity e ) : Entity | ||
e | Entity | Entity object you want to remove. |
return | Entity |
public sendBackward ( Entity e ) : System.Boolean | ||
e | Entity | The Entity to shift. |
return | System.Boolean |
public sendToBack ( Entity e ) : System.Boolean | ||
e | Entity | The Entity to shift. |
return | System.Boolean |
public typeCount ( string type ) : uint | ||
type | string | The type (or Class type) to count. |
return | uint |
public typeFirst ( string type ) : Entity | ||
type | string | The type to check. |
return | Entity |
public Microsoft.Xna.Framework.Vector2 camera | ||
return | Microsoft.Xna.Framework.Vector2 |