This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:orx:tutorials:frame [2009/08/15 02:12 (15 years ago)] – Links to en:orx:tutorials changed to en:orx:tutorials:main iarwain | en:tutorials:objects:frame [2022/12/06 13:38 (16 months ago)] (current) – iarwain | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
===== Summary ===== | ===== Summary ===== | ||
- | See previous | + | See previous basic tutorials for more info about [[object|basic object creation]] and [[..:clocks:clock|clock handling]]. |
All objects' | All objects' | ||
Line 9: | Line 9: | ||
In this tutorial, we have four objects that we link to a common parent ((an empty object, with no visual)) and a fifth one which has no parent.\\ | In this tutorial, we have four objects that we link to a common parent ((an empty object, with no visual)) and a fifth one which has no parent.\\ | ||
- | The first two children are implicitely | + | The first two children are implicitly |
The invisible parent object will follow the mouse cursor. Left shift and left control keys will respectively scale up and down the parent object, where as left and right clicks will apply a rotation to it.\\ | The invisible parent object will follow the mouse cursor. Left shift and left control keys will respectively scale up and down the parent object, where as left and right clicks will apply a rotation to it.\\ | ||
All these transformations will affect its four children. | All these transformations will affect its four children. | ||
Line 17: | Line 17: | ||
===== Details ===== | ===== Details ===== | ||
- | As with the [[main# | + | As with the previous tutorials, we begin by creating a viewport. |
- | <code c>orxConfig_Load(" | + | <code c> |
- | + | ||
- | orxViewport_CreateFromConfig(" | + | |
We then create our parent object. | We then create our parent object. | ||
Line 48: | Line 46: | ||
Please note that when we create and link manually objects in code, it's our responsability to delete them. On the contrary, '' | Please note that when we create and link manually objects in code, it's our responsability to delete them. On the contrary, '' | ||
- | We then create a 100Hz clock and register our '' | + | We then look for the main clock and register our '' |
- | <code c> | + | <code c> |
orxClock_Register(pstClock, | orxClock_Register(pstClock, | ||
Line 67: | Line 65: | ||
The only thing left to do is to apply scale and rotation according to our inputs.\\ | The only thing left to do is to apply scale and rotation according to our inputs.\\ | ||
- | In our case, we defined the following inputs in [[https://orx.svn.sourceforge.net/svnroot/orx/trunk/ | + | In our case, we defined the following inputs in [[https://github.com/orx/orx/blob/master/ |
Let's see how we handle them. First, the rotations. | Let's see how we handle them. First, the rotations. | ||
Line 95: | Line 93: | ||
//NB:// | //NB:// | ||
- | * //We could have used config values instead of constants for the rotation and scale values. This way, we could change them without having to recompile and even update them in real time by pressing// '' | + | * //We could have used config values instead of constants for the rotation and scale values. This way, we could change them without having to recompile and even update them in real time by using the interactive console.// |
* //As we use the clock' | * //As we use the clock' | ||
===== Resources ===== | ===== Resources ===== | ||
- | Source code: [[https://orx.svn.sourceforge.net/svnroot/orx/trunk/ | + | Source code: [[https://github.com/orx/orx/blob/master/ |
- | + | ||
- | Config file: [[https:// | + | |
+ | Config file: [[https:// |