/libs/cocos2d/CCGridAction.h

http://github.com/kstenerud/ObjectAL-for-iPhone · C Header · 169 lines · 66 code · 37 blank · 66 comment · 0 complexity · 9894aa3fd6ad0f45b4843f47cb084124 MD5 · raw file

  1. /*
  2. * cocos2d for iPhone: http://www.cocos2d-iphone.org
  3. *
  4. * Copyright (c) 2009 On-Core
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. * THE SOFTWARE.
  23. *
  24. */
  25. #import <UIKit/UIKit.h>
  26. #import "CCIntervalAction.h"
  27. #import "CCInstantAction.h"
  28. #import "CCGrid.h"
  29. @class CCGridBase;
  30. /** Base class for Grid actions */
  31. @interface CCGridAction : CCIntervalAction
  32. {
  33. ccGridSize gridSize;
  34. }
  35. /** size of the grid */
  36. @property (nonatomic,readwrite) ccGridSize gridSize;
  37. /** creates the action with size and duration */
  38. +(id) actionWithSize:(ccGridSize)size duration:(ccTime)d;
  39. /** initializes the action with size and duration */
  40. -(id) initWithSize:(ccGridSize)gridSize duration:(ccTime)d;
  41. /** returns the grid */
  42. -(CCGridBase *)grid;
  43. @end
  44. ////////////////////////////////////////////////////////////
  45. /** Base class for CCGrid3D actions.
  46. Grid3D actions can modify a non-tiled grid.
  47. */
  48. @interface CCGrid3DAction : CCGridAction
  49. {
  50. }
  51. /** returns the vertex than belongs to certain position in the grid */
  52. -(ccVertex3F)vertex:(ccGridSize)pos;
  53. /** returns the non-transformed vertex than belongs to certain position in the grid */
  54. -(ccVertex3F)originalVertex:(ccGridSize)pos;
  55. /** sets a new vertex to a certain position of the grid */
  56. -(void)setVertex:(ccGridSize)pos vertex:(ccVertex3F)vertex;
  57. @end
  58. ////////////////////////////////////////////////////////////
  59. /** Base class for CCTiledGrid3D actions */
  60. @interface CCTiledGrid3DAction : CCGridAction
  61. {
  62. }
  63. /** returns the tile that belongs to a certain position of the grid */
  64. -(ccQuad3)tile:(ccGridSize)pos;
  65. /** returns the non-transformed tile that belongs to a certain position of the grid */
  66. -(ccQuad3)originalTile:(ccGridSize)pos;
  67. /** sets a new tile to a certain position of the grid */
  68. -(void)setTile:(ccGridSize)pos coords:(ccQuad3)coords;
  69. @end
  70. ////////////////////////////////////////////////////////////
  71. /** CCAccelDeccelAmplitude action */
  72. @interface CCAccelDeccelAmplitude : CCIntervalAction
  73. {
  74. float rate;
  75. CCIntervalAction *other;
  76. }
  77. /** amplitude rate */
  78. @property (nonatomic,readwrite) float rate;
  79. /** creates the action with an inner action that has the amplitude property, and a duration time */
  80. +(id)actionWithAction:(CCAction*)action duration:(ccTime)d;
  81. /** initializes the action with an inner action that has the amplitude property, and a duration time */
  82. -(id)initWithAction:(CCAction*)action duration:(ccTime)d;
  83. @end
  84. ////////////////////////////////////////////////////////////
  85. /** CCAccelAmplitude action */
  86. @interface CCAccelAmplitude : CCIntervalAction
  87. {
  88. float rate;
  89. CCIntervalAction *other;
  90. }
  91. /** amplitude rate */
  92. @property (nonatomic,readwrite) float rate;
  93. /** creates the action with an inner action that has the amplitude property, and a duration time */
  94. +(id)actionWithAction:(CCAction*)action duration:(ccTime)d;
  95. /** initializes the action with an inner action that has the amplitude property, and a duration time */
  96. -(id)initWithAction:(CCAction*)action duration:(ccTime)d;
  97. @end
  98. ////////////////////////////////////////////////////////////
  99. /** CCDeccelAmplitude action */
  100. @interface CCDeccelAmplitude : CCIntervalAction
  101. {
  102. float rate;
  103. CCIntervalAction *other;
  104. }
  105. /** amplitude rate */
  106. @property (nonatomic,readwrite) float rate;
  107. /** creates the action with an inner action that has the amplitude property, and a duration time */
  108. +(id)actionWithAction:(CCAction*)action duration:(ccTime)d;
  109. /** initializes the action with an inner action that has the amplitude property, and a duration time */
  110. -(id)initWithAction:(CCAction*)action duration:(ccTime)d;
  111. @end
  112. ////////////////////////////////////////////////////////////
  113. /** CCStopGrid action.
  114. Don't call this action if another grid action is active.
  115. Call if you want to remove the the grid effect. Example:
  116. [Sequence actions:[Lens ...], [StopGrid action], nil];
  117. */
  118. @interface CCStopGrid : CCInstantAction
  119. {
  120. }
  121. @end
  122. ////////////////////////////////////////////////////////////
  123. /** CCReuseGrid action */
  124. @interface CCReuseGrid : CCInstantAction
  125. {
  126. int t;
  127. }
  128. /** creates an action with the number of times that the current grid will be reused */
  129. +(id) actionWithTimes: (int) times;
  130. /** initializes an action with the number of times that the current grid will be reused */
  131. -(id) initWithTimes: (int) times;
  132. @end