CCScale9SpriteLoader.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /****************************************************************************
  2. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
  3. http://www.cocos2d-x.org
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18. THE SOFTWARE.
  19. ****************************************************************************/
  20. #ifndef _CCB_CCSCALE9SPRITELOADER_H_
  21. #define _CCB_CCSCALE9SPRITELOADER_H_
  22. #include "editor-support/cocosbuilder/CCNodeLoader.h"
  23. #include "editor-support/cocosbuilder/CCScale9SpriteLoader.h"
  24. #include "ui/UIScale9Sprite.h"
  25. namespace cocosbuilder {
  26. /* Forward declaration. */
  27. class CCBReader;
  28. class CC_DLL Scale9SpriteLoader : public NodeLoader {
  29. public:
  30. /**
  31. * @js NA
  32. * @lua NA
  33. */
  34. virtual ~Scale9SpriteLoader() {};
  35. /**
  36. * @js NA
  37. * @lua NA
  38. */
  39. CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(Scale9SpriteLoader, loader);
  40. protected:
  41. /**
  42. * @js NA
  43. * @lua NA
  44. */
  45. virtual cocos2d::ui::Scale9Sprite* createNode(cocos2d::Node* pParent, cocosbuilder::CCBReader* ccbReader);
  46. /**
  47. * @js NA
  48. * @lua NA
  49. */
  50. virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);
  51. /**
  52. * @js NA
  53. * @lua NA
  54. */
  55. virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);
  56. /**
  57. * @js NA
  58. * @lua NA
  59. */
  60. virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);
  61. /**
  62. * @js NA
  63. * @lua NA
  64. */
  65. virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader);
  66. /**
  67. * @js NA
  68. * @lua NA
  69. */
  70. virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader);
  71. /**
  72. * @js NA
  73. * @lua NA
  74. */
  75. virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader);
  76. };
  77. }
  78. #endif