From 084671fa1c55f37f982ccd23a9d606abfb9ef723 Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Thu, 17 May 2018 12:22:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=B7=A5=E5=8E=82=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E6=A8=A1=E5=BC=8F=E7=AE=A1=E7=90=86=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/Action/Animate.cpp | 16 ++- core/Action/CallFunc.cpp | 9 +- core/Action/Delay.cpp | 9 +- core/Action/JumpBy.cpp | 9 +- core/Action/JumpTo.cpp | 7 +- core/Action/Loop.cpp | 9 +- core/Action/MoveBy.cpp | 9 +- core/Action/MoveTo.cpp | 7 +- core/Action/OpacityBy.cpp | 9 +- core/Action/OpacityTo.cpp | 7 +- core/Action/RotateBy.cpp | 9 +- core/Action/RotateTo.cpp | 7 +- core/Action/ScaleBy.cpp | 14 ++- core/Action/ScaleTo.cpp | 12 +- core/Action/Sequence.cpp | 14 ++- core/Action/Spawn.cpp | 14 ++- core/Collider/Collider.cpp | 2 +- core/Collider/ColliderCircle.cpp | 16 +++ core/Collider/ColliderEllipse.cpp | 16 +++ core/Collider/ColliderRect.cpp | 18 ++- core/Common/Animation.cpp | 28 ++++- core/Common/Image.cpp | 45 ++++--- core/Common/Scene.cpp | 7 +- core/Node/Button.cpp | 25 ++++ core/Node/ButtonToggle.cpp | 25 ++++ core/Node/Menu.cpp | 10 ++ core/Node/Node.cpp | 13 +- core/Node/Shape/Circle.cpp | 16 ++- core/Node/Shape/Ellipse.cpp | 17 ++- core/Node/Shape/Rect.cpp | 27 ++-- core/Node/Shape/RoundRect.cpp | 31 +++-- core/Node/Shape/Shape.cpp | 2 +- core/Node/Sprite.cpp | 34 +++++- core/Node/Text.cpp | 25 ++++ core/Tool/Music.cpp | 4 +- core/Transition/TransitionEmerge.cpp | 5 + core/Transition/TransitionFade.cpp | 10 ++ core/Transition/TransitionMove.cpp | 5 + core/e2daction.h | 139 +++++++++++++++++---- core/e2dcollider.h | 66 +++++++--- core/e2dcommon.h | 92 +++++++++++--- core/e2dnode.h | 176 ++++++++++++++++++++++++--- core/e2dshape.h | 65 +++++----- core/e2dtool.h | 3 +- core/e2dtransition.h | 26 +++- 45 files changed, 900 insertions(+), 209 deletions(-) diff --git a/core/Action/Animate.cpp b/core/Action/Animate.cpp index 774c8bdc..6fa85f00 100644 --- a/core/Action/Animate.cpp +++ b/core/Action/Animate.cpp @@ -13,6 +13,16 @@ e2d::Animate::Animate(Animation * animation) this->setAnimation(animation); } +e2d::Animate * e2d::Animate::create() +{ + return Create(); +} + +e2d::Animate * e2d::Animate::create(Animation * animation) +{ + return Create(animation); +} + e2d::Animate::~Animate() { } @@ -97,7 +107,7 @@ e2d::Animate * e2d::Animate::clone() const { if (_animation) { - return new (std::nothrow) Animate(_animation); + return Create(_animation); } return nullptr; } @@ -121,10 +131,10 @@ e2d::Animate * e2d::Animate::reverse() const } } - auto animation = new (std::nothrow) Animation(_animation->getInterval(), frames); + auto animation = Create(_animation->getInterval(), frames); if (animation) { - return new (std::nothrow) Animate(animation); + return Create(animation); } } return nullptr; diff --git a/core/Action/CallFunc.cpp b/core/Action/CallFunc.cpp index d13c3ca5..814b85ba 100644 --- a/core/Action/CallFunc.cpp +++ b/core/Action/CallFunc.cpp @@ -5,14 +5,19 @@ e2d::CallFunc::CallFunc(const Function& func) : { } +e2d::CallFunc * e2d::CallFunc::create(const Function & func) +{ + return Create(func); +} + e2d::CallFunc * e2d::CallFunc::clone() const { - return new (std::nothrow) CallFunc(_func); + return Create(_func); } e2d::CallFunc * e2d::CallFunc::reverse() const { - return new (std::nothrow) CallFunc(_func); + return Create(_func); } void e2d::CallFunc::_init() diff --git a/core/Action/Delay.cpp b/core/Action/Delay.cpp index 443b0ecb..ae393644 100644 --- a/core/Action/Delay.cpp +++ b/core/Action/Delay.cpp @@ -6,14 +6,19 @@ e2d::Delay::Delay(double duration) { } +e2d::Delay * e2d::Delay::create(double duration) +{ + return Create(duration); +} + e2d::Delay * e2d::Delay::clone() const { - return new (std::nothrow) Delay(_delay); + return Create(_delay); } e2d::Delay * e2d::Delay::reverse() const { - return new (std::nothrow) Delay(_delay); + return Create(_delay); } void e2d::Delay::reset() diff --git a/core/Action/JumpBy.cpp b/core/Action/JumpBy.cpp index c010fbe6..3abc1b52 100644 --- a/core/Action/JumpBy.cpp +++ b/core/Action/JumpBy.cpp @@ -8,14 +8,19 @@ e2d::JumpBy::JumpBy(double duration, const Vector & vec, double height, int jump { } +e2d::JumpBy * e2d::JumpBy::create(double duration, const Vector & vec, double height, int jumps) +{ + return Create(duration, vec, height, jumps); +} + e2d::JumpBy * e2d::JumpBy::clone() const { - return new (std::nothrow) JumpBy(_duration, _deltaPos, _height, _jumps); + return Create(_duration, _deltaPos, _height, _jumps); } e2d::JumpBy * e2d::JumpBy::reverse() const { - return new (std::nothrow) JumpBy(_duration, -_deltaPos, _height, _jumps); + return Create(_duration, -_deltaPos, _height, _jumps); } void e2d::JumpBy::_init() diff --git a/core/Action/JumpTo.cpp b/core/Action/JumpTo.cpp index 431b5b01..c9d76cba 100644 --- a/core/Action/JumpTo.cpp +++ b/core/Action/JumpTo.cpp @@ -6,9 +6,14 @@ e2d::JumpTo::JumpTo(double duration, const Point & pos, double height, int jumps { } +e2d::JumpTo * e2d::JumpTo::create(double duration, const Point & pos, double height, int jumps) +{ + return Create(duration, pos, height, jumps); +} + e2d::JumpTo * e2d::JumpTo::clone() const { - return new (std::nothrow) JumpTo(_duration, _endPos, _height, _jumps); + return Create(_duration, _endPos, _height, _jumps); } void e2d::JumpTo::_init() diff --git a/core/Action/Loop.cpp b/core/Action/Loop.cpp index efff147f..cd0f3f9e 100644 --- a/core/Action/Loop.cpp +++ b/core/Action/Loop.cpp @@ -15,6 +15,11 @@ e2d::Loop::Loop(Action * action, int times /* = -1 */) } } +e2d::Loop * e2d::Loop::create(Action * action, int times) +{ + return Create(action, times); +} + e2d::Loop::~Loop() { } @@ -23,7 +28,7 @@ e2d::Loop * e2d::Loop::clone() const { if (_action) { - return new (std::nothrow) Loop(_action->clone()); + return Create(_action->clone()); } else { @@ -33,7 +38,7 @@ e2d::Loop * e2d::Loop::clone() const e2d::Loop * e2d::Loop::reverse() const { - return new (std::nothrow) Loop(_action); + return Create(_action); } void e2d::Loop::_init() diff --git a/core/Action/MoveBy.cpp b/core/Action/MoveBy.cpp index 916605f4..c1c710ac 100644 --- a/core/Action/MoveBy.cpp +++ b/core/Action/MoveBy.cpp @@ -7,6 +7,11 @@ e2d::MoveBy::MoveBy(double duration, Vector vector) _deltaPos = vector; } +e2d::MoveBy * e2d::MoveBy::create(double duration, Vector vector) +{ + return Create(duration, vector); +} + void e2d::MoveBy::_init() { ActionGradual::_init(); @@ -29,10 +34,10 @@ void e2d::MoveBy::_update() e2d::MoveBy * e2d::MoveBy::clone() const { - return new (std::nothrow) MoveBy(_duration, _deltaPos); + return Create(_duration, _deltaPos); } e2d::MoveBy * e2d::MoveBy::reverse() const { - return new (std::nothrow) MoveBy(_duration, -_deltaPos); + return Create(_duration, -_deltaPos); } \ No newline at end of file diff --git a/core/Action/MoveTo.cpp b/core/Action/MoveTo.cpp index 24dc4530..b9b27538 100644 --- a/core/Action/MoveTo.cpp +++ b/core/Action/MoveTo.cpp @@ -6,9 +6,14 @@ e2d::MoveTo::MoveTo(double duration, Point pos) _endPos = pos; } +e2d::MoveTo * e2d::MoveTo::create(double duration, Point pos) +{ + return Create(duration, pos); +} + e2d::MoveTo * e2d::MoveTo::clone() const { - return new (std::nothrow) MoveTo(_duration, _endPos); + return Create(_duration, _endPos); } void e2d::MoveTo::_init() diff --git a/core/Action/OpacityBy.cpp b/core/Action/OpacityBy.cpp index 014ff06c..9e754765 100644 --- a/core/Action/OpacityBy.cpp +++ b/core/Action/OpacityBy.cpp @@ -7,6 +7,11 @@ e2d::OpacityBy::OpacityBy(double duration, double opacity) _deltaVal = opacity; } +e2d::OpacityBy * e2d::OpacityBy::create(double duration, double opacity) +{ + return Create(duration, opacity); +} + void e2d::OpacityBy::_init() { ActionGradual::_init(); @@ -29,10 +34,10 @@ void e2d::OpacityBy::_update() e2d::OpacityBy * e2d::OpacityBy::clone() const { - return new (std::nothrow) OpacityBy(_duration, _deltaVal); + return Create(_duration, _deltaVal); } e2d::OpacityBy * e2d::OpacityBy::reverse() const { - return new (std::nothrow) OpacityBy(_duration, -_deltaVal); + return Create(_duration, -_deltaVal); } \ No newline at end of file diff --git a/core/Action/OpacityTo.cpp b/core/Action/OpacityTo.cpp index 673f7345..56c5d973 100644 --- a/core/Action/OpacityTo.cpp +++ b/core/Action/OpacityTo.cpp @@ -7,9 +7,14 @@ e2d::OpacityTo::OpacityTo(double duration, double opacity) _endVal = opacity; } +e2d::OpacityTo * e2d::OpacityTo::create(double duration, double opacity) +{ + return Create(duration, opacity); +} + e2d::OpacityTo * e2d::OpacityTo::clone() const { - return new (std::nothrow) OpacityTo(_duration, _endVal); + return Create(_duration, _endVal); } void e2d::OpacityTo::_init() diff --git a/core/Action/RotateBy.cpp b/core/Action/RotateBy.cpp index eb294ffe..c839e2ad 100644 --- a/core/Action/RotateBy.cpp +++ b/core/Action/RotateBy.cpp @@ -7,6 +7,11 @@ e2d::RotateBy::RotateBy(double duration, double rotation) _deltaVal = rotation; } +e2d::RotateBy * e2d::RotateBy::create(double duration, double rotation) +{ + return Create(duration, rotation); +} + void e2d::RotateBy::_init() { ActionGradual::_init(); @@ -29,10 +34,10 @@ void e2d::RotateBy::_update() e2d::RotateBy * e2d::RotateBy::clone() const { - return new (std::nothrow) RotateBy(_duration, _deltaVal); + return Create(_duration, _deltaVal); } e2d::RotateBy * e2d::RotateBy::reverse() const { - return new (std::nothrow) RotateBy(_duration, -_deltaVal); + return Create(_duration, -_deltaVal); } \ No newline at end of file diff --git a/core/Action/RotateTo.cpp b/core/Action/RotateTo.cpp index 3726cd0c..e4846423 100644 --- a/core/Action/RotateTo.cpp +++ b/core/Action/RotateTo.cpp @@ -7,9 +7,14 @@ e2d::RotateTo::RotateTo(double duration, double rotation) _endVal = rotation; } +e2d::RotateTo * e2d::RotateTo::create(double duration, double rotation) +{ + return Create(duration, rotation); +} + e2d::RotateTo * e2d::RotateTo::clone() const { - return new (std::nothrow) RotateTo(_duration, _endVal); + return Create(_duration, _endVal); } void e2d::RotateTo::_init() diff --git a/core/Action/ScaleBy.cpp b/core/Action/ScaleBy.cpp index 88e42c0e..afb764ab 100644 --- a/core/Action/ScaleBy.cpp +++ b/core/Action/ScaleBy.cpp @@ -15,6 +15,16 @@ e2d::ScaleBy::ScaleBy(double duration, double scaleX, double scaleY) _deltaY = scaleY; } +e2d::ScaleBy * e2d::ScaleBy::create(double duration, double scale) +{ + return Create(duration, scale); +} + +e2d::ScaleBy * e2d::ScaleBy::create(double duration, double scaleX, double scaleY) +{ + return Create(duration, scaleX, scaleY); +} + void e2d::ScaleBy::_init() { ActionGradual::_init(); @@ -38,10 +48,10 @@ void e2d::ScaleBy::_update() e2d::ScaleBy * e2d::ScaleBy::clone() const { - return new (std::nothrow) ScaleBy(_duration, _deltaX, _deltaY); + return Create(_duration, _deltaX, _deltaY); } e2d::ScaleBy * e2d::ScaleBy::reverse() const { - return new (std::nothrow) ScaleBy(_duration, -_deltaX, -_deltaY); + return Create(_duration, -_deltaX, -_deltaY); } \ No newline at end of file diff --git a/core/Action/ScaleTo.cpp b/core/Action/ScaleTo.cpp index 0c004efb..c64f9e74 100644 --- a/core/Action/ScaleTo.cpp +++ b/core/Action/ScaleTo.cpp @@ -14,9 +14,19 @@ e2d::ScaleTo::ScaleTo(double duration, double scaleX, double scaleY) _endScaleY = scaleY; } +e2d::ScaleTo * e2d::ScaleTo::create(double duration, double scale) +{ + return Create(duration, scale); +} + +e2d::ScaleTo * e2d::ScaleTo::create(double duration, double scaleX, double scaleY) +{ + return Create(duration, scaleX, scaleY); +} + e2d::ScaleTo * e2d::ScaleTo::clone() const { - return new (std::nothrow) ScaleTo(_duration, _endScaleX, _endScaleY); + return Create(_duration, _endScaleX, _endScaleY); } void e2d::ScaleTo::_init() diff --git a/core/Action/Sequence.cpp b/core/Action/Sequence.cpp index 5a5b11b4..eeece5cb 100644 --- a/core/Action/Sequence.cpp +++ b/core/Action/Sequence.cpp @@ -11,6 +11,16 @@ e2d::Sequence::Sequence(const std::vector& actions) this->add(actions); } +e2d::Sequence * e2d::Sequence::create() +{ + return Create(); +} + +e2d::Sequence * e2d::Sequence::create(const std::vector& actions) +{ + return Create(actions); +} + e2d::Sequence::~Sequence() { } @@ -97,7 +107,7 @@ void e2d::Sequence::add(const std::vector& actions) e2d::Sequence * e2d::Sequence::clone() const { - auto sequence = new (std::nothrow) Sequence(); + auto sequence = Create(); for (const auto& action : _actions) { if (action) @@ -110,7 +120,7 @@ e2d::Sequence * e2d::Sequence::clone() const e2d::Sequence * e2d::Sequence::reverse() const { - auto sequence = new (std::nothrow) Sequence(); + auto sequence = Create(); if (!_actions.empty()) { std::vector newActions(_actions.size()); diff --git a/core/Action/Spawn.cpp b/core/Action/Spawn.cpp index e4cb08cb..8da2847b 100644 --- a/core/Action/Spawn.cpp +++ b/core/Action/Spawn.cpp @@ -9,6 +9,16 @@ e2d::Spawn::Spawn(const std::vector& actions) this->add(actions); } +e2d::Spawn * e2d::Spawn::create() +{ + return Create(); +} + +e2d::Spawn * e2d::Spawn::create(const std::vector& actions) +{ + return Create(actions); +} + e2d::Spawn::~Spawn() { } @@ -95,7 +105,7 @@ void e2d::Spawn::add(const std::vector& actions) e2d::Spawn * e2d::Spawn::clone() const { - auto spawn = new (std::nothrow) Spawn(); + auto spawn = Create(); for (const auto& action : _actions) { if (action) @@ -108,7 +118,7 @@ e2d::Spawn * e2d::Spawn::clone() const e2d::Spawn * e2d::Spawn::reverse() const { - auto spawn = new (std::nothrow) Spawn(); + auto spawn = Create(); if (!_actions.empty()) { std::vector newActions(_actions.size()); diff --git a/core/Collider/Collider.cpp b/core/Collider/Collider.cpp index 844510b9..54b1a8ef 100644 --- a/core/Collider/Collider.cpp +++ b/core/Collider/Collider.cpp @@ -8,7 +8,7 @@ e2d::Collider::Collider() , _parentNode(nullptr) , _transformed(nullptr) , _enable(true) - , _autoResize(true) + , _autoResize(false) { } diff --git a/core/Collider/ColliderCircle.cpp b/core/Collider/ColliderCircle.cpp index eaee238e..b3440c00 100644 --- a/core/Collider/ColliderCircle.cpp +++ b/core/Collider/ColliderCircle.cpp @@ -23,6 +23,22 @@ e2d::ColliderCircle::ColliderCircle(Node * node) ), minSide / 2 ); + this->setAutoResize(true); +} + +e2d::ColliderCircle * e2d::ColliderCircle::create() +{ + return Create(); +} + +e2d::ColliderCircle * e2d::ColliderCircle::create(Point center, double radius) +{ + return Create(center, radius); +} + +e2d::ColliderCircle * e2d::ColliderCircle::create(Node * node) +{ + return Create(node); } e2d::ColliderCircle::~ColliderCircle() diff --git a/core/Collider/ColliderEllipse.cpp b/core/Collider/ColliderEllipse.cpp index 8c42d46c..b4649316 100644 --- a/core/Collider/ColliderEllipse.cpp +++ b/core/Collider/ColliderEllipse.cpp @@ -23,6 +23,22 @@ e2d::ColliderEllipse::ColliderEllipse(Node * node) node->getWidth() / 2, node->getHeight() / 2 ); + this->setAutoResize(true); +} + +e2d::ColliderEllipse * e2d::ColliderEllipse::create() +{ + return Create(); +} + +e2d::ColliderEllipse * e2d::ColliderEllipse::create(Point center, double radiusX, double radiusY) +{ + return Create(center, radiusX, radiusY); +} + +e2d::ColliderEllipse * e2d::ColliderEllipse::create(Node * node) +{ + return Create(node); } e2d::ColliderEllipse::~ColliderEllipse() diff --git a/core/Collider/ColliderRect.cpp b/core/Collider/ColliderRect.cpp index 28d7ef23..4e6c9cda 100644 --- a/core/Collider/ColliderRect.cpp +++ b/core/Collider/ColliderRect.cpp @@ -16,6 +16,22 @@ e2d::ColliderRect::ColliderRect(Node * node) : _d2dRectangle(nullptr) { this->setRect(0, 0, node->getRealWidth(), node->getRealHeight()); + this->setAutoResize(true); +} + +e2d::ColliderRect * e2d::ColliderRect::create() +{ + return Create(); +} + +e2d::ColliderRect * e2d::ColliderRect::create(double x, double y, double width, double height) +{ + return Create(x, y, width, height); +} + +e2d::ColliderRect * e2d::ColliderRect::create(Node * node) +{ + return Create(node); } e2d::ColliderRect::~ColliderRect() @@ -41,7 +57,7 @@ void e2d::ColliderRect::_resize() { if (_parentNode && _enable) { - this->setRect( 0, 0, _parentNode->getRealWidth(), _parentNode->getRealHeight()); + this->setRect(0, 0, _parentNode->getRealWidth(), _parentNode->getRealHeight()); } } diff --git a/core/Common/Animation.cpp b/core/Common/Animation.cpp index cb72923f..32d88125 100644 --- a/core/Common/Animation.cpp +++ b/core/Common/Animation.cpp @@ -5,6 +5,12 @@ e2d::Animation::Animation() { } +e2d::Animation::Animation(const std::vector& frames) + : _interval(1) +{ + this->add(frames); +} + e2d::Animation::Animation(double interval) : _interval(interval) { @@ -16,10 +22,24 @@ e2d::Animation::Animation(double interval, const std::vector& frames) this->add(frames); } -e2d::Animation::Animation(const std::vector& frames) - : _interval(1) +e2d::Animation * e2d::Animation::create() { - this->add(frames); + return Create(); +} + +e2d::Animation * e2d::Animation::create(const std::vector& frames) +{ + return Create(frames); +} + +e2d::Animation * e2d::Animation::create(double interval) +{ + return Create(interval); +} + +e2d::Animation * e2d::Animation::create(double interval, const std::vector& frames) +{ + return Create(interval, frames); } e2d::Animation::~Animation() @@ -68,7 +88,7 @@ const std::vector& e2d::Animation::getFrames() const e2d::Animation * e2d::Animation::clone() const { - auto animation = new (std::nothrow) Animation(_interval); + auto animation = Create(_interval); for (auto frame : _frames) { animation->add(frame); diff --git a/core/Common/Image.cpp b/core/Common/Image.cpp index 9375e6a3..fbd8d5e0 100644 --- a/core/Common/Image.cpp +++ b/core/Common/Image.cpp @@ -28,12 +28,6 @@ e2d::Image::Image(int resNameId, const String& resType) this->open(resNameId, resType); } -e2d::Image::Image(ID2D1Bitmap * bitmap) - : _bitmap(nullptr) -{ - this->open(bitmap); -} - e2d::Image::Image(const String& filePath, double cropX, double cropY, double cropWidth, double cropHeight) : _bitmap(nullptr) { @@ -48,6 +42,31 @@ e2d::Image::Image(int resNameId, const String& resType, double cropX, double cro this->crop(cropX, cropY, cropWidth, cropHeight); } +e2d::Image * e2d::Image::create() +{ + return Create(); +} + +e2d::Image * e2d::Image::create(const String & filePath) +{ + return Create(filePath); +} + +e2d::Image * e2d::Image::create(int resNameId, const String & resType) +{ + return Create(resNameId, resType); +} + +e2d::Image * e2d::Image::create(const String & filePath, double cropX, double cropY, double cropWidth, double cropHeight) +{ + return Create(filePath, cropX, cropY, cropWidth, cropHeight); +} + +e2d::Image * e2d::Image::create(int resNameId, const String & resType, double cropX, double cropY, double cropWidth, double cropHeight) +{ + return Create(resNameId, resType, cropX, cropY, cropWidth, cropHeight); +} + e2d::Image::~Image() { } @@ -81,20 +100,6 @@ bool e2d::Image::open(int resNameId, const String& resType) return true; } -bool e2d::Image::open(ID2D1Bitmap * bitmap) -{ - if (bitmap) - { - if (s_vBitmaps.find(bitmap) != s_vBitmaps.end()) - { - s_vBitmaps.insert(bitmap); - } - this->_setBitmap(bitmap); - return true; - } - return false; -} - void e2d::Image::crop(double x, double y, double width, double height) { if (_bitmap) diff --git a/core/Common/Scene.cpp b/core/Common/Scene.cpp index c83f1a93..162555b1 100644 --- a/core/Common/Scene.cpp +++ b/core/Common/Scene.cpp @@ -7,7 +7,7 @@ e2d::Scene::Scene() , _colliderVisiable(false) , _root(nullptr) { - _root = new (std::nothrow) Node(); + _root = Node::create(); if (_root) { _root->retain(); @@ -19,6 +19,11 @@ e2d::Scene::Scene() } } +e2d::Scene * e2d::Scene::create() +{ + return Create(); +} + e2d::Scene::~Scene() { } diff --git a/core/Node/Button.cpp b/core/Node/Button.cpp index 5e788e22..aaddbc10 100644 --- a/core/Node/Button.cpp +++ b/core/Node/Button.cpp @@ -78,6 +78,31 @@ e2d::Button::Button(Node * normal, Node * mouseover, Node * selected, Node * dis this->setClickFunc(func); } +e2d::Button * e2d::Button::create() +{ + return Create