User Tools

Site Tools


en:orx:config:settings_structure:orxanim

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
en:orx:config:settings_structure:orxanim [2017/12/06 18:40 (6 years ago)] sausageen:orx:config:settings_structure:orxanim [2018/02/13 20:46 (6 years ago)] – ↷ Links adapted because of a move operation iarwain
Line 1: Line 1:
 ===== orxANIMSET structure ===== ===== orxANIMSET structure =====
- 
-<WRAP center round box 60%> 
-This article is currently in progress. For the latest CreationTemplate, please refer to the bottom until this page is finished. 
-</WRAP> 
- 
- 
  
 ==== Summary ==== ==== Summary ====
Line 17: Line 11:
 KeepInCache = <Bool> KeepInCache = <Bool>
 StartAnim   = Animation StartAnim   = Animation
-Prefix      = <String> string;+Prefix      = <String> string
 Digits      = <Int> Digits      = <Int>
 Animation   = [String] # [Int] Animation   = [String] # [Int]
Line 25: Line 19:
 </code> </code>
  
-=== Animation ===+=== Animation and Animation<N> ===
  
-<code ini>[AnimationTemplate] +<code ini> 
-DefaultKeyDuration <float> +[AnimationTemplate] 
-KeyData<N        = GraphicTemplate +Texture path/to/ImageFile.ext 
-KeyDuration<N>     = <float+TextureOrigin = <Vector
-KeyEventName<N>    = <string+TextureSize = <Vector
-KeyEventValue<N>   = <float></code>+Direction = left|right|down|up # left|right|down|up 
 +FrameSize = <Vector
 +KeyDuration = <Float>
  
-=== Animation link ===+[AnimationTemplate<N>] ; eg: AnimationTemplate0003 
 +KeyEvent [String] # <Float> 
 +TextureOrigin <Vector> 
 +TextureSize <Vector> 
 +KeyDuration <Float> 
 + 
 +</code>
  
-<code ini>[LinkTemplate] 
-Source      = SourceAnimationTemplate 
-Destination = DestinationAnimationTemplate 
-Priority    = <int> 
-Property    = immediate | cleartarget</code> 
  
  
Line 47: Line 44:
 === Animation set === === Animation set ===
  
-This ''AnimationSet'' section will become the parent of any ''Animation'' section used by it. So they will become common properties to all the animations or animation frames, properties such as ''FrameSize'', ''Texture'', ''KeyDuration'' or ''Direction'' can be defined here;+<WRAP center round box 90%> 
 +This ''AnimationSet'' section will become the parent of any ''Animation'' section used by it. So they will become common properties to all the animations or animation frames. Properties such as ''FrameSize'', ''Texture'', ''KeyDuration'' or ''Direction'' can be defined here
 +</WRAP> 
  
 Here's a list of the available properties for an animation set: Here's a list of the available properties for an animation set:
Line 60: Line 60:
  
 === Animation === === Animation ===
 +
 +<WRAP center round box 90%>
 +NB: Do not use manual inheritance at the section level as it will be overridden at runtime; it's parent will then become the animation set section.
 +</WRAP>
  
 Here's a list of the available properties for an animation: Here's a list of the available properties for an animation:
-  * ''DefaultKeyDuration'': Default duration for all defined keys, in seconds. This duration can be overridden locally for any defined key. By default its value is 0.0 and needs to be defines unless every key has a local value+  * ''Texture'': path/to/ImageFile.ext 
-  * ''KeyData<N>'': All the keys needs to be defined sequencially, starting with the ''KeyData1''No gap is allowed in the numbersFor every keythe value is the [[orxGRAPHIC]] that will be rendered when the animation cursor points on this keywhen played. At least one key (''KeyData1'') needs to be defined+  * ''TextureOrigin'': Defines the origin of the texture from which to get the framesDefaults to top left corner, ie(000) 
-  * ''KeyDuration<N>'': For any key defined (with ''KeyData<N>''), a duration, in seconds, can be specifiedIf none is defined, the ''DefaultKeyDuration'' will be used instead+  * ''TextureSize'': Defines the size of the texture from which to get the framesDefaults to the actual physical size of the texture 
-  * ''KeyEventName<N>'': Custom events can be associated to keys in animations. They allow to synchronize with specific part of animations. +  * ''Direction'': Defines how the frames are read inside the textureFirst value defines the direction of the rowssecond one the direction of the columnsDefaults to right # down (ie. western writing direction). Examples: left|right|down|up # left|right|down|up 
-  * ''KeyEventValue<N>'': Optional value for an event. By default its value is 0.0.+  * ''FrameSize'': Default size of all the frames of this animation 
 +  * ''KeyDuration'': Default key duration for all the frames of this animation
  
-Example: 
  
-<code ini>[MyAnimation] +=== Animation<N> ===
-DefaultKeyDuration 0.1 +
-KeyData1           MyGraphic1 +
-KeyData2           MyGraphic2 +
-KeyDuration2       = 0.2; <= this key will be displayed twice the time of the other keys +
-KeyData3           MyGraphic1; <Reusing the same content as for the first key +
-... +
-KeyEventName1      = SetSoundVolume +
-KeyEventValue1     = 1.0 +
-KeyEventName2      = SetSoundVolume +
-KeyEventValue2     = 0.0 +
-KeyEventName3      = Explode +
-... +
-</code>+
  
-=== Animation link ===+For example: Animation0004 or Animation0005 etc
  
-Here's a list of the available properties for an animation link: +<WRAP center round box 90%> 
-  * ''Source/Destination''Defines the source and destination animations for the link, ie. the start and end of a possible transition. These properties //need// to be defined. +NBDo not use manual inheritance at the section level as it will be overridden at runtime: its parent will then become the animation section. 
-  * ''Priority''Defines the priority of this link, rangin from 0 (lowest) to 15 (highest). Priorities are mostly used to define default transitions when no target animation is specified for the current object. By default its value is 8 which means a medium priority. +</WRAP>
-  * ''Property'': Defines the property of the link, it can either be ''immediate'', ''cleartarget''. If a link is ''immediate'' it means the transition will occur immediately instead of waiting for the end of the source animation before taking placeIf a link is ''cleartarget'' it means that it will reset object's current target animation when the link is used. By default none of these properties are defined, which means the transition will occur //after// the source animation has been completely played and won't reset object's current target.+
  
-Example+Here's a list of the available properties for an animation frame override
-<code ini>[LinkSitAnimLoop] +  * ''KeyEvent'': Optional. Defines a custom event that will be sent when this key is played. The first value is the event's namethe second one, the event's numerical value, which is optional and defaults to 0.0. 
-Source      = SitAnim +  * ''TextureOrigin'': Optional. Overrides the computed origin of the frame. Only define it for manual override. 
-Destination = SitAnim +  * ''TextureSize'': Optional. Overrides the default size of the frame (the FrameSize attribute in the animation/Animation Set). Only define it for manual override. 
-Priority    = 15; <= this is our transition of choice if no target anim is requestedwe just cycle here for ever =)+  * ''KeyDuration'': Optional. Overrides the default key duration of the frame. 
 +  * //Any other Graphic property like Pivot or Flip can be used here.//
  
-[LinkSitToStandUp] +Examples:
-Source      = SitAnim +
-Destination = StandUpAnim +
-Property    = immediate; <= that means we won't wait for the end of the SitAnim cycle before going to StandUpAnim+
  
-[LinkStandUpToRun] +See: [[en:tutorials:animation_walkthrough|Animation Walk-through]].
-Source      = StandUpAnim +
-Destination = RunAnim</code>+
  
-Now in the code, if we're currently playing the ''SitAnim'' and we issue 
  
-<code c>orxObject_SetTargetAnim(MyHero, "RunAnim");</code>+===== General things to note on the Animation System =====
  
-MyHero will first play immediately the ''StandUpAnim'' and then go to the ''RunAnim'' without you having to wait for any animation message or anything. You can listen to the ''orxEVENT_TYPE_ANIM'' events if you still want to be notified when transitions occur.+You can listen to the ''orxEVENT_TYPE_ANIM'' events if you still want to be notified when transitions occur.
  
 Between two animations, the calculated path will take the highest priority links at each step and if two links with the same priority are found, it will then take the one that leads to the shortest path (ie. the least amount of links needed to reach destination). Between two animations, the calculated path will take the highest priority links at each step and if two links with the same priority are found, it will then take the one that leads to the shortest path (ie. the least amount of links needed to reach destination).
en/orx/config/settings_structure/orxanim.txt · Last modified: 2023/09/19 23:35 (6 months ago) by sausage