Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gdevelop5:objects:base_object [2019/07/08 12:38]
piyushpalawat99
gdevelop5:objects:base_object [2020/04/06 09:42] (current)
4ian [In the events editor]
Line 9: Line 9:
  
 You can choose from many different type of objects, all with specific properties and purpose: You can choose from many different type of objects, all with specific properties and purpose:
-{{ :​gdevelop5:​objects:​object-types.png?nolink&​400 ​|}}+ 
 +{{ :​gdevelop5:​objects:​base_object:​pasted:​20200406-092728.png?nolink |}}
  
 Depending on what type of object you have chosen, the editor, aspect of the object and the available features in the events will be different. As the goal of this page is to explain objects in general, we won't go in to details of these unique properties on each type. You can find [[http://​wiki.compilgames.net/​doku.php/​gdevelop5/​objects|detailed information on each type of object here]]. Depending on what type of object you have chosen, the editor, aspect of the object and the available features in the events will be different. As the goal of this page is to explain objects in general, we won't go in to details of these unique properties on each type. You can find [[http://​wiki.compilgames.net/​doku.php/​gdevelop5/​objects|detailed information on each type of object here]].
Line 19: Line 20:
 An object can be positioned on the scene by selecting the object in the Object tab (click/tap on it) and then drag them into the scene to put an *instance* of that object. An *instance* is basically a copy of the object living on the scene. Each instance has its own variables, position, animations (for sprite objects), content (for texts), etc... An object can be positioned on the scene by selecting the object in the Object tab (click/tap on it) and then drag them into the scene to put an *instance* of that object. An *instance* is basically a copy of the object living on the scene. Each instance has its own variables, position, animations (for sprite objects), content (for texts), etc...
  
-We can change the position of an object by selecting the object in the scene editor and drag it. +On the scene editor, you can:  
-We can scale the object by selecting the object and drag one of the white scale points+change the position of an object by selecting the object in the scene editor and drag it. 
 +scale the object by selecting the object and dragging ​one of the white handles: 
 +* rotate the object by selecting the object and dragging the rounded white handle:
 {{ :​gdevelop5:​objects:​coin-selected.png?​nolink&​200 |}} {{ :​gdevelop5:​objects:​coin-selected.png?​nolink&​200 |}}
  
-## Modifying properties+## Modifying ​Instance ​properties
  
-When we select an object ​in the scene editor, the properties panel on the left shows information about the selected instance(s). If it is not open, you can re-open it by clicking the properties button in the toolbar:+When you select an instance ​in the scene editor, the properties panel on the left shows information about the selected instance(s). If it is not open, you can re-open it by clicking the properties button in the toolbar:
 {{ :​gdevelop5:​objects:​object-propeties-button.png?​nolink&​200 |}}  {{ :​gdevelop5:​objects:​object-propeties-button.png?​nolink&​200 |}} 
  
Line 31: Line 34:
  
 You can precisely set the position of the selected instances by changing the X and Y values in the properties: You can precisely set the position of the selected instances by changing the X and Y values in the properties:
-{{ :​gdevelop5:​objects:​object-position-properties.png?nolink&400 |}}+ 
 +{{ :​gdevelop5:​objects:​base_object:​pasted:​20200406-092924.png?nolink }}
  
 ## Angle ## Angle
Line 46: Line 50:
 {{ :​gdevelop5:​objects:​object-zorder-properties.png?​nolink&​400 |}}  {{ :​gdevelop5:​objects:​object-zorder-properties.png?​nolink&​400 |}} 
  
-The purpose of the Z order is to allow to specify which object will be displayed first, when instances are overlapping. More precislywe can control if the object is behind ​an other object ​or it is in front by setting different values: when two objects are overlapping,​ the object with the lower value of Z order will be displayed behind the other.+The purpose of the Z order is to allow to specify which object will be displayed first, when instances are overlapping. More preciselyyou can control if the object is behind or in front of another object: when two objects are overlapping,​ the object with the lower value of Z order will be displayed behind the other.
  
 Values can be any integer, including negative numbers and 0. Values can be any integer, including negative numbers and 0.
Line 56: Line 60:
  
 You can set the layer of an instance: You can set the layer of an instance:
-{{ :​gdevelop5:​objects:​object-layer-properties.png?​nolink&​400 |}} 
  
-By default, each GDevelop scene comes with single ​layer called ​the "​Base ​layer". This is where all objects are located in our sceneWe can add more layers ​for various purposes and put any instance on any layer. For example, there can be a layer to display controls on screen, another to display a menu, a map, or a background.+{{ :​gdevelop5:​objects:​base_object:​pasted:​20200406-093010.png?​nolink |}} 
 + 
 +A layer acts as a *virtual container* for objects displayed on the screen. Objects are drawn on a layer, which is by default the **“base layer”**, and the layer is then drawn on the screenA scene can have multiple ​layers. For example, there can be a layer to display controls on screen, another to display a menu, another for a map, and yet another for a background.
  
 ## Lock position/​angle ## Lock position/​angle
  
 By ticking the box "Lock position/​angle in the editor",​ you can make the instance immovable in the editor: By ticking the box "Lock position/​angle in the editor",​ you can make the instance immovable in the editor:
-{{ :​gdevelop5:​objects:​lock-sprite.png?​nolink&​400 |}} 
  
-When the instance is locked, we can not longer select it in the scene. There are times when you have lot of objects ​overlapping each other in your scene. This makes it difficult to select some of them as we keep selecting the ones we don't intend to. In such cases, you can lock the instances.+{{ :​gdevelop5:​objects:​base_object:​pasted:​20200406-093052.png?​nolink |}} 
 + 
 +When the instance is locked, we can not longer select it in the scene. There are times when you have lot of object instances ​overlapping each other in your scene. This makes it difficult to select some of them as you keep selecting the ones you don't intend to. In such cases, you can lock the instances.
  
 You can unlock a locked instance by opening the instances panel, which is displaying all the instances in our scene and select the object from the list. You can unlock a locked instance by opening the instances panel, which is displaying all the instances in our scene and select the object from the list.
Line 71: Line 77:
 ## Instance variables ## Instance variables
  
-The "edit variables" ​button ​allows to specify variables that are specific to the selected instance: +The "Instance Variables" ​table allows to specify variables that are specific to the selected instance:
-{{ :​gdevelop5:​objects:​instance-variables-property.png?​nolink&​400 |}}    ​+
  
-A variable is basically a container that is holding a value (a number, a text), which can be compared and modified during the game. There are different type of variables in GDevelop, in particular each object can contain variables. When the game is running, each *instance* of the object living on the scene will have its own variables.+{{ :​gdevelop5:​objects:​base_object:​pasted:​20200406-092023.png?nolink |}}
  
-The "​Edit ​variables" ​allow you to specify variables that are specific to the selected instance. For example, if you have objects representing boxes with gold on the scene, you can modify the variable named "​Gold"​ of each instance to set a different number. Then in the events, when the player collides with a box, you can read the variable value to add it to the player gold amount.+A variable is basically a container that is holding a value (a number, a text), which can be compared and modified during the game. There are different type of variables ​in GDevelop. In particular each object can *define* variables. When the game is running, each *instance* of the object living on the scene will have its own variables. 
 + 
 +<note tip>For example, the object ​"BlueEnemy"​ can have a variable *Health* set to 100. During the game, there can be multiple instances of this blue enemy. **Each instance** will have its own Health variable, which is by default 100 and can vary independently from other variables.</​note>​ 
 + 
 +The table allows ​you to specify variables that are specific to the selected instance. For example, if you have objects representing boxes with gold on the scene, you can modify the variable named "​Gold"​ of each instance to set a different number. Then in the events, when the player collides with a box, you can read the variable value to add it to the player gold amount.
  
 ## Custom size ## Custom size
  
 You can change the size of your objects, by enabling the custom size in the properties panel, and then enter the custom *width* and *height* dimensions in pixels: You can change the size of your objects, by enabling the custom size in the properties panel, and then enter the custom *width* and *height* dimensions in pixels:
-{{ :​gdevelop5:​objects:​customsize-properties.png?nolink&​400 ​|}}+ 
 + 
 +{{ :​gdevelop5:​objects:​base_object:​pasted:​20200406-093137.png?nolink |}}
  
 # Object groups # Object groups
Line 102: Line 113:
  
 In the window that open to edit the group, click on the bottom field and choose an object (or type the name of an object) to add it to the group. ​ In the window that open to edit the group, click on the bottom field and choose an object (or type the name of an object) to add it to the group. ​
-{{ :​gdevelop5:​objects:​edit-group.png?nolink&​400 ​|}}+ 
 +{{ :​gdevelop5:​objects:​base_object:​pasted:​20200406-093739.png?nolink |}}
  
 # Variables # Variables
Line 125: Line 137:
 # Visibility # Visibility
  
-The visibility of the object ​is the property that allows it to be visible after its existence. The visibility of an object can be toggled on and off. If the object is not visible, ​it does not imply that the object does not existOn the contrary if the object ceases to existit directly implies that the object is not visibleIf the object ​exists, the object is visible ​and vice versa.+By default, ​object ​instances are all marked as visible, ​meaning ​that they are displayed on the screenUsing eventsyou can **hide** any instance during ​the gameAn hidden ​object ​instance won't be displayed anymorebut will still live on the scene (reacting to collisions, ​and following all other events as usual).
  
-If the object exists ​and its visibility ​is turned offall the actions ​and conditions will take place just like they would if the object would'​ve been visible.+<note tip>Some objects, like Sprite or Text objects, can also have an **opacity**. The opacity, between 0 and 255, defines how transparent an object ​is (0 being fully transparent255 is the fully opaque ​and is the default). This can be changed independently from the visibility.</​note>​
  
 # In the events editor # In the events editor
Line 133: Line 145:
 You can change and manipulate the properties of an instance of an object, or of multiple instances, using events during the game. This is even what game making is all about in GDevelop: to manipulate objects in real-time as we play the game. As the events and events editor are out of the scope of this page, refer to [[gdevelop5:​tutorials:​basic-game-making-concepts|the basic game making concepts]] page to get started. You can change and manipulate the properties of an instance of an object, or of multiple instances, using events during the game. This is even what game making is all about in GDevelop: to manipulate objects in real-time as we play the game. As the events and events editor are out of the scope of this page, refer to [[gdevelop5:​tutorials:​basic-game-making-concepts|the basic game making concepts]] page to get started.
  
-* All objects share the same common features (like position, angle and everything that is written on this page), and there are a lot of conditions and actions that you can use for all objects. +* All objects share the **same common features** (like position, angle and everything that is written on this page), and there are a lot of conditions and actions that you can use for all objects. ​You can [[gdevelop5:​objects:​base_object:​events|read more about the common conditions/​actions for all objects here.]] 
-* Objects can also provides you with specific feature. For example, [[gdevelop5:​objects:​sprite|Sprite objects]] can have animations, and the animation being played can be changed using an action.+* Objects can also provides you with specific feature. For example, [[gdevelop5:​objects:​sprite|Sprite objects]] can have animations, and the animation being played can be changed using an action. Find **more information in the [[gdevelop5:​objects|page of each specific object]]**.