Skip to content

Commit 1311257

Browse files
authored
Add a variant migration page (#296)
1 parent 2d65967 commit 1311257

File tree

9 files changed

+144
-0
lines changed

9 files changed

+144
-0
lines changed

docs/gdevelop5/objects/custom-objects-prefab-template/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,9 @@ The condition can be then used in the scene:
5555

5656

5757
By doing this for more complex needs, you can break down game menus or even gameplay objects (like a player character, complex obstacles, enemies, etc...) into custom object that can be edited independently. Your scene stays simple and only focused on the high level details of your game.
58+
59+
## Change the default size of a custom object
60+
61+
The grey rectangle on the scene is the custom object default size. Your can change this size by clicking on the button on the top right corner.
62+
63+
![](./object-scene-properties.png)
Loading
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
---
2+
title: Migrate custom objects to variants
3+
---
4+
# Migrate custom objects to variants
5+
6+
The migration to variants is recommended but not mandatory. You can keep using your current extension version the same way as before, but you won't get any new feature or bug fix for the custom objects.
7+
8+
!!! warning
9+
10+
Make sure to backup your project before migrating to variants.
11+
12+
13+
## Migrate custom objects from the asset-store
14+
15+
The assets of the store are now using variants. If your custom object comes from the asset-store, you only have to follow a few steps:
16+
17+
- Find back your assets in the store
18+
- Install them in your project
19+
- Accept the extension update
20+
- Choose the new variant on your objects
21+
22+
![](./variant-selector.png)
23+
24+
25+
## Migrate custom objects with your own assets
26+
27+
Custom object variants use a graphical editor to place the instances. Properties that once fit this role has been removed in the new extensions. It means that after the extension update the custom objects will look deformed. You can fix this by adjusting the instances positions inside the custom object with the graphical editor.
28+
29+
!!! note
30+
31+
A good way to start is to read the [custom objects](/gdevelop5/objects/custom-objects-prefab-template) page to learn about the general concepts.
32+
33+
The following sections give specific instructions for each custom object.
34+
35+
### Migrate buttons
36+
37+
After upgrading the button extension, you will notice that the label of all buttons disappeared.
38+
39+
- Copy and paste the text from **Initial text to display** to the **Label** property.
40+
41+
![](./button-properties.png)
42+
43+
- Apply the changes. The label came back but it's probably misaligned.
44+
- Go back in the object editor and duplicate the default variant by clicking on the **Duplicate** button below the **Variant** title.
45+
- Choose a name for your new button style.
46+
- To edit the new variant, click on the **Edit** button, close the dialog and select the new opened tab.
47+
48+
You should see something like this:
49+
50+
![](./button-children.png)
51+
52+
- Report your configuration on the **Object's children** on the left. For convenience, you may want to open your project backup in a second instance of GDevelop.
53+
- Adapt the [default size](/gdevelop5/objects/custom-objects-prefab-template#change-the-default-size-of-a-custom-object) to your image resources.
54+
55+
The **Top margin**, **Bottom margin**, **Right margin** and **Bottom margin** properties no longer exist. You can adjust the label position directly with the graphical editor.
56+
57+
For the other buttons in your project, you can choose the new variant you created and only copy the label value.
58+
59+
60+
### Migrate sliders
61+
62+
After upgrading the button extension, you will notice that the slider is deformed.
63+
64+
- Open the object editor and duplicate the default variant by clicking on the **Duplicate** button below the **Variant** title.
65+
- Choose a name for your new slider style.
66+
- To edit the new variant, click on the **Edit** button, close the dialog and select the new opened tab.
67+
68+
![](./variant-selector.png)
69+
70+
You should see something like this:
71+
72+
![](./slider-children.png)
73+
74+
- Report your configuration on the **Object's children** on the left. For convenience, you may want to open your project backup in a second instance of GDevelop.
75+
- Adapt the [default size](/gdevelop5/objects/custom-objects-prefab-template#change-the-default-size-of-a-custom-object) to your image resources.
76+
77+
The **Bar top margin**, **Bar bottom margin**, **Bar right margin** and **Bar bottom margin** properties no longer exist. You can adjust the bar position directly with the graphical editor.
78+
79+
For the other sliders in your project, you can choose the new variant you created, no additional change is required.
80+
81+
82+
### Migrate toggle switches
83+
84+
After upgrading the button extension, you will notice that the toggle switch is deformed.
85+
86+
- Open the object editor and duplicate the default variant by clicking on the **Duplicate** button below the **Variant** title.
87+
- Choose a name for your new toggle switch style.
88+
- To edit the new variant, click on the **Edit** button, close the dialog and select the new opened tab.
89+
- Report your configuration on the **Object's children** on the left. For convenience, you may want to open your project backup in a second instance of GDevelop.
90+
- Adapt the [default size](/gdevelop5/objects/custom-objects-prefab-template#change-the-default-size-of-a-custom-object) to your image resources.
91+
92+
![](./variant-selector.png)
93+
94+
For the other toggle switch in your project, you can choose the new variant you created, no additional change is required.
95+
96+
97+
### Migrate resource bars (continuous)
98+
99+
After upgrading the button extension, you will notice that the slider is deformed.
100+
101+
- Open the object editor and duplicate the default variant by clicking on the **Duplicate** button below the **Variant** title.
102+
- Choose a name for your new resource bar style.
103+
- To edit the new variant, click on the **Edit** button, close the dialog and select the new opened tab.
104+
105+
![](./variant-selector.png)
106+
107+
You should see something like this:
108+
109+
![](./resource-bar-continuous-children.png)
110+
111+
- Report your configuration on the **Object's children** on the left. For convenience, you may want to open your project backup in a second instance of GDevelop.
112+
- Adapt the [default size](/gdevelop5/objects/custom-objects-prefab-template#change-the-default-size-of-a-custom-object) to your image resources.
113+
114+
The **Bar top margin**, **Bar bottom margin**, **Bar right margin** and **Bar bottom margin** properties no longer exist. You can adjust the bar position directly with the graphical editor.
115+
116+
For the other resource bars in your project, you can choose the new variant you created, no additional change is required.
117+
118+
119+
### Migrate Resource bars (separated units)
120+
121+
After upgrading the button extension, you will notice that the slider is deformed.
122+
123+
- Open the object editor and duplicate the default variant by clicking on the **Duplicate** button below the **Variant** title.
124+
- Choose a name for your new resource bar style.
125+
- To edit the new variant, click on the **Edit** button, close the dialog and select the new opened tab.
126+
127+
![](./variant-selector.png)
128+
129+
You should see something like this:
130+
131+
![](./resource-bar-unit-children.png)
132+
133+
- Report your configuration on the **Object's children** on the left. For convenience, you may want to open your project backup in a second instance of GDevelop.
134+
- Adapt the [default size](/gdevelop5/objects/custom-objects-prefab-template#change-the-default-size-of-a-custom-object) to your image resources.
135+
136+
The **Bar right margin** and **Bar bottom margin** properties no longer exist. You can adjust the bar position directly with the graphical editor.
137+
138+
For the other resource bars in your project, you can choose the new variant you created, no additional change is required.
Loading

0 commit comments

Comments
 (0)