Learn the different properties of your Game Objects
Object Name & Category
On the Editor left, you have two entries allowing to change the name and the category of a selected object.
- Object Name : Object names are used to identify objects inside your code. If you know the name of an Object, you can ask the nero::ObjectManager of your Scene class to find and return it.
- Object Category : The Engine uses categories to configure objects collision.
When you select any Object containing a Mesh (Mesh Object, Meshed Sprite, Meshed Animation), the Tab Mesh on the left of the Editor will show the physical properties carried by the mesh inside that that Object.
- Fixed Rotation : When activated, your Object will never rotate, whether it stands on sloping ground or it gets hit by a projectile.
- Is Sensor : Object in sensor mode stays affected by Gravity, but that’s all, they don’t participate to the Physics Simulation. They cannot collide with any other Object.
- Allow Sleep : This property is activated by default, and it should stay like that. It will help reduce the physics computation operated by the Engine.
- Density ( value = [0 – 100] ) : What is density ? In simple words it’s a ratio between an Object volume and its weight. For the same volume, the same Object will get a higher weight if its density get increased. In your game, that will make your objects heavier. The Engine computes the weight of each Physic Object based on its surface (the equivalent of volume in 2D). Changing the density will change the computed weight.
Also the density does not affect the way Gravity affect an Object. Two Objects with the same volume, and different density (e.g different weight) will be affected the same way by the gravity (in the absence of air resistance to be more accurate). For more detail on that check Newton Laws.
- Friction ( value = [0 – 10] ) : What is Friction ? If you don’t want your Object to slide on a sloping ground just increase its Friction. If you want your Object to slide on any surface like if it was ice set the Friction to 0. Friction is a form of resistance created by one Object when another moving Object touch it. For more detail check Friction Force. Internally the Engine uses a range value of [0 – 1], In order to avoid using decimal, the Editor uses the range value of [0 – 10].
- Restitution ( value : [0 – 10] ) : What is Restitution ? Increase restitution will allow your Object to bounce more easely. Restitution indicate how much force an Object get back when it hits another Object. For more detail check Coefficient of Restitution. Internally the Engine uses a range value of [0 – 1], In order to avoid using decimal, the Editor uses the range value of [0 – 10].
- Gravity Scale ( value : [0 – 10] ) : If you want to change the way your Objects are affected by gravity, this is the property to configure. Set the value to 0 will allow your Object to float on the air. Increase the value, will make your object fall down more quickly.
An animation is made of several Sequences. When you select an Animation Object or a Meshed Animation, the Tab Sequence on the left of the Editor will show the list of the Sequences contained in the selected Object.
From the image below, we can say that our animation contains the sequences walk, slide, run, and look. For each sequence you can change its frame rate and activate or deactivate the animation loop.
- Button Select : Select the corresponding sequence
- Loop : Make the animation repeat itself indefinitely
- Frame Rate : The speed at which the animation sequence goes from one frame to another. The value is in Hertz (a value of 5 means 1/5 second)
Once a Text Object is selected you can change its properties with the Tab Text located on the left of the Editor.
- Text Font : Below the button Add Text, a drop-down list allows you to select the font you want.
- Text Value : The text inside your Text Object is set using the entry below the fonts drop-down.
- New Line : While writing the value of the Text Object, you can add a new line using a special character. The default character is pipe ( | ). You can choose the character you want by changing the parameter carriage_return in the file Project/config/engine_config.json.
- Font Size : The size of each character.
- Outline : The thickness of the text outline.
- Style : The text style (Bold, Itatlic, Underline, Line Through).