Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
AxisAlignedRectangles are rectangular shapes which cannot be rotated. AxisAlignedRectangles can be used as collision objects. For information on using AxisAlignedRectangles in code, see the AxisAlignedRectangle code page.
To add an AxisAlignedRectangle to an entity:
Expand your entity
Right-click on the Objects item
Select "Add Object"
Enter the name "Collision"
Set the SourceType to "FlatRedBallType
Set the SourceClassType to "AxisAlignedRectangle"
The Circle object is commonly used for collision and as a placeholder graphic in game development. Circles can be added to entities which implement the ICollidable interface to act as the entity's collision shape.
To add a circle to an existing entity:
Expand the entity
Right-click on the entity's Objects folder
Select Add Object
Verify the FlatRedBall or Custom Type option is selected
Select Circle
Click OK
Circles can also be added to a new entity. To do this:
Right-click on Entities
Select Add Entity
Check the Circle option. Notice that this automatically checks the ICollidable check box.
The CameraControllingEntity provides a standardized way to control camera position in games which contain a moving character or which use Tiled for maps.
This page discusses working with the CameraControllingEntity in the FRB Editor. For information about how to work with it in code, see the CameraControllingEntity API Documentation.
If your game was created with the wizard, then your GameScreen has an instance called CameraControllingEntityInstance.
This instance targets the PlayerList (averages the position of all Players in the PlayerList) and will restrict the visible area to the Map object.
The Extra Map Padding property adds a number of pixels of offset between the edge of the actual map and the desired visible edge. A positive value adds padding, effective shrinking the available area that the camera can view. A negative value allows the camera to move outside of the map. Note that the property on the CameraControllingEntity is called Map since this is the most common type of object used to control bounds, but it doesn't have to be a map.
You can manually add a new instance to your game if you do not already have an instance in the GameScreen. Keep in mind this may have already been done for you if your game was created using the new project Wizard. To add a CameraControllingEntity to a game that has not used the Wizard:
Select your GameScreen
Select the Quick Actions tab
Click the Add Object to GameScreen button
Select the Camera Controlling Entity option
Click OK
Once you have created the instance, you can assign it the object to follow and the map to use as the visible bounds. To set which object the camera will follow:
Select the newly-created CameraControllingEntityInstance
Click the Variables tab
Select which object to follow in the Targets list. Notice that you can select entire lists of objects too, which will result in the CameraControllingEntity using the center position for all objects.
Similarly, the Map object can be set to control the visible bounds of the camera using the Map dropdown.
At runtime the Camera will automatically follow the target with no additional code required.
Objects in Screens and Entities can be of type Camera. A Camera object will (by default) represent the main Camera (FlatRedBall.Camera.Main). If an object in an Entity is a Camera, then this will (by default) attach the main Camera to the Entity. If an object in a Screen is a Camera, then this object serves as an alias for FlatRedBall.Camera.Main, but no attachment occurs.
Cameras added to a Screen can be modified in the FlatRedBall Editor. By default, adding a Camera object to a Screen does not create a new Camera, but rather it provides access to the main Camera. For more information, see the IsNewCamera property below. To access the camera in a Screen:
Select the Screen to contain the object. To make changes for all levels, select the GameScreen.
Click the Add Object button to add a new object to the screen
Select Camera as the type and click OK
The new camera appears in the GameScreen. It can be modified to make changes to the game, including in edit mode. For example, the Background Color can be changed from Black to any desired color.
The IsNewCamera property is a property which only appears on objects which are of type Camera.
If this property is false (the default value) then the Camera object is assigned to the main Camera (FlatRedBall.Camera.Main).
If this property is true, Glue will create a new Camera instance. This is not often used but can be used for split-screen games.
If you are developing a game which requires logic for initializing or controlling the Camera then you may want to organize this code into an Entity. The Camera object facilitates setting this up in Glue. The process is as follows:
Create an Entity which will contain all of the logic. For example an Entity named CameraEntity
Right-click on the CameraEntity's objects and add a new object
Select Camera as the type
Now you can code logic in the CustomInitialize and CustomActivity of your CameraEntity.
The DestinationRectangle can be used to make a Layer only draw to part of a Screen. This is often referred to as "masking" or "creating a mask". The DestinationRectangle property in Glue functions the same as in code. For a technical discussion on destination rectangles for Layers, see this page.
The DestinationRectangle can control the area of the screen where a Layer is drawn. By default the DestinationRectangle is blank in Glue, meaning that the Layer will occupy the same area on screen as the main Camera.
This destination rectangle can be changed in Glue. To do this:
Right-click on "DestinationRectnagle" in Glue.
An option for "Use Custom Rectangle" should appear
Select this option and the Layer will be given a custom rectangle:
Now that the DestinationRectangle value is there, we can modify it easily by changing one of the four values, or by expanding the DestinationRectangle and modifying each value independently:
Consider a Sprite which takes up nearly the entire screen:
If this Sprite were put on the Layer, it would look like this:
RenderTarget2D instances can be created in the FRB Editor. When created in the FRB editor, they have the following behavior:
They will automatically match the resolution of the screen
They will be cleaned up when the Screen is destroyed
For an example on using RenderTarget2Ds with FlatRedBall Layers, see the Layer RenderTarget page.
A SoundEffectInstance is a sound effect which provides a number of properties which can be used to modify how the sound is played back - for example volume, pitch, and whether the sound is looping. If a SoundEffectInstance is playing, it cannot be played again until the sound ends, or until the SoundEffectInstance is explicitly stopped. This can give precise control over how many sounds are playing at one time.
To add a SoundEffectInstance to your project:
Make sure you have a Glue project with a Screen or Entity which will contain the SoundEffectInstance.
Add a new WAV file to your Screen or Entity. For more information, the .WAV file page.
Once the file has been added to Glue, you need to change the RuntimeType to SoundEffectInstance:
At this point the SoundEffectInstance will be available in code, but you cannot change any variables on the SoundEffectInstance. To do this:
Right-click on Objects
Select "Add Object"
Select the "From File" option
Select the .wav file you added as a file
Click OK
Select the newly-created object
Change "SourceName" to "Entire File (SoundEffectInstance)"
After setting up the object, you can modify the variables of the object in Glue. To do so, select the object and scroll to the "Unset Variables" category. These variables can also be set through code:
Layers are a type of object which can be used to control the order in which visible objects in FlatRedBall are drawn. Most objects sort by their Z value. In other words, objects which are further from the Camera will draw behind objects which are closer to the Camera. Layers allow control over draw order without changing the Z of objects.
Layers are often used to draw certain categories of objects. For example, you may have regular game objects (such as trees, the ground, the sky), a Layer specifically for HUD elements (score, health, ammo), and another Layer for popup screens (pause screen, disconnected controller screen). Layers can also be used to draw visuals in 2D coordinates on top of a 3D Camera.
For a general tutorial on Layers in Glue, see the Using Layers Glue Tutorial page. For information on using Layers in code, see the Layer page.
To create a Layer in the FRB Editor:
Select a Screen or Entity which will contain the Layer. Usually Layers are added to Screens.
Click the Quick Actions tab
Click the Add Object button
Select Layer
Click OK
Layers are drawn in the same order that they are added in code. In other words, if Layer1 was added first, then Layer2, Layer1 would draw first, then Layer2 would be drawn on top of Layer1. Similarly, the order of Layers in Glue impacts the order that they are drawn. Layers draw top-to-bottom. Therefore, the first layer when looking at the list of elements in Glue will be drawn first, and any subsequent Layers will be drawn on top.
You can adjust the order of layers by right-clicking on a Layer and selecting one of the options to move it:
To add an object to a layer:
Make sure you have a Layer in the same Screen as your object
Drag+drop the object onto the layer
You can verify that the layer was changed by looking at the LayerOn property. Entity instances can be moved to a layer in code using the MoveToLayer function.
The FRB Editor supports the creation and management of CollisionRelationship objects. This document covers the features provided by the FRB Editor, and explains common scenarios where you may need to interact with the CollisionsRelationships in code. Most cases can be handled by CollisionRelationships in the FRB Editor; however, more advanced situations can be handled in code. For information about creating and working with CollisionRelationships in code, see the CollisionManager page.
CollisionRelationships define how to respond when two types of objects collide (overlap). Examples of reactions to overlapping objects include:
A player must take damage when colliding with a bullet
A bullet must be destroyed when colliding with a wall
An enemy must be moved so that it doesn't overlap the same space as another enemy
A car must reduce its maximum speed when driving over grass
Even simple games will require multiple relationships, and larger games may include dozens of relationships. Glue makes the creation and management of these much simpler than management purely in code.
Collision relationships can be created between:
Lists of entities which implement ICollidable
Individual Entity instances which implement ICollidable
TileShapeCollections
ShapeCollections (regular, as opposed to TileShapeCollections)
All CollisionRelationships will at include at least one Entity or Entity list, so it is important to mark Entities which you intend to use in relationships as ICollidable. For information on ICollidable entities, see the ICollidable Entity page.
CollisionRelationships can be created a few ways. Typically collision relationships are added to a screen, such as a base GameScreen. In this example we will use a screen called GameScreen which already has a few objects:
PlayerList (a list of Player entities)
BulletList (a list of Bullet entities)
EnemyList (a list of Enemy entities)
SolidCollision (a TileShapeCollection)
Note that the TileShapeCollection may have its SetByDerived value set to true. This allows the creation of CollisionRelationships in a base Screen even though the TileShapeCollection is created in a derived Screen.
You can drag+drop one collidable object (such as a list) onto another collidable object (such as another list or a TileShapeCollection) so long as the two objects are in the same screen. This will create a CollisionRelationship between the two objects.
The Collision tab displays when a collidable object or list is selected
The image above displays the Collision tab for the BulletList. Notice that the BulletList can collide with any of the other collidable objects in the GameScreen including itself. Adding collision is easy - just click the Add button next to the object in the Collision tab to create a new relationship. For example, clicking on the Add button next to EnemyList creates a relationship between BulletList and EnemyList.
CollisionRelationships are regular Objects which can be created through the right-click menu. To create a CollisionRelationship through the right-click menu:
Right-click on a Screen's Objects
Select Add Object
Verify FlatRedBall or Custom Type is selected
Select the CollisionRelationship type
Click OK
In this case the newly-created CollisionRelationship will not yet reference any collidable objects in the screen, and the game will not compile until the objects in the relationship are set (as shown in the next section).
Once a CollisionRelationship is created, it can be edited by selecting it under the Screen's Objects folder and clicking the Collision tab.
A CollisionRelationship objects can be changed using the two drop-downs. Note that if the Auto-name Relationship checkbox is checked, the name of the relationship will automatically change when either of the two objects in the relationship changes. Of course, if you create CollisionRelationships using either the Add button or the drag-drop method, you do not need to set the object types.
Subcollision allows specifying a specific shape within a collidable entity to use when performing collision. This is useful if an entity includes multiple shapes, each for different purposes. For example, an enemy may have a circle for solid collision (preventing the enemy from walking through walls) but it may also have a line for line-of-sight collision. In this case, we do not want the line to collide against the walls, so we would specify that only the enemy's circle should collide with the walls. All available shapes for subcollisions appear in the Subcollision dropdowns for each object. Note that changing the subcollision will also rename the CollisionRelationship if the Auto-name Relationship option is checked.
Physics can be set up through the Collision tab which offers multiple options.
:
No Physics - Colliding objects will not automatically have their positions or velocities changed by the CollisionRelationship.
Move Collision - Colliding objects will be separated if a collision occurs using their relative mass values. The most common values for First Mass and Second Mass are 1, 1 if both objects have equal mass and 0, 1 if the first object should not be able to push the second (in the case of colliding against a solid TileShapeCollection)
First Mass - the mass of the first object in the relationship (the mass of enemies) relative to the mass of the second object. If this object should not be able to push the second object, it should have a mass of 0.
Second Mass - the mass of the second object relative to the first object. If this object should not be able to push the first object, it should have a mass of 0.
Move Soft Collision - Colliding objects will be separated, but gradually over time. This creates a "soft" feel, allowing objects to overlap and push each other around.
Bounce Collision - Colliding objects will be separated if a collision occurs. They will also have their velocity adjusted in response to the elasticity value. An elasticity value of 1 will preserve momentum. An elasticity of 0 will be an inelastic collision - where momentum is lost.
First Mass/Second Mass - see Move collision
Elasticity - A multiplier for an object's velocity when it collides. A value of 0 will absorb momentum. A value of 1 will preserve momentum. A value greater than 1 will add momentum.
Physics can also be applied using collision events if your game needs to customize the behavior when a collision occurs. For example, you may want the relaitive masses between entities to vary rather than always being fixed.
In some cases games will need to perform custom logic when a collision occurs. For example:
A Player entity takes damage when colliding with a bullet
The Bullet entity being destroyed when colliding with a wall
An Enemy entity's movement speed being slowed when colliding with mud TileShapeCollection
Certain objects should have different masses when performing collision.
Collision events can be created by dropping a CollisionRelationship on a Screen's Events folder.
For more information on FlatRedBall events, see the FlatRedBall Events page. Like all other events, collision events can be edited in code. In the example above, the GameScreen.Event.cs file now includes an function OnEnemyVsPlayerCollisionOccurred which is called whenever a collision occurs between an Enemy and Player instance. Make sure to add code to <YourGameScreen>.Event.cs and not the <YourScreen>.Genererated.Event.cs.
Notice that the CollisionRelationship used in this example is between a list of Enemies and a list of Players, but the event is raised for a single Enemy and a single Player. Since each enemy may collide with each player, the event method may get raised multiple times per frame. Every time the event is raised, the arguments tell you which two objects collided.
For example, in the code above, you could destroy either the enemy (which is called first) or the player (which is called second) in the event. To destroy the enemy, you can do the following code:
To identify which shapes an entity collided against in a TileShapeCollection, the LastCollisionAxisAlignedRectangles property can be used. For more information see the LastCollisionAxisAlignedRectangles page.
If all entity instances have the same mass, then you can set your collision relationship physics through the FlatRedBall Editor. If your game requires custom masses, then you can implement your own physics in the collision event.
For example, the following code would adjust the player's mass so that it is higher if the player is shooting. This makes the player harder to move when shooting.
CollisionRelationships created in Glue will be automatically managed and will automatically perform their every-frame logic. In some cases games need to manually perform collision logic. For example, a game may need to first reset variables on an entity before collision logic is performed for that frame. In that case, the CollisionRelationships created in Glue can be modified in the CustomInitialize method of the GameScreen. For example, to disable the EnemyListVsPlayerList CollisionRelationship, the following code can be used:
PositionedObjectLists (also referred to as lists) in the FlatRedBall Editor hold lists of objects which inherit from the PositionedObject type. Positioned objects include:
Any Entity (the most common types of lists)
Circles
AxisAlignedRectangles
Texts
Sprites
In code all of the objects mentioned above inherit from the FlatRedBall.PositionedObject class.
The most common place for lists is in GameScreen, although lists can exist in any screen and even in other entities.
As shown below, when an entity is created, the FlatRedBall suggests creating a list in GameScreen as well as adding a factory for the list. This configuration enables the following common and useful behaviors and relationships:
Entity lists automatically associated themselves with factories, so that creating a new instance through a factory in code results in the instance being added to the list.
Entity lists call Activity on all contained instances, keeping activity behavior consistent whether the instance is created in the FRB editor or at runtime (such as through a factory)
Entity lists automatically destroy all instances when the screen ends, making screen cleanup easy
By default the FRB Editor creates lists for newly-created entities if the default options are left unchanged. For example, the following animation shows the creation of an entity called Enemy which also results in an EnemyList added to GameScreen.
The FlatRedBall Editor provides a number of ways to create new lists.
If your game has a GameScreen, and if your GameScreen does not already contain a list for an entity, then the Quick Actions tab shows a button to add a list to the GameScreen. Clicking this button creates a new list in the GameScreen.
Entity lists can be created by right-click drag+dropping an entity into a screen. This is useful if you are adding lists of entities to screens other than the GameScreen.
PositionedObjectLists can also be created through the regular right-click menu in an screen or entity's Objects node:
Right-click on Objects
Select Add Object
Make sure FlatRedBall or Custom Type is selected
Select PositionedObjectList<T>
Select the type of list to create using the dropdown
Enter the name of the list
Once a list has been created, instances of the list's type can be added through the FRB Editor using a number of methods.
Option 1 - Drag+drop onto Screen, Objects folder or List
If a list contains a screen, it becomes the default container for newly-created instances that are added by drag+drop. For example, the following shows enemies being added to the EnemyList by drag+dropping an enemy on Level1, Level1's Objects folder, and directly on the EnemyList.
Option 2 - Right-click, Add Object
Objects can be directly added to the list by right-clicking on the list. Notice that the Add Object window restricts the types of entities which can be added to the types that are supported by the list. For example, the following animation shows how to add an Enemy to an Enemy list with the right-click menu.
If the list is of a base type, then the right-click option provides all available options for the list. For example, the following is a screenshot from a game which has multiple entity types inheriting from Enemy:
The CallActivity property controls whether the FRB Editor should generate Activity calls for a PositionedObjectList. By default this value is set to true. For example, the following shows a BulletList inside a screen which has its CallActivity set to true:
If this value is changed to false, then the Bullet instances inside of BulletList would not have their Activity (and CustomActivity) methods called automatically in generated code.
The most common reason to set this value to false is when dealing with derived entity lists. For example, consider a game which has a base Enemy entity as well as Skeleton entity which inherits from Enemy (Skeleton is an Enemy variant). If the game needs to perform custom logic on Skeleton instances then it may need both an EnemyList and SkeletonList in GameScreen.
In this case, Skeletons which are created through the Skeleton factory would be added to both the EnemyList and the SkeletonList. If both EnemyList and SkeletonList called Activity, then Skeleton instances would have activity called twice per frame. This can result in unexpected behavior such as movement logic being applied twice per frame.
If a derived entity type list is added to a screen through the quick action button, FlatRedBall automatically sets CallActivity to false.
If an entity list is added through the right-click option on a screen, FlatRedBall provides suggestions about whether to call Activity.
Sprites are used to render a texture to the screen. Sprites are one of the most common types of FlatRedBall objects. Examples of Sprites include:
Character graphics (static or animated)
Backgrounds
Particles
Bullets
Sprites are often contained in Entities or created in code as particles.
Many new developers confuse the terms Sprite and Texture so it's worth discussing the difference. A Sprite is an object that is added to an Entity which can display a texture or a portion of a texture. A Sprite can have a size, rotation, transparency, and a color tint.
A texture (technically a Texture2D) is an image which is usually loaded from a .png file. The texture has pixel data which is used by a Sprite to draw to the screen. A texture can contain a single image (such as a coin or bullet), or it can contain multiple images. When it contains multiple images it is often referred to as a sprite sheet.
You can think of the Sprite as something which displays texture data - like a digital picture frame. The texture is the picture that is being displayed in the digital picture frame.
When you are creating a new entity, you can check the option to add a Sprite in the Add Entity Window.
Right-click on the Entities folder
Select Add Entity
Check the Sprite option
Click OK
Sprites can be added to FlatRedBall screens or entities, although most games don't include Sprites directly in screens. To add a Sprite to an entity:
Create or select an existing entity or screen
Right-click on the Objects node
Select Add Object
Select the FlatRedBall or Custom Type category
Select the Sprite type
Click OK
Entities often contain a Sprite for their main visuals. Some entities may have multiple sprites for visuals. For example, an Enemy may have the main SpriteInstance for its body and a ShadowSprite for the shadow.
Sprites usually display textures, which are created from image files such as .png files. To add and display a texture on a Sprite:
Create a Sprite in a screen or entity as shown above
Find a .png which you would like to use
Drag+drop the .png file onto your screen or entity's Files folder in FlatRedBall
Select the Sprite in the same screen or entity with the newly-added file
Change its Texture property to the newly-added file
Sprites can display animations by referencing a .achx file.
To reference an Animation, the first step is to have a .achx file in the same Entity or Screen as your Sprite.
Once you have an .achx file, you can add the Animation by drag+dropping the .achx onto the Sprite.
Alternatively, you can change the Animation Chains property in the Variables tab.
The TileNodeNetwork object type is used to define the walkable areas in a level. Once a TileNodeNetwork is created it can be used for pathfinding for AI-controlled entities such as Enemies.
The FlatRedBall Editor supports the creation and population of TileNodeNetworks. Typically TileNodeNetworks are filled using tile maps. This section covers common ways to fill a TileNodeNetwork. We recommend using the GameScreen and Level approach, as this makes it easier to maintain games with multiple levels. Using this pattern, a TileNodeNetwork would be defined in the GameScreen:
Select the GameScreen
Click Add Object to GameScreen in the Quick Actions tab
Select TileNodeNetwork as the type
Enter a name for your TileNodeNetwork such as WalkingNodeNetwork
Click OK
Be sure to create the TileNodeNetwork in the GameScreen so it is included in all levels.
TileNodeNetworks (just like normal NodeNetworks) must have nodes and links to be used for pathfinding. Each node represents a point on the map where an entity can walk. These nodes are connected by links which indicate how an entity can walk.
We can create nodes and links for each level from the tiles in our Tiled map. We have two options for doing this:
By indicating that all empty tiles in a map should contain nodes
By using a dedicated tile for marking where entities can walk
The first option is easier because it works for many simple maps without any modifications. The second option provides more flexibility.
For simplicity we'll use the first approach (empty tiles):
Select the new TileNodeNetwork
Click on the TileNodeNetwork Properties tab
Click the From Layer option under the Creation Options category
Select your map and the layer. Typically this is Map and GameplayPlay layer.
Verify the All Empty option is selected
Optionally you may want to make the TileNodeNetwork visible so you can verify that it has been filled in:
Select the TileNodeNetwork
Click the Variables tab
Check the Visible checkbox
The game should display the node network wherever no tiles are present.
Some games include specific tiles for pathfinding rather than all empty tiles. The first step is to determine which tile to use as walkable tiles. Whichever tile is used should have its Class (or Type if using older versions of Tiled) specified in the tileset in Tiled.
Once this tile Type is set (and the .tsx is saved), this tile can be used to mark walkable areas in the map.
To use these tiles:
Select the TileNodeNetwork
Click the TileNodeNetwork Properties tab
Check the From Type property
Select the Source TMX File (usually Map)
Select the type for the tile you just saved. It should appear in the drop-down if the .tsx file has been saved.
The TileNodeNetwork will now place a node wherever the walkable tiles are present.
The Is2D option can be used to make a Layer use 2D coordinates. Layers which are 2D can be used even if the current Camera is in 3D. Layers which are 2D are often used to create HUDs and UI Screens.
The most common usage of the Is2D property is to create a 2D layer in a game which uses a 3D camera. Typically 3D games will have some type of 2D hud, so a 2D layer is needed to hold hud.
This example shows a simple setup where a 2D layer can be used on a 3D graphic. First, the game is set up to use a 3D camera.
Next, a Sprite is added to a GameScreen. It has the following variable values:
Texture = GroundTexture
Right Texture Pixel = 512
BottomTexturePixel = 512
Texture Address Mode = Wrap
Y = -10
Rotation X = 1.5708
The GameScreen has a layer named Layer2D for 2D objects.
Finally the GameScreen has a Text instance called GameOverText which has been placed on Layer2D.
The result is SpriteInstance is drawn in 3D, but the GameOverText is drawn and positioned in 2D.
FlatRedBall Text objects can be used to display information to the player such as current score or character dialog. Glue supports creating and editing Text objects in screens and entities.
To create a Text object in Glue:
Right-click on the Object item in a screen or entity
Select Add Object
Select the "FlatRedBall or Custom Type" option
Scroll down and select the "Text" type
Click OK
To see the Text object:
Select the Text object
Set its Display Text value to some value like "Hello"
Click the Preview checkbox in Glue
Since Text objects are usually used for game UI, the following properties are usually set in Glue:
The FlatRedBall Editor supports creating objects of type ShapeCollection.
Note that entities which are created as ICollidable automatically have a ShapeCollection named Collision, and all shapes shapes are added to the default Collision shape collection. In this case you do not need to manually create a ShapeCollection. For more information, see the page.
To add a ShapeCollection:
Right-click on Objects under a Screen or Entity
Select Add Object
Verify that FlatRedBall or Custom Type is selected.
Select ShapeCollection
Click OK
Note that FlatRedBall also supports the .shcx file format, but this is no longer recommended. The PolygonEditor tool is no longer maintained, and the recommended approach is to add a ShapeCollection as shown above and to modify the shapes using FlatRedBall's LiveEdit.
ShapeCollections can have shapes added manually. The ShapeCollection serves as a "list" of shapes, but unlike normal lists, the ShapeCollection can contain multiple types of objects.
To add a new shape to the ShapeCollection:
Right-click on the ShapeCollection instance
Select Add Object
Select one of the shapes - notice that FlatRedBall filters the available types to the types allowed in a ShapeCollection.
Click OK
Your newly-created shape is added to ShapeCollection in the tree view.
Polygons can be added to screens and entities to create complex collision. Polygons will automatically be used in an entity's collisions if the entity is marked as ICollidable in Glue. For information on working with the Polygon object in code, see the .
Polygons can be added to entities:
Select the entity which will have the Polygon
Select the Quick Actions tab
Click the Add Object button
Select the Polygon type
Click OK
If the containing Entity is an ICollidable, the Polygon will automatically be used when performing collision.
Polygons can be edited through the Points tab, which appears when selecting a Polygon.
For more information about working with textures, see the .
To add a new .achx file, see the page.
Sprites can automatically apply the collision from their AnimationChains to their parent Entity. For more information, see the page.
For information on how to use Layers in code, see .
- Text objects are usually placed on a UI or HUD layer
- Text objects are usually displayed in a fixed position on screen
For information on how to work with a ShapeCollection in code, see .