User Tools

Site Tools


en:tutorials:objects:command_hooks

Differences

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

Link to this comparison view

en:tutorials:objects:command_hooks [2021/08/10 01:01 (4 years ago)] – created sausageen:tutorials:objects:command_hooks [2021/08/26 03:29 (4 years ago)] (current) – Fix ups sausage
Line 21: Line 21:
 Compile and run the project to first check that the spinning logo is working. We can pretend that the logo is our game itself or a welcome scene for a game. Compile and run the project to first check that the spinning logo is working. We can pretend that the logo is our game itself or a welcome scene for a game.
  
-Remove the scene creation line from the ''Init()'' function: +Instead of displaying the spinning logo scene straight away, let's have a company credit object load first. In the config, let's create this company credit.
- +
-<code ini> +
-orxObject_CreateFromConfig("Scene"); +
-</code> +
- +
-Now we are left with a black screen for the moment. Instead of the spinning logo scene loading straight away, let's have a company credit object load first. In the config, let's create this company credit.+
  
 <code ini> <code ini>
Line 55: Line 49:
  
 In the above, we have a ''CompanyCredit'' object that is using some text as it's graphic. It's been scaled up to make it bigger, and an FX is attached that will fade out after 2 seconds. In the above, we have a ''CompanyCredit'' object that is using some text as it's graphic. It's been scaled up to make it bigger, and an FX is attached that will fade out after 2 seconds.
 +
 +To make this credit object appear, change the scene creation line from the ''Init()'' function:
 +
 +<code ini>
 +orxObject_CreateFromConfig("Scene");
 +</code>
 +
 +to become:
 +
 +<code ini>
 +orxObject_CreateFromConfig("CompanyCredit");
 +</code>
  
 Compile and run. The credit will appear and then fade out. Compile and run. The credit will appear and then fade out.
Line 62: Line 68:
 We want to create the ''Scene'' object after the ''CompanyCredit'' object is deleted.  We want to create the ''Scene'' object after the ''CompanyCredit'' object is deleted. 
  
-Let's do this in two steps. First, to delete the ''CompanyCredit'' object after the FX has finished:+Let's do this in two steps. First, to delete the ''CompanyCredit'' object (using the LifeTime property) after the FX has finished:
  
 <code ini> <code ini>
Line 89: Line 95:
 {{ :tutorials:objects:command_hooks:credits-title.png?nolink |}} {{ :tutorials:objects:command_hooks:credits-title.png?nolink |}}
 {{ :tutorials:objects:command_hooks:logo-title.png?nolink |}} {{ :tutorials:objects:command_hooks:logo-title.png?nolink |}}
 +
 +
  
 That it. Probably the easiest usage example, but also a very handy one for swapping between intro screens, slide shows, titles, all sort of similar things. That it. Probably the easiest usage example, but also a very handy one for swapping between intro screens, slide shows, titles, all sort of similar things.
en/tutorials/objects/command_hooks.1628582501.txt.gz · Last modified: 2021/08/10 01:01 (4 years ago) by sausage