mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into v3
This commit is contained in:
commit
f2647e56e4
|
@ -50,6 +50,7 @@
|
|||
15AECE0F195C1FDD00907DB0 /* cocosvideo.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */; };
|
||||
15AECE25195D467D00907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; };
|
||||
15B0870D195AD52000D6F62B /* ActionTimeline in Resources */ = {isa = PBXBuildFile; fileRef = 38FA2E75194AECF800FF2BE4 /* ActionTimeline */; };
|
||||
15B13E5219F0FD4D008A1ADC /* Manifests in Resources */ = {isa = PBXBuildFile; fileRef = 15B3709219EE5D1000ABE682 /* Manifests */; };
|
||||
15B3709319EE5D1000ABE682 /* Manifests in Resources */ = {isa = PBXBuildFile; fileRef = 15B3709219EE5D1000ABE682 /* Manifests */; };
|
||||
15B3709419EE5D1000ABE682 /* Manifests in Resources */ = {isa = PBXBuildFile; fileRef = 15B3709219EE5D1000ABE682 /* Manifests */; };
|
||||
15B3709819EE5DBA00ABE682 /* AssetsManagerExTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15B3709619EE5DBA00ABE682 /* AssetsManagerExTest.cpp */; };
|
||||
|
@ -7377,6 +7378,7 @@
|
|||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
15B13E5219F0FD4D008A1ADC /* Manifests in Resources */,
|
||||
156EAE071977D0BD00F53709 /* ActionTimeline in Resources */,
|
||||
15E66FD6192DC8C700C20A52 /* Sprite3DTest in Resources */,
|
||||
3E2F27BC19D00D7200E7C490 /* audio in Resources */,
|
||||
|
|
|
@ -573,7 +573,7 @@ Bone *Armature::getParentBone() const
|
|||
|
||||
#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT
|
||||
|
||||
void CCArmature::setColliderFilter(ColliderFilter *filter)
|
||||
void Armature::setColliderFilter(ColliderFilter *filter)
|
||||
{
|
||||
for (auto& element : _boneDic)
|
||||
{
|
||||
|
@ -582,7 +582,7 @@ void CCArmature::setColliderFilter(ColliderFilter *filter)
|
|||
}
|
||||
#elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX
|
||||
|
||||
void CCArmature::drawContour()
|
||||
void Armature::drawContour()
|
||||
{
|
||||
for(auto& element : _boneDic)
|
||||
{
|
||||
|
@ -607,8 +607,22 @@ void CCArmature::drawContour()
|
|||
points[i].x = p.x;
|
||||
points[i].y = p.y;
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif _MSC_VER >= 1400 //vs 2005 or higher
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable: 4996)
|
||||
#endif
|
||||
|
||||
DrawPrimitives::drawPoly( points, (unsigned int)length, true );
|
||||
|
||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
||||
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
|
||||
#elif _MSC_VER >= 1400 //vs 2005 or higher
|
||||
#pragma warning (pop)
|
||||
#endif
|
||||
|
||||
delete []points;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@ public:
|
|||
#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT
|
||||
virtual void setColliderFilter(ColliderFilter *filter);
|
||||
#elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX
|
||||
virtual void drawContour();
|
||||
CC_DEPRECATED_ATTRIBUTE virtual void drawContour();
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
-- @param self
|
||||
-- @param #float duration
|
||||
-- @param #ccs.ActionFrame srcFrame
|
||||
-- @return ActionInterval#ActionInterval ret (retunr value: cc.ActionInterval)
|
||||
-- @return ActionInterval#ActionInterval ret (return value: cc.ActionInterval)
|
||||
|
||||
--------------------------------
|
||||
-- Gets the type of action frame<br>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
-- @param #char jsonName
|
||||
-- @param #char actionName
|
||||
-- @param #cc.CallFunc func
|
||||
-- @return ActionObject#ActionObject ret (retunr value: ccs.ActionObject)
|
||||
-- @return ActionObject#ActionObject ret (return value: ccs.ActionObject)
|
||||
|
||||
--------------------------------
|
||||
-- Gets an ActionObject with a name.<br>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
-- @param self
|
||||
-- @param #float duration
|
||||
-- @param #ccs.ActionFrame srcFrame
|
||||
-- @return ActionInterval#ActionInterval ret (retunr value: cc.ActionInterval)
|
||||
-- @return ActionInterval#ActionInterval ret (return value: cc.ActionInterval)
|
||||
|
||||
--------------------------------
|
||||
-- Gets the rotate action rotation.<br>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#Animate] getAnimation
|
||||
-- @param self
|
||||
-- @return Animation#Animation ret (retunr value: cc.Animation)
|
||||
-- @return Animation#Animation ret (return value: cc.Animation)
|
||||
|
||||
--------------------------------
|
||||
-- sets the Animation object to be animated
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
-- @param #cc.Animation3D animation
|
||||
-- @param #float fromTime
|
||||
-- @param #float duration
|
||||
-- @return Animate3D#Animate3D ret (retunr value: cc.Animate3D)
|
||||
-- @return Animate3D#Animate3D ret (return value: cc.Animate3D)
|
||||
|
||||
--------------------------------
|
||||
-- animate transistion time
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
-- @param #array_table arrayOfAnimationFrameNames
|
||||
-- @param #float delayPerUnit
|
||||
-- @param #unsigned int loops
|
||||
-- @return Animation#Animation ret (retunr value: cc.Animation)
|
||||
-- @return Animation#Animation ret (return value: cc.Animation)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#AnimationFrame] getUserInfo
|
||||
-- @param self
|
||||
-- @return map_table#map_table ret (retunr value: map_table)
|
||||
-- @return map_table#map_table ret (return value: map_table)
|
||||
|
||||
--------------------------------
|
||||
-- Sets the units of time the frame takes
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
-- @param self
|
||||
-- @param #string name
|
||||
-- @param #ccs.Bone parentBone
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -154,7 +154,7 @@
|
|||
-- @param self
|
||||
-- @param #string name
|
||||
-- @param #ccs.Bone parentBone
|
||||
-- @return Armature#Armature ret (retunr value: ccs.Armature)
|
||||
-- @return Armature#Armature ret (return value: ccs.Armature)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -181,6 +181,6 @@
|
|||
-- @function [parent=#AudioEngine] getProfile
|
||||
-- @param self
|
||||
-- @param #int audioID
|
||||
-- @return experimental::AudioProfile#experimental::AudioProfile ret (retunr value: cc.experimental::AudioProfile)
|
||||
-- @return experimental::AudioProfile#experimental::AudioProfile ret (return value: cc.experimental::AudioProfile)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
-- @param #string filename
|
||||
-- @param #rect_table rect
|
||||
-- @param #int mode
|
||||
-- @return BillBoard#BillBoard ret (retunr value: cc.BillBoard)
|
||||
-- @return BillBoard#BillBoard ret (return value: cc.BillBoard)
|
||||
|
||||
--------------------------------
|
||||
-- Creates a BillBoard with a Texture2D object.<br>
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
-- @function [parent=#Bone] init
|
||||
-- @param self
|
||||
-- @param #string name
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- Set parent bone.<br>
|
||||
|
@ -209,7 +209,7 @@
|
|||
-- @function [parent=#Bone] create
|
||||
-- @param self
|
||||
-- @param #string name
|
||||
-- @return Bone#Bone ret (retunr value: ccs.Bone)
|
||||
-- @return Bone#Bone ret (return value: ccs.Bone)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -189,7 +189,7 @@
|
|||
-- @param #string selectedImage
|
||||
-- @param #string disableImage
|
||||
-- @param #int texType
|
||||
-- @return Button#Button ret (retunr value: ccui.Button)
|
||||
-- @return Button#Button ret (return value: ccui.Button)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
-- @param #string backGroundDisabled
|
||||
-- @param #string frontCrossDisabled
|
||||
-- @param #int texType
|
||||
-- @return CheckBox#CheckBox ret (retunr value: ccui.CheckBox)
|
||||
-- @return CheckBox#CheckBox ret (return value: ccui.CheckBox)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
-- @function [parent=#ClippingNode] create
|
||||
-- @param self
|
||||
-- @param #cc.Node stencil
|
||||
-- @return ClippingNode#ClippingNode ret (retunr value: cc.ClippingNode)
|
||||
-- @return ClippingNode#ClippingNode ret (return value: cc.ClippingNode)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
-- @function [parent=#ClippingRectangleNode] create
|
||||
-- @param self
|
||||
-- @param #rect_table clippingRegion
|
||||
-- @return ClippingRectangleNode#ClippingRectangleNode ret (retunr value: cc.ClippingRectangleNode)
|
||||
-- @return ClippingRectangleNode#ClippingRectangleNode ret (return value: cc.ClippingRectangleNode)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
-- @param self
|
||||
-- @param #char pszFilePath
|
||||
-- @param #bool bLoop
|
||||
-- @return unsigned int#unsigned int ret (retunr value: unsigned int)
|
||||
-- @return unsigned int#unsigned int ret (return value: unsigned int)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
-- @param self
|
||||
-- @param #cc.Node node
|
||||
-- @param #char comName
|
||||
-- @return ComRender#ComRender ret (retunr value: ccs.ComRender)
|
||||
-- @return ComRender#ComRender ret (return value: ccs.ComRender)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#ControlButton] getCurrentTitle
|
||||
-- @param self
|
||||
-- @return string#string ret (retunr value: string)
|
||||
-- @return string#string ret (return value: string)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -297,7 +297,7 @@
|
|||
-- @param #string title
|
||||
-- @param #string fontName
|
||||
-- @param #float fontSize
|
||||
-- @return ControlButton#ControlButton ret (retunr value: cc.ControlButton)
|
||||
-- @return ControlButton#ControlButton ret (return value: cc.ControlButton)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
-- @param #cc.Sprite progressSprite
|
||||
-- @param #cc.Sprite thumbSprite
|
||||
-- @param #cc.Sprite selectedThumbSprite
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -159,7 +159,7 @@
|
|||
-- @param #cc.Sprite pogressSprite
|
||||
-- @param #cc.Sprite thumbSprite
|
||||
-- @param #cc.Sprite selectedThumbSprite
|
||||
-- @return ControlSlider#ControlSlider ret (retunr value: cc.ControlSlider)
|
||||
-- @return ControlSlider#ControlSlider ret (return value: cc.ControlSlider)
|
||||
|
||||
--------------------------------
|
||||
-- js ctor
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
-- @param #cc.Sprite thumbSprite
|
||||
-- @param #cc.Label onLabel
|
||||
-- @param #cc.Label offLabel
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -61,7 +61,7 @@
|
|||
-- @param #cc.Sprite thumbSprite
|
||||
-- @param #cc.Label onLabel
|
||||
-- @param #cc.Label offLabel
|
||||
-- @return ControlSwitch#ControlSwitch ret (retunr value: cc.ControlSwitch)
|
||||
-- @return ControlSwitch#ControlSwitch ret (return value: cc.ControlSwitch)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
-- @param self
|
||||
-- @param #float x
|
||||
-- @param #float y
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- Change display by index. You can just use this method to change display in the display list.<br>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
-- @param self
|
||||
-- @param #cc.ActionInterval action
|
||||
-- @param #float period
|
||||
-- @return EaseElasticIn#EaseElasticIn ret (retunr value: cc.EaseElasticIn)
|
||||
-- @return EaseElasticIn#EaseElasticIn ret (return value: cc.EaseElasticIn)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
-- @param self
|
||||
-- @param #cc.ActionInterval action
|
||||
-- @param #float period
|
||||
-- @return EaseElasticInOut#EaseElasticInOut ret (retunr value: cc.EaseElasticInOut)
|
||||
-- @return EaseElasticInOut#EaseElasticInOut ret (return value: cc.EaseElasticInOut)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
-- @param self
|
||||
-- @param #cc.ActionInterval action
|
||||
-- @param #float period
|
||||
-- @return EaseElasticOut#EaseElasticOut ret (retunr value: cc.EaseElasticOut)
|
||||
-- @return EaseElasticOut#EaseElasticOut ret (return value: cc.EaseElasticOut)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -159,7 +159,7 @@
|
|||
-- @param #size_table size
|
||||
-- @param #string pNormal9SpriteBg
|
||||
-- @param #int texType
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- Set a text in the edit box that acts as a placeholder when an<br>
|
||||
|
@ -224,7 +224,7 @@
|
|||
-- @param #ccui.Scale9Sprite normalSprite
|
||||
-- @param #ccui.Scale9Sprite pressedSprite
|
||||
-- @param #ccui.Scale9Sprite disabledSprite
|
||||
-- @return EditBox#EditBox ret (retunr value: ccui.EditBox)
|
||||
-- @return EditBox#EditBox ret (return value: ccui.EditBox)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
-- @param #size_table gridSize
|
||||
-- @param #cc.Texture2D texture
|
||||
-- @param #bool flipped
|
||||
-- @return Grid3D#Grid3D ret (retunr value: cc.Grid3D)
|
||||
-- @return Grid3D#Grid3D ret (return value: cc.Grid3D)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
-- @param #size_table gridSize
|
||||
-- @param #cc.Texture2D texture
|
||||
-- @param #bool flipped
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -123,6 +123,6 @@
|
|||
-- @param #size_table gridSize
|
||||
-- @param #cc.Texture2D texture
|
||||
-- @param #bool flipped
|
||||
-- @return GridBase#GridBase ret (retunr value: cc.GridBase)
|
||||
-- @return GridBase#GridBase ret (return value: cc.GridBase)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
-- @function [parent=#HBox] create
|
||||
-- @param self
|
||||
-- @param #size_table size
|
||||
-- @return HBox#HBox ret (retunr value: ccui.HBox)
|
||||
-- @return HBox#HBox ret (return value: ccui.HBox)
|
||||
|
||||
--------------------------------
|
||||
-- Default constructor
|
||||
|
|
|
@ -18,20 +18,9 @@
|
|||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Helper] doLayout
|
||||
-- @function [parent=#Helper] changeLayoutSystemActiveState
|
||||
-- @param self
|
||||
-- @param #cc.Node rootNode
|
||||
|
||||
--------------------------------
|
||||
-- Finds a widget whose tag equals to param tag from root widget.<br>
|
||||
-- param root widget which will be seeked.<br>
|
||||
-- tag tag value.<br>
|
||||
-- return finded result.
|
||||
-- @function [parent=#Helper] seekWidgetByTag
|
||||
-- @param self
|
||||
-- @param #ccui.Widget root
|
||||
-- @param #int tag
|
||||
-- @return Widget#Widget ret (return value: ccui.Widget)
|
||||
-- @param #bool bActive
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -52,4 +41,21 @@
|
|||
-- @param #string name
|
||||
-- @return Widget#Widget ret (return value: ccui.Widget)
|
||||
|
||||
--------------------------------
|
||||
-- Finds a widget whose tag equals to param tag from root widget.<br>
|
||||
-- param root widget which will be seeked.<br>
|
||||
-- tag tag value.<br>
|
||||
-- return finded result.
|
||||
-- @function [parent=#Helper] seekWidgetByTag
|
||||
-- @param self
|
||||
-- @param #ccui.Widget root
|
||||
-- @param #int tag
|
||||
-- @return Widget#Widget ret (return value: ccui.Widget)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Helper] doLayout
|
||||
-- @param self
|
||||
-- @param #cc.Node rootNode
|
||||
|
||||
return nil
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
-- @param self
|
||||
-- @param #string imageFileName
|
||||
-- @param #int texType
|
||||
-- @return ImageView#ImageView ret (retunr value: ccui.ImageView)
|
||||
-- @return ImageView#ImageView ret (return value: ccui.ImageView)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -170,7 +170,7 @@
|
|||
-- @param #int itemWidth
|
||||
-- @param #int itemHeight
|
||||
-- @param #int startCharMap
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -324,7 +324,7 @@
|
|||
-- @param #int itemWidth
|
||||
-- @param #int itemHeight
|
||||
-- @param #int startCharMap
|
||||
-- @return Label#Label ret (retunr value: cc.Label)
|
||||
-- @return Label#Label ret (return value: cc.Label)
|
||||
|
||||
--------------------------------
|
||||
-- Creates a label with an initial string,font[font name or font file],font size, dimension in points, horizontal alignment and vertical alignment.<br>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
-- @param #int itemWidth
|
||||
-- @param #int itemHeight
|
||||
-- @param #int startCharMap
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -45,7 +45,7 @@
|
|||
-- @param #int itemWidth
|
||||
-- @param #int itemHeight
|
||||
-- @param #int startCharMap
|
||||
-- @return LabelAtlas#LabelAtlas ret (retunr value: cc.LabelAtlas)
|
||||
-- @return LabelAtlas#LabelAtlas ret (return value: cc.LabelAtlas)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
-- @param #color4b_table color
|
||||
-- @param #float width
|
||||
-- @param #float height
|
||||
-- @return LayerColor#LayerColor ret (retunr value: cc.LayerColor)
|
||||
-- @return LayerColor#LayerColor ret (return value: cc.LayerColor)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
-- @param #color4b_table start
|
||||
-- @param #color4b_table end
|
||||
-- @param #vec2_table v
|
||||
-- @return LayerGradient#LayerGradient ret (retunr value: cc.LayerGradient)
|
||||
-- @return LayerGradient#LayerGradient ret (return value: cc.LayerGradient)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
-- @param self
|
||||
-- @param #string textureName
|
||||
-- @param #float percentage
|
||||
-- @return LoadingBar#LoadingBar ret (retunr value: ccui.LoadingBar)
|
||||
-- @return LoadingBar#LoadingBar ret (return value: ccui.LoadingBar)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
-- @param #float stroke
|
||||
-- @param #color3b_table color
|
||||
-- @param #string path
|
||||
-- @return MotionStreak#MotionStreak ret (retunr value: cc.MotionStreak)
|
||||
-- @return MotionStreak#MotionStreak ret (return value: cc.MotionStreak)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
-- @function [parent=#Node] removeComponent
|
||||
-- @param self
|
||||
-- @param #string name
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- set the PhysicsBody that let the sprite effect with physics<br>
|
||||
|
@ -68,7 +68,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#Node] getChildren
|
||||
-- @param self
|
||||
-- @return array_table#array_table ret (retunr value: array_table)
|
||||
-- @return array_table#array_table ret (return value: array_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -643,7 +643,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#Node] getScheduler
|
||||
-- @param self
|
||||
-- @return Scheduler#Scheduler ret (retunr value: cc.Scheduler)
|
||||
-- @return Scheduler#Scheduler ret (return value: cc.Scheduler)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -686,7 +686,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#Node] getParent
|
||||
-- @param self
|
||||
-- @return Node#Node ret (retunr value: cc.Node)
|
||||
-- @return Node#Node ret (return value: cc.Node)
|
||||
|
||||
--------------------------------
|
||||
-- Gets position Z coordinate of this node.<br>
|
||||
|
@ -1038,7 +1038,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#Node] getActionManager
|
||||
-- @param self
|
||||
-- @return ActionManager#ActionManager ret (retunr value: cc.ActionManager)
|
||||
-- @return ActionManager#ActionManager ret (return value: cc.ActionManager)
|
||||
|
||||
--------------------------------
|
||||
-- Allocates and initializes a node.<br>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#NodeGrid] getGrid
|
||||
-- @param self
|
||||
-- @return GridBase#GridBase ret (retunr value: cc.GridBase)
|
||||
-- @return GridBase#GridBase ret (return value: cc.GridBase)
|
||||
|
||||
--------------------------------
|
||||
-- Changes a grid object that is used when applying effects<br>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
-- @function [parent=#ParticleSystemQuad] create
|
||||
-- @param self
|
||||
-- @param #map_table dictionary
|
||||
-- @return ParticleSystemQuad#ParticleSystemQuad ret (retunr value: cc.ParticleSystemQuad)
|
||||
-- @return ParticleSystemQuad#ParticleSystemQuad ret (return value: cc.ParticleSystemQuad)
|
||||
|
||||
--------------------------------
|
||||
-- creates a Particle Emitter with a number of particles
|
||||
|
|
|
@ -435,7 +435,7 @@
|
|||
-- @param self
|
||||
-- @param #float mass
|
||||
-- @param #float moment
|
||||
-- @return PhysicsBody#PhysicsBody ret (retunr value: cc.PhysicsBody)
|
||||
-- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody)
|
||||
|
||||
--------------------------------
|
||||
-- Create a body contains a EdgeBox shape.
|
||||
|
|
|
@ -63,6 +63,6 @@
|
|||
-- @param #vec2_table anchr2
|
||||
-- @param #float min
|
||||
-- @param #float max
|
||||
-- @return PhysicsJointLimit#PhysicsJointLimit ret (retunr value: cc.PhysicsJointLimit)
|
||||
-- @return PhysicsJointLimit#PhysicsJointLimit ret (return value: cc.PhysicsJointLimit)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -37,6 +37,6 @@
|
|||
-- @param #cc.PhysicsBody b
|
||||
-- @param #float min
|
||||
-- @param #float max
|
||||
-- @return PhysicsJointRotaryLimit#PhysicsJointRotaryLimit ret (retunr value: cc.PhysicsJointRotaryLimit)
|
||||
-- @return PhysicsJointRotaryLimit#PhysicsJointRotaryLimit ret (return value: cc.PhysicsJointRotaryLimit)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
-- @function [parent=#RelativeBox] create
|
||||
-- @param self
|
||||
-- @param #size_table size
|
||||
-- @return RelativeBox#RelativeBox ret (retunr value: ccui.RelativeBox)
|
||||
-- @return RelativeBox#RelativeBox ret (return value: ccui.RelativeBox)
|
||||
|
||||
--------------------------------
|
||||
-- Default constructor
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
-- @param #int format
|
||||
-- @param #bool isRGBA
|
||||
-- @param #function callback
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -166,7 +166,7 @@
|
|||
-- @param #int h
|
||||
-- @param #int format
|
||||
-- @param #unsigned int depthStencilFormat
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- @overload self, int, int, int
|
||||
|
@ -178,7 +178,7 @@
|
|||
-- @param #int h
|
||||
-- @param #int format
|
||||
-- @param #unsigned int depthStencilFormat
|
||||
-- @return RenderTexture#RenderTexture ret (retunr value: cc.RenderTexture)
|
||||
-- @return RenderTexture#RenderTexture ret (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
-- @param #float duration
|
||||
-- @param #float deltaAngleZ_X
|
||||
-- @param #float deltaAngleZ_Y
|
||||
-- @return RotateBy#RotateBy ret (retunr value: cc.RotateBy)
|
||||
-- @return RotateBy#RotateBy ret (return value: cc.RotateBy)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
-- @param #float duration
|
||||
-- @param #float dstAngleX
|
||||
-- @param #float dstAngleY
|
||||
-- @return RotateTo#RotateTo ret (retunr value: cc.RotateTo)
|
||||
-- @return RotateTo#RotateTo ret (return value: cc.RotateTo)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
-- @param #vec2_table offset
|
||||
-- @param #size_table originalSize
|
||||
-- @param #rect_table capInsets
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- Returns the flag which indicates whether the widget is flipped horizontally or not.<br>
|
||||
|
@ -71,7 +71,7 @@
|
|||
-- @param self
|
||||
-- @param #string spriteFrameName
|
||||
-- @param #rect_table capInsets
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -98,7 +98,7 @@
|
|||
-- @param #vec2_table offset
|
||||
-- @param #size_table originalSize
|
||||
-- @param #rect_table capInsets
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -164,7 +164,7 @@
|
|||
-- @param #string file
|
||||
-- @param #rect_table rect
|
||||
-- @param #rect_table capInsets
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -185,7 +185,7 @@
|
|||
-- @param self
|
||||
-- @param #cc.SpriteFrame spriteFrame
|
||||
-- @param #rect_table capInsets
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -233,7 +233,7 @@
|
|||
-- @param #string file
|
||||
-- @param #rect_table rect
|
||||
-- @param #rect_table capInsets
|
||||
-- @return Scale9Sprite#Scale9Sprite ret (retunr value: ccui.Scale9Sprite)
|
||||
-- @return Scale9Sprite#Scale9Sprite ret (return value: ccui.Scale9Sprite)
|
||||
|
||||
--------------------------------
|
||||
-- @overload self, string, rect_table
|
||||
|
@ -242,7 +242,7 @@
|
|||
-- @param self
|
||||
-- @param #string spriteFrameName
|
||||
-- @param #rect_table capInsets
|
||||
-- @return Scale9Sprite#Scale9Sprite ret (retunr value: ccui.Scale9Sprite)
|
||||
-- @return Scale9Sprite#Scale9Sprite ret (return value: ccui.Scale9Sprite)
|
||||
|
||||
--------------------------------
|
||||
-- @overload self, cc.SpriteFrame, rect_table
|
||||
|
@ -251,7 +251,7 @@
|
|||
-- @param self
|
||||
-- @param #cc.SpriteFrame spriteFrame
|
||||
-- @param #rect_table capInsets
|
||||
-- @return Scale9Sprite#Scale9Sprite ret (retunr value: ccui.Scale9Sprite)
|
||||
-- @return Scale9Sprite#Scale9Sprite ret (return value: ccui.Scale9Sprite)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
-- @param #float sx
|
||||
-- @param #float sy
|
||||
-- @param #float sz
|
||||
-- @return ScaleBy#ScaleBy ret (retunr value: cc.ScaleBy)
|
||||
-- @return ScaleBy#ScaleBy ret (return value: cc.ScaleBy)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
-- @param #float sx
|
||||
-- @param #float sy
|
||||
-- @param #float sz
|
||||
-- @return ScaleTo#ScaleTo ret (retunr value: cc.ScaleTo)
|
||||
-- @return ScaleTo#ScaleTo ret (return value: cc.ScaleTo)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -297,7 +297,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#ScrollView] getChildren
|
||||
-- @param self
|
||||
-- @return array_table#array_table ret (retunr value: array_table)
|
||||
-- @return array_table#array_table ret (return value: array_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
-- @param #string skeletonDataFile
|
||||
-- @param #spAtlas atlas
|
||||
-- @param #float scale
|
||||
-- @return SkeletonRenderer#SkeletonRenderer ret (retunr value: sp.SkeletonRenderer)
|
||||
-- @return SkeletonRenderer#SkeletonRenderer ret (return value: sp.SkeletonRenderer)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
-- @function [parent=#Skin] create
|
||||
-- @param self
|
||||
-- @param #string pszFileName
|
||||
-- @return Skin#Skin ret (retunr value: ccs.Skin)
|
||||
-- @return Skin#Skin ret (return value: ccs.Skin)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -196,7 +196,7 @@
|
|||
-- @param self
|
||||
-- @param #string filename
|
||||
-- @param #rect_table rect
|
||||
-- @return Sprite#Sprite ret (retunr value: cc.Sprite)
|
||||
-- @return Sprite#Sprite ret (return value: cc.Sprite)
|
||||
|
||||
--------------------------------
|
||||
-- @overload self, cc.Texture2D, rect_table, bool
|
||||
|
@ -206,7 +206,7 @@
|
|||
-- @param #cc.Texture2D texture
|
||||
-- @param #rect_table rect
|
||||
-- @param #bool rotated
|
||||
-- @return Sprite#Sprite ret (retunr value: cc.Sprite)
|
||||
-- @return Sprite#Sprite ret (return value: cc.Sprite)
|
||||
|
||||
--------------------------------
|
||||
-- Creates a sprite with an sprite frame name.<br>
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
-- @param self
|
||||
-- @param #string modelPath
|
||||
-- @param #string texturePath
|
||||
-- @return Sprite3D#Sprite3D ret (retunr value: cc.Sprite3D)
|
||||
-- @return Sprite3D#Sprite3D ret (return value: cc.Sprite3D)
|
||||
|
||||
--------------------------------
|
||||
-- Returns 2d bounding-box<br>
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
-- @param #bool rotated
|
||||
-- @param #vec2_table offset
|
||||
-- @param #size_table originalSize
|
||||
-- @return SpriteFrame#SpriteFrame ret (retunr value: cc.SpriteFrame)
|
||||
-- @return SpriteFrame#SpriteFrame ret (return value: cc.SpriteFrame)
|
||||
|
||||
--------------------------------
|
||||
-- @overload self, cc.Texture2D, rect_table, bool, vec2_table, size_table
|
||||
|
@ -128,6 +128,6 @@
|
|||
-- @param #bool rotated
|
||||
-- @param #vec2_table offset
|
||||
-- @param #size_table originalSize
|
||||
-- @return SpriteFrame#SpriteFrame ret (retunr value: cc.SpriteFrame)
|
||||
-- @return SpriteFrame#SpriteFrame ret (return value: cc.SpriteFrame)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#TMXLayer] getProperties
|
||||
-- @param self
|
||||
-- @return map_table#map_table ret (retunr value: map_table)
|
||||
-- @return map_table#map_table ret (return value: map_table)
|
||||
|
||||
--------------------------------
|
||||
-- Creates the tiles
|
||||
|
|
|
@ -71,14 +71,14 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#TMXMapInfo] getLayers
|
||||
-- @param self
|
||||
-- @return array_table#array_table ret (retunr value: array_table)
|
||||
-- @return array_table#array_table ret (return value: array_table)
|
||||
|
||||
--------------------------------
|
||||
-- @overload self
|
||||
-- @overload self
|
||||
-- @function [parent=#TMXMapInfo] getTilesets
|
||||
-- @param self
|
||||
-- @return array_table#array_table ret (retunr value: array_table)
|
||||
-- @return array_table#array_table ret (return value: array_table)
|
||||
|
||||
--------------------------------
|
||||
-- / parent GID
|
||||
|
@ -129,7 +129,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#TMXMapInfo] getObjectGroups
|
||||
-- @param self
|
||||
-- @return array_table#array_table ret (retunr value: array_table)
|
||||
-- @return array_table#array_table ret (return value: array_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -190,7 +190,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#TMXMapInfo] getProperties
|
||||
-- @param self
|
||||
-- @return map_table#map_table ret (retunr value: map_table)
|
||||
-- @return map_table#map_table ret (return value: map_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#TMXObjectGroup] getObjects
|
||||
-- @param self
|
||||
-- @return array_table#array_table ret (retunr value: array_table)
|
||||
-- @return array_table#array_table ret (return value: array_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -49,7 +49,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#TMXObjectGroup] getProperties
|
||||
-- @param self
|
||||
-- @return map_table#map_table ret (retunr value: map_table)
|
||||
-- @return map_table#map_table ret (return value: map_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#TMXTiledMap] getObjectGroups
|
||||
-- @param self
|
||||
-- @return array_table#array_table ret (retunr value: array_table)
|
||||
-- @return array_table#array_table ret (return value: array_table)
|
||||
|
||||
--------------------------------
|
||||
-- the tiles's size property measured in pixels
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
-- @overload self
|
||||
-- @function [parent=#TargetedAction] getForcedTarget
|
||||
-- @param self
|
||||
-- @return Node#Node ret (retunr value: cc.Node)
|
||||
-- @return Node#Node ret (return value: cc.Node)
|
||||
|
||||
--------------------------------
|
||||
-- Sets the target that the action will be forced to run with
|
||||
|
|
|
@ -157,7 +157,7 @@
|
|||
-- @param #string textContent
|
||||
-- @param #string fontName
|
||||
-- @param #int fontSize
|
||||
-- @return Text#Text ret (retunr value: ccui.Text)
|
||||
-- @return Text#Text ret (return value: ccui.Text)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
-- @param #int itemWidth
|
||||
-- @param #int itemHeight
|
||||
-- @param #string startCharMap
|
||||
-- @return TextAtlas#TextAtlas ret (retunr value: ccui.TextAtlas)
|
||||
-- @return TextAtlas#TextAtlas ret (return value: ccui.TextAtlas)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
-- @param self
|
||||
-- @param #string text
|
||||
-- @param #string filename
|
||||
-- @return TextBMFont#TextBMFont ret (retunr value: ccui.TextBMFont)
|
||||
-- @return TextBMFont#TextBMFont ret (return value: ccui.TextBMFont)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -240,7 +240,7 @@
|
|||
-- @param #string placeholder
|
||||
-- @param #string fontName
|
||||
-- @param #int fontSize
|
||||
-- @return TextField#TextField ret (retunr value: ccui.TextField)
|
||||
-- @return TextField#TextField ret (return value: ccui.TextField)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
-- @param self
|
||||
-- @param #cc.Image image
|
||||
-- @param #int format
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- Gets max S
|
||||
|
@ -57,7 +57,7 @@
|
|||
-- @function [parent=#Texture2D] getBitsPerPixelForFormat
|
||||
-- @param self
|
||||
-- @param #int format
|
||||
-- @return unsigned int#unsigned int ret (retunr value: unsigned int)
|
||||
-- @return unsigned int#unsigned int ret (return value: unsigned int)
|
||||
|
||||
--------------------------------
|
||||
-- Gets the texture name
|
||||
|
@ -76,7 +76,7 @@
|
|||
-- @param #size_table dimensions
|
||||
-- @param #int hAlignment
|
||||
-- @param #int vAlignment
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- Sets max T
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
-- @param self
|
||||
-- @param #cc.Image image
|
||||
-- @param #string key
|
||||
-- @return Texture2D#Texture2D ret (retunr value: cc.Texture2D)
|
||||
-- @return Texture2D#Texture2D ret (return value: cc.Texture2D)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
-- @param #size_table gridSize
|
||||
-- @param #cc.Texture2D texture
|
||||
-- @param #bool flipped
|
||||
-- @return TiledGrid3D#TiledGrid3D ret (retunr value: cc.TiledGrid3D)
|
||||
-- @return TiledGrid3D#TiledGrid3D ret (return value: cc.TiledGrid3D)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
-- @param #float duration
|
||||
-- @param #cc.Scene scene
|
||||
-- @param #color3b_table color
|
||||
-- @return TransitionFade#TransitionFade ret (retunr value: cc.TransitionFade)
|
||||
-- @return TransitionFade#TransitionFade ret (return value: cc.TransitionFade)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
-- @param #float t
|
||||
-- @param #cc.Scene s
|
||||
-- @param #int o
|
||||
-- @return TransitionFlipAngular#TransitionFlipAngular ret (retunr value: cc.TransitionFlipAngular)
|
||||
-- @return TransitionFlipAngular#TransitionFlipAngular ret (return value: cc.TransitionFlipAngular)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
-- @param #float t
|
||||
-- @param #cc.Scene s
|
||||
-- @param #int o
|
||||
-- @return TransitionFlipX#TransitionFlipX ret (retunr value: cc.TransitionFlipX)
|
||||
-- @return TransitionFlipX#TransitionFlipX ret (return value: cc.TransitionFlipX)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
-- @param #float t
|
||||
-- @param #cc.Scene s
|
||||
-- @param #int o
|
||||
-- @return TransitionFlipY#TransitionFlipY ret (retunr value: cc.TransitionFlipY)
|
||||
-- @return TransitionFlipY#TransitionFlipY ret (return value: cc.TransitionFlipY)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
-- @param #float t
|
||||
-- @param #cc.Scene s
|
||||
-- @param #int o
|
||||
-- @return TransitionZoomFlipAngular#TransitionZoomFlipAngular ret (retunr value: cc.TransitionZoomFlipAngular)
|
||||
-- @return TransitionZoomFlipAngular#TransitionZoomFlipAngular ret (return value: cc.TransitionZoomFlipAngular)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
-- @param #float t
|
||||
-- @param #cc.Scene s
|
||||
-- @param #int o
|
||||
-- @return TransitionZoomFlipX#TransitionZoomFlipX ret (retunr value: cc.TransitionZoomFlipX)
|
||||
-- @return TransitionZoomFlipX#TransitionZoomFlipX ret (return value: cc.TransitionZoomFlipX)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
-- @param #float t
|
||||
-- @param #cc.Scene s
|
||||
-- @param #int o
|
||||
-- @return TransitionZoomFlipY#TransitionZoomFlipY ret (retunr value: cc.TransitionZoomFlipY)
|
||||
-- @return TransitionZoomFlipY#TransitionZoomFlipY ret (return value: cc.TransitionZoomFlipY)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
-- @param #float duration
|
||||
-- @param #size_table gridSize
|
||||
-- @param #unsigned int seed
|
||||
-- @return TurnOffTiles#TurnOffTiles ret (retunr value: cc.TurnOffTiles)
|
||||
-- @return TurnOffTiles#TurnOffTiles ret (return value: cc.TurnOffTiles)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
-- @param self
|
||||
-- @param #char pKey
|
||||
-- @param #float defaultValue
|
||||
-- @return float#float ret (retunr value: float)
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
-- @overload self, char, bool
|
||||
|
@ -27,7 +27,7 @@
|
|||
-- @param self
|
||||
-- @param #char pKey
|
||||
-- @param #bool defaultValue
|
||||
-- @return bool#bool ret (retunr value: bool)
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- brief Set double value by key.<br>
|
||||
|
@ -52,7 +52,7 @@
|
|||
-- @param self
|
||||
-- @param #char pKey
|
||||
-- @param #string defaultValue
|
||||
-- @return string#string ret (retunr value: string)
|
||||
-- @return string#string ret (return value: string)
|
||||
|
||||
--------------------------------
|
||||
-- brief Set string value by key.<br>
|
||||
|
@ -75,7 +75,7 @@
|
|||
-- @param self
|
||||
-- @param #char pKey
|
||||
-- @param #int defaultValue
|
||||
-- @return int#int ret (retunr value: int)
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
-- @overload self, char, double
|
||||
|
@ -84,7 +84,7 @@
|
|||
-- @param self
|
||||
-- @param #char pKey
|
||||
-- @param #double defaultValue
|
||||
-- @return double#double ret (retunr value: double)
|
||||
-- @return double#double ret (return value: double)
|
||||
|
||||
--------------------------------
|
||||
-- brief Set bool value by key.<br>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
-- @function [parent=#VBox] create
|
||||
-- @param self
|
||||
-- @param #size_table size
|
||||
-- @return VBox#VBox ret (retunr value: ccui.VBox)
|
||||
-- @return VBox#VBox ret (return value: ccui.VBox)
|
||||
|
||||
--------------------------------
|
||||
-- Default constructor
|
||||
|
|
|
@ -60865,7 +60865,7 @@ int lua_register_cocos2dx_SpriteFrameCache(lua_State* tolua_S)
|
|||
|
||||
tolua_beginmodule(tolua_S,"SpriteFrameCache");
|
||||
tolua_function(tolua_S,"addSpriteFramesWithFileContent",lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFileContent);
|
||||
tolua_function(tolua_S,"addSpriteFramesWithFile",lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile);
|
||||
tolua_function(tolua_S,"addSpriteFrames",lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile);
|
||||
tolua_function(tolua_S,"addSpriteFrame",lua_cocos2dx_SpriteFrameCache_addSpriteFrame);
|
||||
tolua_function(tolua_S,"removeUnusedSpriteFrames",lua_cocos2dx_SpriteFrameCache_removeUnusedSpriteFrames);
|
||||
tolua_function(tolua_S,"getSpriteFrame",lua_cocos2dx_SpriteFrameCache_getSpriteFrameByName);
|
||||
|
|
|
@ -16600,7 +16600,7 @@ int lua_cocos2dx_ui_Helper_getSubStringOfUTF8String(lua_State* tolua_S)
|
|||
#endif
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_ui_Helper_doLayout(lua_State* tolua_S)
|
||||
int lua_cocos2dx_ui_Helper_changeLayoutSystemActiveState(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
bool ok = true;
|
||||
|
@ -16617,53 +16617,18 @@ int lua_cocos2dx_ui_Helper_doLayout(lua_State* tolua_S)
|
|||
|
||||
if (argc == 1)
|
||||
{
|
||||
cocos2d::Node* arg0;
|
||||
ok &= luaval_to_object<cocos2d::Node>(tolua_S, 2, "cc.Node",&arg0);
|
||||
bool arg0;
|
||||
ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ccui.Helper:changeLayoutSystemActiveState");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cocos2d::ui::Helper::doLayout(arg0);
|
||||
cocos2d::ui::Helper::changeLayoutSystemActiveState(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "ccui.Helper:doLayout",argc, 1);
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "ccui.Helper:changeLayoutSystemActiveState",argc, 1);
|
||||
return 0;
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Helper_doLayout'.",&tolua_err);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_ui_Helper_seekWidgetByTag(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertable(tolua_S,1,"ccui.Helper",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S) - 1;
|
||||
|
||||
if (argc == 2)
|
||||
{
|
||||
cocos2d::ui::Widget* arg0;
|
||||
int arg1;
|
||||
ok &= luaval_to_object<cocos2d::ui::Widget>(tolua_S, 2, "ccui.Widget",&arg0);
|
||||
ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "ccui.Helper:seekWidgetByTag");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cocos2d::ui::Widget* ret = cocos2d::ui::Helper::seekWidgetByTag(arg0, arg1);
|
||||
object_to_luaval<cocos2d::ui::Widget>(tolua_S, "ccui.Widget",(cocos2d::ui::Widget*)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "ccui.Helper:seekWidgetByTag",argc, 2);
|
||||
return 0;
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Helper_seekWidgetByTag'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Helper_changeLayoutSystemActiveState'.",&tolua_err);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
@ -16737,6 +16702,73 @@ int lua_cocos2dx_ui_Helper_seekWidgetByName(lua_State* tolua_S)
|
|||
#endif
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_ui_Helper_seekWidgetByTag(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertable(tolua_S,1,"ccui.Helper",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S) - 1;
|
||||
|
||||
if (argc == 2)
|
||||
{
|
||||
cocos2d::ui::Widget* arg0;
|
||||
int arg1;
|
||||
ok &= luaval_to_object<cocos2d::ui::Widget>(tolua_S, 2, "ccui.Widget",&arg0);
|
||||
ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "ccui.Helper:seekWidgetByTag");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cocos2d::ui::Widget* ret = cocos2d::ui::Helper::seekWidgetByTag(arg0, arg1);
|
||||
object_to_luaval<cocos2d::ui::Widget>(tolua_S, "ccui.Widget",(cocos2d::ui::Widget*)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "ccui.Helper:seekWidgetByTag",argc, 2);
|
||||
return 0;
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Helper_seekWidgetByTag'.",&tolua_err);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_ui_Helper_doLayout(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertable(tolua_S,1,"ccui.Helper",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S) - 1;
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
cocos2d::Node* arg0;
|
||||
ok &= luaval_to_object<cocos2d::Node>(tolua_S, 2, "cc.Node",&arg0);
|
||||
if(!ok)
|
||||
return 0;
|
||||
cocos2d::ui::Helper::doLayout(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "ccui.Helper:doLayout",argc, 1);
|
||||
return 0;
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Helper_doLayout'.",&tolua_err);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
static int lua_cocos2dx_ui_Helper_finalize(lua_State* tolua_S)
|
||||
{
|
||||
printf("luabindings: finalizing LUA object (Helper)");
|
||||
|
@ -16750,10 +16782,11 @@ int lua_register_cocos2dx_ui_Helper(lua_State* tolua_S)
|
|||
|
||||
tolua_beginmodule(tolua_S,"Helper");
|
||||
tolua_function(tolua_S,"getSubStringOfUTF8String", lua_cocos2dx_ui_Helper_getSubStringOfUTF8String);
|
||||
tolua_function(tolua_S,"doLayout", lua_cocos2dx_ui_Helper_doLayout);
|
||||
tolua_function(tolua_S,"seekWidgetByTag", lua_cocos2dx_ui_Helper_seekWidgetByTag);
|
||||
tolua_function(tolua_S,"changeLayoutSystemActiveState", lua_cocos2dx_ui_Helper_changeLayoutSystemActiveState);
|
||||
tolua_function(tolua_S,"seekActionWidgetByActionTag", lua_cocos2dx_ui_Helper_seekActionWidgetByActionTag);
|
||||
tolua_function(tolua_S,"seekWidgetByName", lua_cocos2dx_ui_Helper_seekWidgetByName);
|
||||
tolua_function(tolua_S,"seekWidgetByTag", lua_cocos2dx_ui_Helper_seekWidgetByTag);
|
||||
tolua_function(tolua_S,"doLayout", lua_cocos2dx_ui_Helper_doLayout);
|
||||
tolua_endmodule(tolua_S);
|
||||
std::string typeName = typeid(cocos2d::ui::Helper).name();
|
||||
g_luaType[typeName] = "ccui.Helper";
|
||||
|
|
|
@ -480,6 +480,7 @@ int register_all_cocos2dx_ui(lua_State* tolua_S);
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // __cocos2dx_ui_h__
|
||||
|
|
|
@ -576,3 +576,31 @@ cc.MATRIX_STACK_TYPE =
|
|||
PROJECTION = 1,
|
||||
TEXTURE = 2,
|
||||
}
|
||||
|
||||
cc.LightType =
|
||||
{
|
||||
DIRECTIONAL = 0,
|
||||
POINT = 1,
|
||||
SPOT = 2,
|
||||
AMBIENT = 3,
|
||||
}
|
||||
|
||||
cc.LightFlag =
|
||||
{
|
||||
LIGHT0 = math.pow(2,0),
|
||||
LIGHT1 = math.pow(2,1),
|
||||
LIGHT2 = math.pow(2,2),
|
||||
LIGHT3 = math.pow(2,3),
|
||||
LIGHT4 = math.pow(2,4),
|
||||
LIGHT5 = math.pow(2,5),
|
||||
LIGHT6 = math.pow(2,6),
|
||||
LIGHT7 = math.pow(2,7),
|
||||
LIGHT8 = math.pow(2,8),
|
||||
LIGHT9 = math.pow(2,9),
|
||||
LIGHT10 = math.pow(2,10),
|
||||
LIGHT11 = math.pow(2,11),
|
||||
LIGHT12 = math.pow(2,12),
|
||||
LIGHT13 = math.pow(2,13),
|
||||
LIGHT14 = math.pow(2,14),
|
||||
LIGHT15 = math.pow(2,15),
|
||||
}
|
||||
|
|
|
@ -30,6 +30,8 @@ NS_CC_BEGIN
|
|||
|
||||
namespace ui {
|
||||
|
||||
static bool _activeLayout = true;
|
||||
|
||||
Widget* Helper::seekWidgetByTag(Widget* root, int tag)
|
||||
{
|
||||
if (!root)
|
||||
|
@ -147,37 +149,40 @@ std::string Helper::getSubStringOfUTF8String(const std::string& str, std::string
|
|||
return str.substr(min,max);
|
||||
}
|
||||
|
||||
void Helper::doLayout(cocos2d::Node *rootNode)
|
||||
{
|
||||
for(auto& node : rootNode->getChildren())
|
||||
void Helper::changeLayoutSystemActiveState(bool bActive)
|
||||
{
|
||||
_activeLayout = bActive;
|
||||
}
|
||||
void Helper::doLayout(cocos2d::Node *rootNode)
|
||||
{
|
||||
if(!_activeLayout)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(auto& node : rootNode->getChildren())
|
||||
{
|
||||
auto com = node->getComponent(__LAYOUT_COMPONENT_NAME);
|
||||
Node *parent = node->getParent();
|
||||
if (nullptr != com && nullptr != parent) {
|
||||
LayoutComponent* layoutComponent = (LayoutComponent*)com;
|
||||
|
||||
if (layoutComponent->isUsingPercentPosition())
|
||||
{
|
||||
auto com = node->getComponent(__LAYOUT_COMPONENT_NAME);
|
||||
Node *parent = node->getParent();
|
||||
if (nullptr != com && nullptr != parent) {
|
||||
LayoutComponent* layoutComponent = (LayoutComponent*)com;
|
||||
layoutComponent->setPercentPosition(layoutComponent->getPercentPosition());
|
||||
}
|
||||
else if (layoutComponent->getReferencePoint() != LayoutComponent::ReferencePoint::BOTTOM_LEFT)
|
||||
{
|
||||
layoutComponent->setRelativePosition(layoutComponent->getRelativePosition());
|
||||
}
|
||||
|
||||
if (layoutComponent->isUsingPercentPosition())
|
||||
{
|
||||
layoutComponent->RefreshLayoutPosition(LayoutComponent::PositionType::PreRelativePosition,layoutComponent->getPercentPosition());
|
||||
}
|
||||
else if (layoutComponent->getReferencePoint() != LayoutComponent::ReferencePoint::BOTTOM_LEFT)
|
||||
{
|
||||
layoutComponent->RefreshLayoutPosition(LayoutComponent::PositionType::RelativePosition,layoutComponent->getRelativePosition());
|
||||
}
|
||||
|
||||
if (layoutComponent->isUsingPercentContentSize())
|
||||
{
|
||||
layoutComponent->RefreshLayoutSize(LayoutComponent::SizeType::PreSize,layoutComponent->getPercentContentSize());
|
||||
}
|
||||
|
||||
Widget* uiWidget = dynamic_cast<Widget*>(node);
|
||||
if ( nullptr == uiWidget )
|
||||
{
|
||||
doLayout(node);
|
||||
}
|
||||
}
|
||||
if (layoutComponent->isUsingPercentContentSize())
|
||||
{
|
||||
layoutComponent->setPercentContentSize(layoutComponent->getPercentContentSize());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -81,6 +81,7 @@ public:
|
|||
|
||||
static void doLayout(Node *rootNode);
|
||||
|
||||
static void changeLayoutSystemActiveState(bool bActive);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -66,9 +66,24 @@ namespace ui {
|
|||
{
|
||||
return this->getOwner()->getContentSize();
|
||||
}
|
||||
void LayoutComponent::setOwnerContentSize(const Vec2& percent)
|
||||
void LayoutComponent::setOwnerContentSize(const Vec2& size)
|
||||
{
|
||||
this->RefreshLayoutSize(SizeType::Size,percent);
|
||||
this->getOwner()->setContentSize(Size(size.x,size.y));
|
||||
|
||||
Node* parentNode = this->getOwner()->getParent();
|
||||
if (parentNode != NULL && _actived)
|
||||
{
|
||||
Size parentSize = parentNode->getContentSize();
|
||||
|
||||
if (parentSize.width != 0 && parentSize.height != 0)
|
||||
{
|
||||
_percentContentSize = Point(size.x/parentSize.width,size.y/parentSize.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
_percentContentSize = Point(0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const Vec2& LayoutComponent::getPercentContentSize()const
|
||||
|
@ -78,7 +93,17 @@ namespace ui {
|
|||
|
||||
void LayoutComponent::setPercentContentSize(const Vec2& percent)
|
||||
{
|
||||
this->RefreshLayoutSize(SizeType::PreSize,percent);
|
||||
_percentContentSize = percent;
|
||||
|
||||
Node* parentNode = this->getOwner()->getParent();
|
||||
if (parentNode != NULL && _actived)
|
||||
{
|
||||
Size parentSize = parentNode->getContentSize();
|
||||
if (_usingPercentContentSize)
|
||||
{
|
||||
this->getOwner()->setContentSize(Size(percent.x*parentSize.width,percent.y*parentSize.height));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool LayoutComponent::isUsingPercentContentSize()
|
||||
|
@ -89,79 +114,35 @@ namespace ui {
|
|||
void LayoutComponent::setUsingPercentContentSize(bool flag)
|
||||
{
|
||||
_usingPercentContentSize = flag;
|
||||
this->RefreshLayoutSize(SizeType::PreSizeEnable,Vec2(0,0));
|
||||
}
|
||||
|
||||
void LayoutComponent::RefreshLayoutSize(SizeType sType, const Vec2& size)
|
||||
{
|
||||
Node* parentNode = this->getOwner()->getParent();
|
||||
if (parentNode != NULL && _actived)
|
||||
{
|
||||
Size parentSize = parentNode->getContentSize();
|
||||
|
||||
switch (sType)
|
||||
if (_usingPercentContentSize)
|
||||
{
|
||||
case SizeType::Size:
|
||||
if (parentSize.width != 0 && parentSize.height != 0)
|
||||
Size baseSize = this->getOwner()->getContentSize();
|
||||
if (parentSize.width != 0)
|
||||
{
|
||||
_percentContentSize = Point(size.x/parentSize.width,size.y/parentSize.height);
|
||||
_percentContentSize.x = baseSize.width/parentSize.width;
|
||||
}
|
||||
else
|
||||
{
|
||||
_percentContentSize = Point(0,0);
|
||||
_percentContentSize.x = 0;
|
||||
baseSize.width = 0;
|
||||
}
|
||||
this->getOwner()->setContentSize(Size(size.x,size.y));
|
||||
break;
|
||||
case SizeType::PreSize:
|
||||
_percentContentSize = size;
|
||||
if (_usingPercentContentSize)
|
||||
{
|
||||
this->getOwner()->setContentSize(Size(size.x*parentSize.width,size.y*parentSize.height));
|
||||
}
|
||||
break;
|
||||
case SizeType::PreSizeEnable:
|
||||
if (_usingPercentContentSize)
|
||||
{
|
||||
Size baseSize = this->getOwner()->getContentSize();
|
||||
if (parentSize.width != 0)
|
||||
{
|
||||
_percentContentSize.x = baseSize.width/parentSize.width;
|
||||
}
|
||||
else
|
||||
{
|
||||
_percentContentSize.x = 0;
|
||||
baseSize.width = 0;
|
||||
}
|
||||
|
||||
if (parentSize.height != 0)
|
||||
{
|
||||
_percentContentSize.y = baseSize.height/parentSize.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
_percentContentSize.y = 0;
|
||||
baseSize.height = 0;
|
||||
}
|
||||
|
||||
this->getOwner()->setContentSize(baseSize);
|
||||
if (parentSize.height != 0)
|
||||
{
|
||||
_percentContentSize.y = baseSize.height/parentSize.height;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (sType)
|
||||
{
|
||||
case SizeType::Size:
|
||||
this->getOwner()->setContentSize(Size(size.x,size.y));
|
||||
break;
|
||||
case SizeType::PreSize:
|
||||
_percentContentSize = size;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
else
|
||||
{
|
||||
_percentContentSize.y = 0;
|
||||
baseSize.height = 0;
|
||||
}
|
||||
|
||||
this->getOwner()->setContentSize(baseSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -174,7 +155,38 @@ namespace ui {
|
|||
void LayoutComponent::setUsingPercentPosition(bool flag)
|
||||
{
|
||||
_usingPercentPosition = flag;
|
||||
this->RefreshLayoutPosition(PositionType::PreRelativePositionEnable,Vec2(0,0));
|
||||
|
||||
Node* parentNode = this->getOwner()->getParent();
|
||||
if (parentNode != NULL && _actived)
|
||||
{
|
||||
Size parentSize = parentNode->getContentSize();
|
||||
|
||||
if (_usingPercentPosition)
|
||||
{
|
||||
if (parentSize.width != 0)
|
||||
{
|
||||
_percentPosition.x = _relativePosition.x/parentSize.width;
|
||||
}
|
||||
else
|
||||
{
|
||||
_percentPosition.x = 0;
|
||||
_relativePosition.x = 0;
|
||||
}
|
||||
|
||||
if (parentSize.height != 0)
|
||||
{
|
||||
_percentPosition.y = _relativePosition.y/parentSize.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
_percentPosition.y = 0;
|
||||
_relativePosition.y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Point inversePoint = this->converPointWithReferencePointAndSize(_relativePosition,parentSize);
|
||||
this->getOwner()->setPosition(inversePoint);
|
||||
}
|
||||
}
|
||||
|
||||
const Vec2& LayoutComponent::getPercentPosition()
|
||||
|
@ -183,7 +195,16 @@ namespace ui {
|
|||
}
|
||||
void LayoutComponent::setPercentPosition(const Vec2& percent)
|
||||
{
|
||||
this->RefreshLayoutPosition(PositionType::PreRelativePosition,percent);
|
||||
_percentPosition = percent;
|
||||
|
||||
Node* parentNode = this->getOwner()->getParent();
|
||||
if (parentNode != NULL && _actived)
|
||||
{
|
||||
Size parentSize = parentNode->getContentSize();
|
||||
_relativePosition = Point(_percentPosition.x*parentSize.width,_percentPosition.y*parentSize.height);
|
||||
Point inversePoint = this->converPointWithReferencePointAndSize(_relativePosition,parentSize);
|
||||
this->getOwner()->setPosition(inversePoint);
|
||||
}
|
||||
}
|
||||
|
||||
const Vec2& LayoutComponent::getOwnerPosition()const
|
||||
|
@ -192,7 +213,32 @@ namespace ui {
|
|||
}
|
||||
void LayoutComponent::setOwnerPosition(const Vec2& point)
|
||||
{
|
||||
this->RefreshLayoutPosition(PositionType::Position,point);
|
||||
Node* parentNode = this->getOwner()->getParent();
|
||||
if (parentNode != NULL && _actived)
|
||||
{
|
||||
Size parentSize = parentNode->getContentSize();
|
||||
|
||||
Point inversePoint = this->converPointWithReferencePointAndSize(point,parentSize);
|
||||
this->getOwner()->setPosition(point);
|
||||
_relativePosition = inversePoint;
|
||||
if (parentSize.width != 0 && parentSize.height != 0)
|
||||
{
|
||||
_percentPosition = Point(_relativePosition.x/parentSize.width,_relativePosition.y/parentSize.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
_percentPosition = Point(0,0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->getOwner()->setPosition(point);
|
||||
if (_referencePoint == ReferencePoint::BOTTOM_LEFT)
|
||||
{
|
||||
_relativePosition = point;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const Vec2& LayoutComponent::getRelativePosition()
|
||||
|
@ -201,7 +247,24 @@ namespace ui {
|
|||
}
|
||||
void LayoutComponent::setRelativePosition(const Vec2& position)
|
||||
{
|
||||
this->RefreshLayoutPosition(PositionType::RelativePosition,position);
|
||||
_relativePosition = position;
|
||||
|
||||
Node* parentNode = this->getOwner()->getParent();
|
||||
if (parentNode != NULL && _actived)
|
||||
{
|
||||
Size parentSize = parentNode->getContentSize();
|
||||
|
||||
Point inversePoint = this->converPointWithReferencePointAndSize(_relativePosition,parentSize);
|
||||
this->getOwner()->setPosition(inversePoint);
|
||||
if (parentSize.width != 0 && parentSize.height != 0)
|
||||
{
|
||||
_percentPosition = Point(_relativePosition.x/parentSize.width,_relativePosition.y/parentSize.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
_percentPosition = Point(0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LayoutComponent::ReferencePoint LayoutComponent::getReferencePoint()
|
||||
|
@ -211,131 +274,34 @@ namespace ui {
|
|||
void LayoutComponent::setReferencePoint(ReferencePoint point)
|
||||
{
|
||||
_referencePoint = point;
|
||||
this->RefreshLayoutPosition(PositionType::RelativePosition,_relativePosition);
|
||||
this->setRelativePosition(_relativePosition);
|
||||
}
|
||||
|
||||
void LayoutComponent::RefreshLayoutPosition(PositionType pType,const Vec2& point)
|
||||
{
|
||||
Node* parentNode = this->getOwner()->getParent();
|
||||
Point basePoint = point;
|
||||
if (parentNode != NULL && _actived)
|
||||
{
|
||||
Size parentSize = parentNode->getContentSize();
|
||||
|
||||
if ( pType == PositionType::PreRelativePosition)
|
||||
{
|
||||
_percentPosition = point;
|
||||
basePoint = Point(_percentPosition.x*parentSize.width,_percentPosition.y*parentSize.height);
|
||||
}
|
||||
else if(pType == PositionType::PreRelativePositionEnable)
|
||||
{
|
||||
if (_usingPercentPosition)
|
||||
{
|
||||
if (parentSize.width != 0)
|
||||
{
|
||||
_percentPosition.x = _relativePosition.x/parentSize.width;
|
||||
}
|
||||
else
|
||||
{
|
||||
_percentPosition.x = 0;
|
||||
_relativePosition.x = 0;
|
||||
}
|
||||
|
||||
if (parentSize.height != 0)
|
||||
{
|
||||
_percentPosition.y = _relativePosition.y/parentSize.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
_percentPosition.y = 0;
|
||||
_relativePosition.y = 0;
|
||||
}
|
||||
}
|
||||
basePoint = _relativePosition;
|
||||
}
|
||||
|
||||
Point inversePoint = basePoint;
|
||||
switch (_referencePoint)
|
||||
{
|
||||
case ReferencePoint::TOP_LEFT:
|
||||
inversePoint.y = parentSize.height - inversePoint.y;
|
||||
break;
|
||||
case ReferencePoint::BOTTOM_RIGHT:
|
||||
inversePoint.x = parentSize.width - inversePoint.x;
|
||||
break;
|
||||
case ReferencePoint::TOP_RIGHT:
|
||||
inversePoint.x = parentSize.width - inversePoint.x;
|
||||
inversePoint.y = parentSize.height - inversePoint.y;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (pType)
|
||||
{
|
||||
case PositionType::Position:
|
||||
this->getOwner()->setPosition(basePoint);
|
||||
_relativePosition = inversePoint;
|
||||
if (parentSize.width != 0 && parentSize.height != 0)
|
||||
{
|
||||
_percentPosition = Point(_relativePosition.x/parentSize.width,_relativePosition.y/parentSize.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
_percentPosition = Point(0,0);
|
||||
}
|
||||
break;
|
||||
case PositionType::RelativePosition:
|
||||
this->getOwner()->setPosition(inversePoint);
|
||||
_relativePosition = basePoint;
|
||||
if (parentSize.width != 0 && parentSize.height != 0)
|
||||
{
|
||||
_percentPosition = Point(_relativePosition.x/parentSize.width,_relativePosition.y/parentSize.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
_percentPosition = Point(0,0);
|
||||
}
|
||||
break;
|
||||
case PositionType::PreRelativePosition:
|
||||
this->getOwner()->setPosition(inversePoint);
|
||||
_relativePosition = basePoint;
|
||||
break;
|
||||
case PositionType::PreRelativePositionEnable:
|
||||
this->getOwner()->setPosition(inversePoint);
|
||||
_relativePosition = basePoint;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (pType)
|
||||
{
|
||||
case PositionType::Position:
|
||||
this->getOwner()->setPosition(basePoint);
|
||||
if (_referencePoint == ReferencePoint::BOTTOM_LEFT)
|
||||
{
|
||||
_relativePosition = basePoint;
|
||||
}
|
||||
break;
|
||||
case PositionType::RelativePosition:
|
||||
_relativePosition = basePoint;
|
||||
break;
|
||||
case PositionType::PreRelativePosition:
|
||||
_percentPosition = basePoint;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutComponent::SetActiveEnable(bool enable)
|
||||
void LayoutComponent::setActiveEnable(bool enable)
|
||||
{
|
||||
_actived = enable;
|
||||
}
|
||||
|
||||
Vec2 LayoutComponent::converPointWithReferencePointAndSize(const Vec2& point,const Size& size)
|
||||
{
|
||||
Point inversePoint = point;
|
||||
switch (_referencePoint)
|
||||
{
|
||||
case ReferencePoint::TOP_LEFT:
|
||||
inversePoint.y = size.height - inversePoint.y;
|
||||
break;
|
||||
case ReferencePoint::BOTTOM_RIGHT:
|
||||
inversePoint.x = size.width - inversePoint.x;
|
||||
break;
|
||||
case ReferencePoint::TOP_RIGHT:
|
||||
inversePoint.x = size.width - inversePoint.x;
|
||||
inversePoint.y = size.height - inversePoint.y;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return inversePoint;
|
||||
}
|
||||
}
|
||||
|
||||
NS_CC_END
|
|
@ -53,21 +53,6 @@ NS_CC_BEGIN
|
|||
TOP_RIGHT
|
||||
};
|
||||
|
||||
enum class PositionType
|
||||
{
|
||||
Position,
|
||||
RelativePosition,
|
||||
PreRelativePosition,
|
||||
PreRelativePositionEnable
|
||||
};
|
||||
|
||||
enum class SizeType
|
||||
{
|
||||
Size,
|
||||
PreSize,
|
||||
PreSizeEnable
|
||||
};
|
||||
|
||||
bool isUsingPercentPosition();
|
||||
void setUsingPercentPosition(bool flag);
|
||||
|
||||
|
@ -83,10 +68,8 @@ NS_CC_BEGIN
|
|||
const Vec2& getOwnerPosition()const;
|
||||
void setOwnerPosition(const Vec2& point);
|
||||
|
||||
void RefreshLayoutPosition(PositionType pType,const Vec2& point);
|
||||
|
||||
const Vec2& getOwnerContentSize()const;
|
||||
void setOwnerContentSize(const Vec2& percent);
|
||||
void setOwnerContentSize(const Vec2& size);
|
||||
|
||||
const Vec2& getPercentContentSize()const;
|
||||
void setPercentContentSize(const Vec2& percent);
|
||||
|
@ -94,9 +77,9 @@ NS_CC_BEGIN
|
|||
bool isUsingPercentContentSize();
|
||||
void setUsingPercentContentSize(bool flag);
|
||||
|
||||
void RefreshLayoutSize(SizeType sType, const Vec2& size);
|
||||
|
||||
void SetActiveEnable(bool enable);
|
||||
void setActiveEnable(bool enable);
|
||||
private:
|
||||
Vec2 converPointWithReferencePointAndSize(const Vec2& point,const Size& size);
|
||||
private:
|
||||
|
||||
Vec2 _percentContentSize;
|
||||
|
|
|
@ -219,13 +219,8 @@ bool Widget::init()
|
|||
|
||||
void Widget::onEnter()
|
||||
{
|
||||
updateSizeAndPosition();
|
||||
ProtectedNode::onEnter();
|
||||
if (_positionType == PositionType::PERCENT
|
||||
|| _sizeType == SizeType::PERCENT) {
|
||||
if (_parent) {
|
||||
Helper::doLayout(_parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Widget::onExit()
|
||||
|
@ -283,7 +278,30 @@ void Widget::setContentSize(const cocos2d::Size &contentSize)
|
|||
{
|
||||
_contentSize = getVirtualRendererSize();
|
||||
}
|
||||
|
||||
if (_running)
|
||||
{
|
||||
Widget* widgetParent = getWidgetParent();
|
||||
Size pSize;
|
||||
if (widgetParent)
|
||||
{
|
||||
pSize = widgetParent->getContentSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
pSize = _parent->getContentSize();
|
||||
}
|
||||
float spx = 0.0f;
|
||||
float spy = 0.0f;
|
||||
if (pSize.width > 0.0f)
|
||||
{
|
||||
spx = _customSize.width / pSize.width;
|
||||
}
|
||||
if (pSize.height > 0.0f)
|
||||
{
|
||||
spy = _customSize.height / pSize.height;
|
||||
}
|
||||
_sizePercent = Vec2(spx, spy);
|
||||
}
|
||||
onSizeChanged();
|
||||
}
|
||||
|
||||
|
@ -294,15 +312,29 @@ void Widget::setSize(const Size &size)
|
|||
|
||||
void Widget::setSizePercent(const Vec2 &percent)
|
||||
{
|
||||
|
||||
auto component = this->getOrCreateLayoutComponent();
|
||||
component->setUsingPercentContentSize(true);
|
||||
component->setPercentContentSize(percent);
|
||||
|
||||
if (nullptr != _parent)
|
||||
_sizePercent = percent;
|
||||
Size cSize = _customSize;
|
||||
if (_running)
|
||||
{
|
||||
Helper::doLayout(_parent);
|
||||
Widget* widgetParent = getWidgetParent();
|
||||
if (widgetParent)
|
||||
{
|
||||
cSize = Size(widgetParent->getContentSize().width * percent.x , widgetParent->getContentSize().height * percent.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
cSize = Size(_parent->getContentSize().width * percent.x , _parent->getContentSize().height * percent.y);
|
||||
}
|
||||
}
|
||||
if (_ignoreSize)
|
||||
{
|
||||
this->setContentSize(getVirtualRendererSize());
|
||||
}
|
||||
else
|
||||
{
|
||||
this->setContentSize(cSize);
|
||||
}
|
||||
_customSize = cSize;
|
||||
}
|
||||
|
||||
void Widget::updateSizeAndPosition()
|
||||
|
@ -387,17 +419,6 @@ void Widget::updateSizeAndPosition(const cocos2d::Size &parentSize)
|
|||
void Widget::setSizeType(SizeType type)
|
||||
{
|
||||
_sizeType = type;
|
||||
|
||||
auto component = this->getOrCreateLayoutComponent();
|
||||
|
||||
if (_sizeType == Widget::SizeType::PERCENT)
|
||||
{
|
||||
component->setUsingPercentContentSize(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
component->setUsingPercentContentSize(false);
|
||||
}
|
||||
}
|
||||
|
||||
Widget::SizeType Widget::getSizeType() const
|
||||
|
@ -445,9 +466,7 @@ const Size& Widget::getCustomSize() const
|
|||
|
||||
const Vec2& Widget::getSizePercent()
|
||||
{
|
||||
auto component = this->getOrCreateLayoutComponent();
|
||||
|
||||
return component->getPercentContentSize();
|
||||
return _sizePercent;
|
||||
}
|
||||
|
||||
Vec2 Widget::getWorldPosition()const
|
||||
|
@ -462,7 +481,14 @@ Node* Widget::getVirtualRenderer()
|
|||
|
||||
void Widget::onSizeChanged()
|
||||
{
|
||||
Helper::doLayout(this);
|
||||
for (auto& child : getChildren())
|
||||
{
|
||||
Widget* widgetChild = dynamic_cast<Widget*>(child);
|
||||
if (widgetChild)
|
||||
{
|
||||
widgetChild->updateSizeAndPosition();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Size Widget::getVirtualRendererSize() const
|
||||
|
@ -914,36 +940,47 @@ void Widget::interceptTouchEvent(cocos2d::ui::Widget::TouchEventType event, coco
|
|||
|
||||
void Widget::setPosition(const Vec2 &pos)
|
||||
{
|
||||
if (_running)
|
||||
{
|
||||
Widget* widgetParent = getWidgetParent();
|
||||
if (widgetParent)
|
||||
{
|
||||
Size pSize = widgetParent->getContentSize();
|
||||
if (pSize.width <= 0.0f || pSize.height <= 0.0f)
|
||||
{
|
||||
_positionPercent = Vec2::ZERO;
|
||||
}
|
||||
else
|
||||
{
|
||||
_positionPercent = Vec2(pos.x / pSize.width, pos.y / pSize.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
ProtectedNode::setPosition(pos);
|
||||
_positionType = PositionType::ABSOLUTE;
|
||||
|
||||
}
|
||||
|
||||
void Widget::setPositionPercent(const Vec2 &percent)
|
||||
{
|
||||
this->setNormalizedPosition(percent);
|
||||
_positionType = PositionType::PERCENT;
|
||||
_positionPercent = percent;
|
||||
if (_running)
|
||||
{
|
||||
Widget* widgetParent = getWidgetParent();
|
||||
if (widgetParent)
|
||||
{
|
||||
Size parentSize = widgetParent->getContentSize();
|
||||
Vec2 absPos = Vec2(parentSize.width * _positionPercent.x, parentSize.height * _positionPercent.y);
|
||||
setPosition(absPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const Vec2& Widget::getPositionPercent()const{
|
||||
return this->getNormalizedPosition();
|
||||
return _positionPercent;
|
||||
}
|
||||
|
||||
void Widget::setPositionType(PositionType type)
|
||||
{
|
||||
_positionType = type;
|
||||
if (type == Widget::PositionType::ABSOLUTE)
|
||||
{
|
||||
Vec2 oldPosition = this->getPosition();
|
||||
this->setPosition(this->getPosition() + Vec2(10,0));
|
||||
this->setPosition(oldPosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vec2 oldNormalizedPosition = this->getNormalizedPosition();
|
||||
this->setNormalizedPosition(oldNormalizedPosition + Vec2(0.2,0.1));
|
||||
this->setNormalizedPosition(oldNormalizedPosition);
|
||||
}
|
||||
}
|
||||
|
||||
Widget::PositionType Widget::getPositionType() const
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
46880B7C19C43A67006E1F66 /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 46880B7619C43A67006E1F66 /* CloseNormal.png */; };
|
||||
46880B7D19C43A67006E1F66 /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 46880B7719C43A67006E1F66 /* CloseSelected.png */; };
|
||||
46880B7E19C43A67006E1F66 /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 46880B7719C43A67006E1F66 /* CloseSelected.png */; };
|
||||
46880B7F19C43A67006E1F66 /* Marker Felt.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 46880B7919C43A67006E1F66 /* Marker Felt.ttf */; };
|
||||
46880B8019C43A67006E1F66 /* Marker Felt.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 46880B7919C43A67006E1F66 /* Marker Felt.ttf */; };
|
||||
46880B8119C43A67006E1F66 /* HelloWorld.png in Resources */ = {isa = PBXBuildFile; fileRef = 46880B7A19C43A67006E1F66 /* HelloWorld.png */; };
|
||||
46880B8219C43A67006E1F66 /* HelloWorld.png in Resources */ = {isa = PBXBuildFile; fileRef = 46880B7A19C43A67006E1F66 /* HelloWorld.png */; };
|
||||
46880B8819C43A87006E1F66 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46880B8419C43A87006E1F66 /* AppDelegate.cpp */; };
|
||||
|
@ -59,6 +57,8 @@
|
|||
50EF62A317ECD613001EB2F8 /* Icon-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 50EF62A117ECD613001EB2F8 /* Icon-50.png */; };
|
||||
521A8E6419F0C34300D177D7 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 521A8E6219F0C34300D177D7 /* Default-667h@2x.png */; };
|
||||
521A8E6519F0C34300D177D7 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 521A8E6319F0C34300D177D7 /* Default-736h@3x.png */; };
|
||||
521A8EA919F11F5000D177D7 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 521A8EA819F11F5000D177D7 /* fonts */; };
|
||||
521A8EAA19F11F5000D177D7 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 521A8EA819F11F5000D177D7 /* fonts */; };
|
||||
BF171245129291EC00B8313A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB012928DE900B8313A /* OpenGLES.framework */; };
|
||||
BF1712471292920000B8313A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB412928DE900B8313A /* libz.dylib */; };
|
||||
BF1C47F01293687400B63C5D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF1C47EA1293683800B63C5D /* QuartzCore.framework */; };
|
||||
|
@ -109,7 +109,6 @@
|
|||
3EACC98E19EE6D4300EB3C5E /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "res"; sourceTree = "<group>"; };
|
||||
46880B7619C43A67006E1F66 /* CloseNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseNormal.png; sourceTree = "<group>"; };
|
||||
46880B7719C43A67006E1F66 /* CloseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseSelected.png; sourceTree = "<group>"; };
|
||||
46880B7919C43A67006E1F66 /* Marker Felt.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Marker Felt.ttf"; sourceTree = "<group>"; };
|
||||
46880B7A19C43A67006E1F66 /* HelloWorld.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = HelloWorld.png; sourceTree = "<group>"; };
|
||||
46880B8419C43A87006E1F66 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = "<group>"; };
|
||||
46880B8519C43A87006E1F66 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
|
@ -149,6 +148,7 @@
|
|||
50EF62A117ECD613001EB2F8 /* Icon-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-50.png"; sourceTree = "<group>"; };
|
||||
521A8E6219F0C34300D177D7 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = "<group>"; };
|
||||
521A8E6319F0C34300D177D7 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = "<group>"; };
|
||||
521A8EA819F11F5000D177D7 /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = fonts; sourceTree = "<group>"; };
|
||||
BF170DB012928DE900B8313A /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
|
||||
BF170DB412928DE900B8313A /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
|
||||
BF1C47EA1293683800B63C5D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
||||
|
@ -270,24 +270,16 @@
|
|||
46880B7519C43A67006E1F66 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
521A8EA819F11F5000D177D7 /* fonts */,
|
||||
3EACC98E19EE6D4300EB3C5E /* res */,
|
||||
46880B7619C43A67006E1F66 /* CloseNormal.png */,
|
||||
46880B7719C43A67006E1F66 /* CloseSelected.png */,
|
||||
46880B7819C43A67006E1F66 /* fonts */,
|
||||
46880B7A19C43A67006E1F66 /* HelloWorld.png */,
|
||||
);
|
||||
name = Resources;
|
||||
path = ../Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
46880B7819C43A67006E1F66 /* fonts */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
46880B7919C43A67006E1F66 /* Marker Felt.ttf */,
|
||||
);
|
||||
path = fonts;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
46880B8319C43A87006E1F66 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -457,9 +449,9 @@
|
|||
5087E77D17EB970100C73F5D /* Default-568h@2x.png in Resources */,
|
||||
5087E78517EB970100C73F5D /* Icon-72.png in Resources */,
|
||||
521A8E6519F0C34300D177D7 /* Default-736h@3x.png in Resources */,
|
||||
521A8EA919F11F5000D177D7 /* fonts in Resources */,
|
||||
50EF62A317ECD613001EB2F8 /* Icon-50.png in Resources */,
|
||||
5087E78017EB970100C73F5D /* Icon-114.png in Resources */,
|
||||
46880B7F19C43A67006E1F66 /* Marker Felt.ttf in Resources */,
|
||||
50EF62A217ECD613001EB2F8 /* Icon-29.png in Resources */,
|
||||
50EF629617ECD46A001EB2F8 /* Icon-40.png in Resources */,
|
||||
5087E78217EB970100C73F5D /* Icon-144.png in Resources */,
|
||||
|
@ -478,9 +470,9 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
46880B8219C43A67006E1F66 /* HelloWorld.png in Resources */,
|
||||
46880B8019C43A67006E1F66 /* Marker Felt.ttf in Resources */,
|
||||
503AE0F817EB97AB00D1A890 /* Icon.icns in Resources */,
|
||||
3EACC99019EE6D4300EB3C5E /* res in Resources */,
|
||||
521A8EAA19F11F5000D177D7 /* fonts in Resources */,
|
||||
46880B7C19C43A67006E1F66 /* CloseNormal.png in Resources */,
|
||||
46880B7E19C43A67006E1F66 /* CloseSelected.png in Resources */,
|
||||
);
|
||||
|
|
|
@ -979,12 +979,16 @@ std::string ClippingToRenderTextureTest::subtitle() const
|
|||
void ClippingToRenderTextureTest::setup()
|
||||
{
|
||||
auto button = MenuItemFont::create("Reproduce bug", [&](Ref *sender) {
|
||||
std::vector<Node*> nodes;
|
||||
enumerateChildren("remove me [0-9]", [&](Node *node) {
|
||||
this->removeChild(node);
|
||||
this->reproduceBug();
|
||||
nodes.push_back(node);
|
||||
return false;
|
||||
});
|
||||
for (auto node : nodes)
|
||||
{
|
||||
this->removeChild(node);
|
||||
}
|
||||
);
|
||||
this->reproduceBug();
|
||||
});
|
||||
|
||||
auto s = Director::getInstance()->getWinSize();
|
||||
|
|
|
@ -186,7 +186,7 @@ function TestActionTimeline.extend(target)
|
|||
end
|
||||
|
||||
function TestActionTimeline:onEnter()
|
||||
cc.SpriteFrameCache:getInstance():addSpriteFramesWithFile("armature/Cowboy0.plist", "armature/Cowboy0.png")
|
||||
cc.SpriteFrameCache:getInstance():addSpriteFrames("armature/Cowboy0.plist", "armature/Cowboy0.png")
|
||||
|
||||
local node = cc.CSLoader:createNode("ActionTimeline/boy_1.csb")
|
||||
local action = cc.CSLoader:createTimeline("ActionTimeline/boy_1.csb")
|
||||
|
@ -239,7 +239,7 @@ function TestChangePlaySection.extend(target)
|
|||
end
|
||||
|
||||
function TestChangePlaySection:onEnter()
|
||||
cc.SpriteFrameCache:getInstance():addSpriteFramesWithFile("armature/Cowboy0.plist", "armature/Cowboy0.png")
|
||||
cc.SpriteFrameCache:getInstance():addSpriteFrames("armature/Cowboy0.plist", "armature/Cowboy0.png")
|
||||
|
||||
local node = cc.CSLoader:createNode("ActionTimeline/boy_1.csb")
|
||||
local action = cc.CSLoader:createTimeline("ActionTimeline/boy_1.csb")
|
||||
|
@ -306,7 +306,7 @@ function TestTimelineFrameEvent.extend(target)
|
|||
end
|
||||
|
||||
function TestTimelineFrameEvent:onEnter()
|
||||
cc.SpriteFrameCache:getInstance():addSpriteFramesWithFile("armature/Cowboy0.plist", "armature/Cowboy0.png")
|
||||
cc.SpriteFrameCache:getInstance():addSpriteFrames("armature/Cowboy0.plist", "armature/Cowboy0.png")
|
||||
|
||||
local node = cc.CSLoader:createNode("ActionTimeline/boy_1.csb")
|
||||
local action = cc.CSLoader:createTimeline("ActionTimeline/boy_1.csb")
|
||||
|
@ -374,7 +374,7 @@ function TestTimelinePerformance.extend(target)
|
|||
end
|
||||
|
||||
function TestTimelinePerformance:onEnter()
|
||||
cc.SpriteFrameCache:getInstance():addSpriteFramesWithFile("armature/Cowboy0.plist", "armature/Cowboy0.png")
|
||||
cc.SpriteFrameCache:getInstance():addSpriteFrames("armature/Cowboy0.plist", "armature/Cowboy0.png")
|
||||
|
||||
for i = 1,100 do
|
||||
local node = cc.CSLoader:createNode("ActionTimeline/boy_1.csb")
|
||||
|
|
|
@ -93,7 +93,7 @@ end
|
|||
|
||||
function UIButtonTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UIButton_Editor/UIButton_Editor_1.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UIButton_Editor/windows_UIButton_Editor_1.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
|
||||
|
@ -161,7 +161,7 @@ end
|
|||
|
||||
function UICheckBoxEditorTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UICheckBox_Editor/ui_checkbox_editor_1.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UICheckBox_Editor/windows_ui_checkbox_editor_1.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
|
||||
|
@ -233,7 +233,7 @@ end
|
|||
|
||||
function UISliderEditorTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UISlider_Editor/ui_slider_editor_1.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UISlider_Editor/windows_ui_slider_editor_1.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
|
||||
|
@ -289,7 +289,7 @@ end
|
|||
|
||||
function UIImageViewEditorTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UIImageView_Editor/ui_ImageView_editor_1.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UIImageView_Editor/windows_ui_ImageView_editor_1.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
end
|
||||
|
@ -343,7 +343,7 @@ end
|
|||
|
||||
function LoadingBarEditorTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UILoadingBar_Editor/ui_loadingbar_editor_1.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UILoadingBar_Editor/windows_ui_loadingbar_editor_1.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
|
||||
|
@ -410,7 +410,7 @@ end
|
|||
|
||||
function LabelAtalsEditorTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UILabelAtlas_Editor/ui_labelatlas_editor_1.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UILabelAtlas_Editor/windows_ui_labelatlas_editor_1.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
end
|
||||
|
@ -458,7 +458,7 @@ end
|
|||
|
||||
function LabelEditorTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UILabel_Editor/ui_label_editor_1.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UILabel_Editor/windows_ui_label_editor_1.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
end
|
||||
|
@ -506,7 +506,7 @@ end
|
|||
|
||||
function LabelBMFontEditorTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UILabelBMFont_Editor/ui_labelbmfont_editor_1.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UILabelBMFont_Editor/windows_ui_labelbmfont_editor_1.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
end
|
||||
|
@ -575,7 +575,7 @@ end
|
|||
|
||||
function TextFieldEditorTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UITextField_Editor/ui_textfield_editor_1.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UITextField_Editor/windows_ui_textfield_editor_1.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
|
||||
|
@ -632,7 +632,7 @@ end
|
|||
|
||||
function LayoutEditorTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/ui_layout_editor_1.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/windows_ui_layout_editor_1.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
end
|
||||
|
@ -680,7 +680,7 @@ end
|
|||
|
||||
function ScrollViewEditorTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/ui_scrollview_editor_1.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/windows_ui_scrollview_editor_1.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
end
|
||||
|
@ -728,7 +728,7 @@ end
|
|||
|
||||
function PageViewEditorTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UIPageView_Editor/ui_pageview_editor_1.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UIPageView_Editor/windows_ui_pageview_editor_1.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
end
|
||||
|
@ -781,7 +781,7 @@ end
|
|||
|
||||
function ListViewEditorTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/ui_listview_editor_1.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/windows_ui_listview_editor_1.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
end
|
||||
|
@ -838,7 +838,7 @@ end
|
|||
|
||||
function WidgetAddNodeEditorTest:initExtend()
|
||||
self:init()
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UIWidgetAddNode_Editor/ui_widget_add_node_editor.csb")
|
||||
self._layout = ccs.GUIReader:getInstance():widgetFromBinaryFile("cocosui/UIEditorTest/UIWidgetAddNode_Editor/windows_ui_widget_add_node_editor.csb")
|
||||
self._uiLayer:addChild(self._layout)
|
||||
self:configureGUIScene()
|
||||
end
|
||||
|
|
|
@ -0,0 +1,241 @@
|
|||
local LightTest = class("LightTest",function()
|
||||
return cc.Layer:create()
|
||||
end)
|
||||
|
||||
function LightTest:ctor()
|
||||
|
||||
local function onNodeEvent(event)
|
||||
if event == "enter" then
|
||||
self:init()
|
||||
elseif event == "exit" then
|
||||
self:unscheduleUpdate()
|
||||
end
|
||||
end
|
||||
|
||||
self:registerScriptHandler(onNodeEvent)
|
||||
end
|
||||
|
||||
function LightTest:init()
|
||||
|
||||
self:addSprite()
|
||||
self:addLights()
|
||||
|
||||
local s = cc.Director:getInstance():getWinSize()
|
||||
local camera = cc.Camera:createPerspective(60, s.width/s.height, 1.0, 1000.0)
|
||||
camera:setCameraFlag(cc.CameraFlag.USER1)
|
||||
camera:setPosition3D(cc.vec3(0.0, 100, 100))
|
||||
camera:lookAt(cc.vec3(0.0, 0.0, 0.0), cc.vec3(0.0, 1.0, 0.0))
|
||||
self:addChild(camera)
|
||||
|
||||
local ttfConfig = {}
|
||||
ttfConfig.fontFilePath = "fonts/arial.ttf"
|
||||
ttfConfig.fontSize = 15
|
||||
|
||||
local ambientLightLabel = cc.Label:createWithTTF(ttfConfig,"Ambient Light ON")
|
||||
local menuItem0 = cc.MenuItemLabel:create(ambientLightLabel)
|
||||
menuItem0:registerScriptTapHandler(function (tag, sender)
|
||||
local str = nil
|
||||
local isON = not self._ambientLight:isEnabled()
|
||||
if isON then
|
||||
str = "Ambient Light ON"
|
||||
else
|
||||
str = "Ambient Light OFF"
|
||||
end
|
||||
self._ambientLight:setEnabled(isON)
|
||||
menuItem0:setString(str)
|
||||
end)
|
||||
|
||||
|
||||
local directionalLightLabel = cc.Label:createWithTTF(ttfConfig,"Directional Light OFF")
|
||||
local menuItem1 = cc.MenuItemLabel:create(directionalLightLabel)
|
||||
menuItem1:registerScriptTapHandler(function (tag, sender)
|
||||
local str = nil
|
||||
local isON = not self._directionalLight:isEnabled()
|
||||
if isON then
|
||||
str = "Directional Light ON"
|
||||
else
|
||||
str = "Directional Light OFF"
|
||||
end
|
||||
self._directionalLight:setEnabled(isON)
|
||||
menuItem1:setString(str)
|
||||
end)
|
||||
|
||||
|
||||
local pointLightLabel = cc.Label:createWithTTF(ttfConfig,"Point Light OFF")
|
||||
local menuItem2 = cc.MenuItemLabel:create(pointLightLabel)
|
||||
menuItem2:registerScriptTapHandler(function (tag, sender)
|
||||
local str = nil
|
||||
local isON = not self._pointLight:isEnabled()
|
||||
if isON then
|
||||
str = "Point Light ON"
|
||||
else
|
||||
str = "Point Light OFF"
|
||||
end
|
||||
self._pointLight:setEnabled(isON)
|
||||
menuItem2:setString(str)
|
||||
end)
|
||||
|
||||
local spotLightLabel = cc.Label:createWithTTF(ttfConfig,"Spot Light OFF")
|
||||
local menuItem3 = cc.MenuItemLabel:create(spotLightLabel)
|
||||
menuItem3:registerScriptTapHandler(function (tag, sender)
|
||||
local str = nil
|
||||
local isON = not self._spotLight:isEnabled()
|
||||
if isON then
|
||||
str = "Spot Light ON"
|
||||
else
|
||||
str = "Spot Light OFF"
|
||||
end
|
||||
self._spotLight:setEnabled(isON)
|
||||
menuItem3:setString(str)
|
||||
end)
|
||||
|
||||
|
||||
local menu = cc.Menu:create(menuItem0, menuItem1, menuItem2, menuItem3)
|
||||
menu:setPosition(cc.p(0, 0))
|
||||
menuItem0:setAnchorPoint(cc.p(0.0 ,1.0))
|
||||
menuItem0:setPosition( cc.p(VisibleRect:left().x, VisibleRect:top().y-50) )
|
||||
menuItem1:setAnchorPoint(cc.p(0.0, 1.0))
|
||||
menuItem1:setPosition( cc.p(VisibleRect:left().x, VisibleRect:top().y-100) )
|
||||
menuItem2:setAnchorPoint(cc.p(0.0, 1.0))
|
||||
menuItem2:setPosition( cc.p(VisibleRect:left().x, VisibleRect:top().y -150))
|
||||
menuItem3:setAnchorPoint(cc.p(0.0, 1.0))
|
||||
menuItem3:setPosition( cc.p(VisibleRect:left().x, VisibleRect:top().y -200))
|
||||
self:addChild(menu)
|
||||
|
||||
local angleDelta = 0.0
|
||||
local function update(delta)
|
||||
if nil ~= self._directionalLight then
|
||||
self._directionalLight:setRotation3D(cc.vec3(-45.0, -angleDelta * 57.29577951, 0.0))
|
||||
end
|
||||
|
||||
if nil ~= self._pointLight then
|
||||
self._pointLight:setPositionX(100.0 * math.cos(angleDelta + 2.0 * delta))
|
||||
self._pointLight:setPositionY(100.0)
|
||||
self._pointLight:setPositionZ(100.0 * math.sin(angleDelta + 2.0 * delta))
|
||||
end
|
||||
|
||||
if nil ~= self._spotLight then
|
||||
self._spotLight:setPositionX(100.0 * math.cos(angleDelta + 4.0 * delta))
|
||||
self._spotLight:setPositionY(100.0)
|
||||
self._spotLight:setPositionZ(100.0 * math.sin(angleDelta + 4.0 * delta))
|
||||
self._spotLight:setDirection(cc.vec3(-math.cos(angleDelta + 4.0 * delta), -1.0, -math.sin(angleDelta + 4.0 * delta)))
|
||||
end
|
||||
|
||||
angleDelta = angleDelta + delta
|
||||
end
|
||||
|
||||
self:scheduleUpdateWithPriorityLua(update,0)
|
||||
end
|
||||
|
||||
function LightTest:addSprite()
|
||||
local s = cc.Director:getInstance():getWinSize()
|
||||
|
||||
local fileName = "Sprite3DTest/orc.c3b"
|
||||
local sprite1 = cc.Sprite3D:create(fileName)
|
||||
sprite1:setRotation3D(cc.vec3(0.0, 180.0, 0.0))
|
||||
sprite1:setPosition(cc.p(0.0, 0.0))
|
||||
sprite1:setScale(2.0)
|
||||
local sp = cc.Sprite3D:create("Sprite3DTest/axe.c3b")
|
||||
sprite1:getAttachNode("Bip001 R Hand"):addChild(sp)
|
||||
local animation = cc.Animation3D:create(fileName)
|
||||
if nil ~=animation then
|
||||
local animate = cc.Animate3D:create(animation)
|
||||
sprite1:runAction(cc.RepeatForever:create(animate))
|
||||
end
|
||||
self:addChild(sprite1)
|
||||
sprite1:setCameraMask(2)
|
||||
|
||||
local fileName = "Sprite3DTest/sphere.c3b"
|
||||
local sprite2 = cc.Sprite3D:create(fileName)
|
||||
sprite2:setPosition(cc.p(30.0, 0.0))
|
||||
self:addChild(sprite2)
|
||||
sprite2:setCameraMask(2)
|
||||
|
||||
|
||||
local fileName = "Sprite3DTest/sphere.c3b"
|
||||
local sprite3 = cc.Sprite3D:create(fileName)
|
||||
sprite3:setScale(0.5)
|
||||
sprite3:setPosition(cc.p(-50.0, 0.0))
|
||||
self:addChild(sprite3)
|
||||
sprite3:setCameraMask(2)
|
||||
|
||||
local fileName = "Sprite3DTest/sphere.c3b"
|
||||
local sprite4 = cc.Sprite3D:create(fileName)
|
||||
sprite4:setScale(0.5)
|
||||
sprite4:setPosition(cc.p(-30.0, 10.0))
|
||||
self:addChild(sprite4)
|
||||
sprite4:setCameraMask(2)
|
||||
end
|
||||
|
||||
function LightTest:addLights()
|
||||
local s = cc.Director:getInstance():getWinSize()
|
||||
self._ambientLight = cc.AmbientLight:create(cc.c3b(200, 200, 200))
|
||||
self._ambientLight:setEnabled(true)
|
||||
self:addChild(self._ambientLight)
|
||||
self._ambientLight:setCameraMask(2)
|
||||
|
||||
self._directionalLight = cc.DirectionLight:create(cc.vec3(-1.0, -1.0, 0.0), cc.c3b(200, 200, 200))
|
||||
self._directionalLight:setEnabled(false)
|
||||
self:addChild(self._directionalLight)
|
||||
self._directionalLight:setCameraMask(2)
|
||||
|
||||
self._pointLight = cc.PointLight:create(cc.vec3(0.0, 0.0, 0.0), cc.c3b(200, 200, 200), 10000.0)
|
||||
self._pointLight:setEnabled(false)
|
||||
self:addChild(self._pointLight)
|
||||
self._pointLight:setCameraMask(2)
|
||||
|
||||
self._spotLight = cc.SpotLight:create(cc.vec3(-1.0, -1.0, 0.0), cc.vec3(0.0, 0.0, 0.0), cc.c3b(200, 200, 200), 0.0, 0.5, 10000.0)
|
||||
self._spotLight:setEnabled(false)
|
||||
self:addChild(self._spotLight)
|
||||
self._spotLight:setCameraMask(2)
|
||||
|
||||
local tintto1 = cc.TintTo:create(4, 0, 0, 255)
|
||||
local tintto2 = cc.TintTo:create(4, 0, 255, 0)
|
||||
local tintto3 = cc.TintTo:create(4, 255, 0, 0)
|
||||
local tintto4 = cc.TintTo:create(4, 255, 255, 255)
|
||||
local seq = cc.Sequence:create(tintto1,tintto2, tintto3, tintto4)
|
||||
self._ambientLight:runAction(cc.RepeatForever:create(seq))
|
||||
|
||||
tintto1 = cc.TintTo:create(4, 255, 0, 0)
|
||||
tintto2 = cc.TintTo:create(4, 0, 255, 0)
|
||||
tintto3 = cc.TintTo:create(4, 0, 0, 255)
|
||||
tintto4 = cc.TintTo:create(4, 255, 255, 255)
|
||||
seq = cc.Sequence:create(tintto1,tintto2, tintto3, tintto4)
|
||||
self._directionalLight:runAction(cc.RepeatForever:create(seq))
|
||||
|
||||
|
||||
tintto1 = cc.TintTo:create(4, 255, 0, 0)
|
||||
tintto2 = cc.TintTo:create(4, 0, 255, 0)
|
||||
tintto3 = cc.TintTo:create(4, 0, 0, 255)
|
||||
tintto4 = cc.TintTo:create(4, 255, 255, 255)
|
||||
seq = cc.Sequence:create(tintto2, tintto1, tintto3, tintto4)
|
||||
self._pointLight:runAction(cc.RepeatForever:create(seq))
|
||||
|
||||
tintto1 = cc.TintTo:create(4, 255, 0, 0)
|
||||
tintto2 = cc.TintTo:create(4, 0, 255, 0)
|
||||
tintto3 = cc.TintTo:create(4, 0, 0, 255)
|
||||
tintto4 = cc.TintTo:create(4, 255, 255, 255)
|
||||
seq = cc.Sequence:create(tintto3, tintto2, tintto1, tintto4)
|
||||
self._spotLight:runAction(cc.RepeatForever:create(seq))
|
||||
end
|
||||
|
||||
function LightTest.create( ... )
|
||||
local layer = LightTest.new()
|
||||
Helper.initWithLayer(layer)
|
||||
Helper.titleLabel:setString("Light Test")
|
||||
return layer
|
||||
end
|
||||
|
||||
function LightTestMain()
|
||||
cclog("LightTestMain")
|
||||
local scene = cc.Scene:create()
|
||||
|
||||
Helper.createFunctionTable =
|
||||
{
|
||||
LightTest.create,
|
||||
}
|
||||
|
||||
scene:addChild(LightTest.create(), 0)
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
return scene
|
||||
end
|
|
@ -27,6 +27,7 @@ require "KeypadTest/KeypadTest"
|
|||
require "LabelTest/LabelTest"
|
||||
require "LabelTestNew/LabelTestNew"
|
||||
require "LayerTest/LayerTest"
|
||||
require "LightTest/LightTest"
|
||||
require "MenuTest/MenuTest"
|
||||
require "MotionStreakTest/MotionStreakTest"
|
||||
require "NewEventDispatcherTest/NewEventDispatcherTest"
|
||||
|
@ -99,6 +100,7 @@ local _allTests = {
|
|||
{ isSupported = true, name = "LabelTest" , create_func = LabelTest },
|
||||
{ isSupported = true, name = "LabelTestNew" , create_func = LabelTestNew },
|
||||
{ isSupported = true, name = "LayerTest" , create_func = LayerTestMain },
|
||||
{ isSupported = true, name = "LightTest" , create_func = LightTestMain },
|
||||
{ isSupported = true, name = "LuaBridgeTest" , create_func = LuaBridgeMainTest },
|
||||
{ isSupported = true, name = "MenuTest" , create_func = MenuTestMain },
|
||||
{ isSupported = true, name = "MotionStreakTest" , create_func = MotionStreakTest },
|
||||
|
|
|
@ -26,7 +26,7 @@ headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/2d/CCProtectedNode.h %
|
|||
|
||||
# what classes to produce code for. You can use regular expressions here. When testing the regular
|
||||
# expression, it will be enclosed in "^$", like this: "^Menu*$".
|
||||
classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* .*TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewImpl GLView Image Event(?!.*(Physics).*).* Component ProtectedNode Console GLProgramCache GLProgramState Device CSLoader ClippingRectangleNode
|
||||
classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* .*TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewImpl GLView Image Event(?!.*(Physics).*).* Component ProtectedNode Console GLProgramCache GLProgramState Device CSLoader ClippingRectangleNode .*Light$
|
||||
|
||||
# what should we skip? in the format ClassName::[function function]
|
||||
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
|
||||
|
|
Loading…
Reference in New Issue