This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:guides:beginners:platforms_and_texture_repeating [2019/02/19 03:53 (6 years ago)] – Fixed incorrect platform coordinates. Thanks to songproducer for reporting! sausage | en:guides:beginners:platforms_and_texture_repeating [2024/11/17 03:22 (5 months ago)] (current) – sausage | ||
---|---|---|---|
Line 23: | Line 23: | ||
And create it inside the Init() function with: | And create it inside the Init() function with: | ||
- | < | + | < |
+ | orxObject_CreateFromConfig(" | ||
orxObject_CreateFromConfig(" | orxObject_CreateFromConfig(" | ||
</ | </ | ||
Line 33: | Line 34: | ||
Great. Next, the platform needs to be stretched out so that it acts like a platform and not just a simple box. You can do this by changing the '' | Great. Next, the platform needs to be stretched out so that it acts like a platform and not just a simple box. You can do this by changing the '' | ||
- | < | + | < |
[PlatformObject] | [PlatformObject] | ||
Graphic | Graphic | ||
Line 50: | Line 51: | ||
We also need the Repeat property, so that the texture will repeat within the object: | We also need the Repeat property, so that the texture will repeat within the object: | ||
- | < | + | < |
[PlatformObject] | [PlatformObject] | ||
Graphic | Graphic | ||
Line 68: | Line 69: | ||
Let's move the platform to the bottom of the screen and extend it to the whole screen width: | Let's move the platform to the bottom of the screen and extend it to the whole screen width: | ||
- | < | + | < |
[PlatformObject] | [PlatformObject] | ||
Graphic | Graphic | ||
Line 78: | Line 79: | ||
We can use this as a template to create many platforms. But rather than create a few platforms in code, it would be much easier to create a single empty parent object with a few child objects under it. | We can use this as a template to create many platforms. But rather than create a few platforms in code, it would be much easier to create a single empty parent object with a few child objects under it. | ||
- | Start by making | + | Start by re-using |
- | < | + | < |
[Scene] | [Scene] | ||
ChildList = PlatformObject # MiddlePlatformObject # TopLeftPlatformObject # | ChildList = PlatformObject # MiddlePlatformObject # TopLeftPlatformObject # | ||
Line 113: | Line 114: | ||
Next change the code in the Init() function to create " | Next change the code in the Init() function to create " | ||
- | < | + | < |
+ | orxObject_CreateFromConfig(" | ||
orxObject_CreateFromConfig(" | orxObject_CreateFromConfig(" | ||
</ | </ |