Introduction The TimedActivity method is a method used by PositionedObjects (and objects which inherit from PositionedObject such as Sprite) to perform common every-frame logic. The TimedActivity method performs the following: Adjusts position by velocity and acceleration Adjusts velocity by acceleration Adjusts rotation by rotation velocity Adjusts velocity by drag (linear representation) Calls TimedActivityRelative. Adjusts RealVelocity[…]


Introduction ConvertToAutomaticallyUpdated can be used to convert an object back to an automatically updated object. This is useful for objects which typically do not move (so they shouldn’t be automatically updated), but which may move from time to time. ConvertToAutomaticallyUpdated can be called on Sprites and PositionedObject. Code Example The following shows how an entity[…]


Introduction PositionedObjectLists in Glue represent lists of objects which can be positioned. Positioned objects include: Any Entity Circles AxisAlignedRectangles Texts Sprites In code all of the objects mentioned above inherit from the FlatRedBall.PositionedObject class. The list above is just some of the most common types. Default Functionality – Glue Creates Lists in GameScreen By default[…]


Introduction The ManagedPositionedObject list in the SpriteManager object is a list of PositionedObjects which the SpriteManager is managing. In a typical project (using Glue), this list will contain mostly instances of Entities in your game, so you can look at this list to see what is actively managed.


Introduction The LayeredTileMap object is the runtime type for the TMX file format (the native file format for Tiled). Whenever a TMX file is added to FlatRedBall, it will (by default) be loaded into a LayeredTileMap at runtime. The LayeredTileMap represents a collection of MapDrawableBatches. It contains one MapDrawableBatch per layer in the source TMX[…]


Introduction The AfterThat function can simplify delaying the execution of Scripts after other scripts have run. The AfterThat function will look at the previous Do calls which are grouped under the previous “If” or “AfterThat”, and will only execute it’s Do’s when all of the previous Do’s are finished. This allows the creation of cascading[…]


Introduction All FlatRedBall shapes inherit from the PositionedObject class, so they inherit the X, Y, Z, and Position properties. The Z value of shapes impacts their rendering, but not collision. In other words, shapes will render differently according to their Z value when rendering on a 3D camera, but they will collide as if their[…]


Introduction The Camera class inherits from the PositionedObject class, so it can use the AttachTo function. For general information on AttachTo, see the PositionedObject.AttachTo page. Attaching a Camera to another object The simplest way to have the Camera follow an object is to attach the Camera to the object. However, if you do this, you[…]


Introduction The Camera object inherits from the PositionedObject class. Therefore, it can be rotated just like any other PositionedObject. For information on using rotation values on a PositionedObject in general, see the following pages: FlatRedBall.PositionedObject.RotationX FlatRedBall.PositionedObject.RotationY FlatRedBall.PositionedObject.RotationZ FlatRedBall.PositionedObject.RotationMatrix By default the Camera will attempt to orient itself so that “up” is the Y vector (0,1,0).[…]


Introduction The LastPosition property is a protected property which marks the position of the PositionedObject last frame. This property is only updated if the PositionedObject’s KeepTrackOfReal.