A cocos2d-x code that cause crash on Android but not on iOS - cocos2d-x

While porting an cocos2d-x project from iOS to Android, I found a problem that will cause crashing on Android but not on iOS, to show this problem, I made a small modification to the HelloWorld sample. To reproduce this problem, just press the close button on the bottom-right corner, on Android it will crash but not on iOS.
The code that cause the crashing is:
void TestNode::test()
{
// This will cause crash on Android, but OK on iOS
CCCallFunc *selector = CCCallFunc::create(this, callfunc_selector(TestNode::destroy));
this->runAction(selector);
// This is ok on both Android and iOS
// CCCallFunc *selector = CCCallFunc::create(scene_, callfunc_selector(HelloWorld::destroyNode));
// scene_->runAction(selector);
// This is ok on both Android and iOS
// destroy();
}
The complete code as the following:
HelloWorldScene.h
#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
#include "cocos2d.h"
class TestNode : public cocos2d::CCNode {
public:
TestNode(cocos2d::CCLayer *scene);
~TestNode();
void test();
void destroy();
cocos2d::CCLayer *scene_;
cocos2d::CCSprite *sprite_;
};
class HelloWorld : public cocos2d::CCLayer
{
private:
TestNode *node_;
public:
// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
virtual bool init();
// there's no 'id' in cpp, so we recommend returning the class instance pointer
static cocos2d::CCScene* scene();
// a selector callback
void menuCloseCallback(CCObject* pSender);
// implement the "static node()" method manually
CREATE_FUNC(HelloWorld);
void destroyNode();
};
#endif // __HELLOWORLD_SCENE_H__
HelloWorldScene.cpp:
#include "HelloWorldScene.h"
#include "AppMacros.h"
USING_NS_CC;
TestNode::TestNode(cocos2d::CCLayer *scene):
scene_(scene)
{
sprite_ = CCSprite::create("CloseNormal.png");
sprite_->setPosition(ccp(200, 200));
scene_->addChild(sprite_, 255);
}
TestNode::~TestNode()
{
scene_->removeChild(sprite_, true);
scene_->removeChild(this, true);
CCLog("+++ ~TestNode");
}
void TestNode::test()
{
// This will cause crash on Android, but OK on iOS
CCCallFunc *selector = CCCallFunc::create(this, callfunc_selector(TestNode::destroy));
this->runAction(selector);
// This is ok on both Android and iOS
// CCCallFunc *selector = CCCallFunc::create(scene_, callfunc_selector(HelloWorld::destroyNode));
// scene_->runAction(selector);
// This is ok on both Android and iOS
// destroy();
}
void TestNode::destroy()
{
CCLog("+++ destroy");
delete this;
}
CCScene* HelloWorld::scene()
{
// 'scene' is an autorelease object
CCScene *scene = CCScene::create();
// 'layer' is an autorelease object
HelloWorld *layer = HelloWorld::create();
// add layer as a child to scene
scene->addChild(layer);
// return the scene
return scene;
}
// on "init" you need to initialize your instance
bool HelloWorld::init()
{
//////////////////////////////
// 1. super init first
if ( !CCLayer::init() )
{
return false;
}
CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
// you may modify it.
// add a "close" icon to exit the progress. it's an autorelease object
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback));
pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
origin.y + pCloseItem->getContentSize().height/2));
// create menu, it's an autorelease object
CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition(CCPointZero);
this->addChild(pMenu, 1);
/////////////////////////////
// 3. add your codes below...
// add a label shows "Hello World"
// create and initialize a label
CCLabelTTF* pLabel = CCLabelTTF::create("Hello World", "Arial", TITLE_FONT_SIZE);
// position the label on the center of the screen
pLabel->setPosition(ccp(origin.x + visibleSize.width/2,
origin.y + visibleSize.height - pLabel->getContentSize().height));
// add the label as a child to this layer
this->addChild(pLabel, 1);
// add "HelloWorld" splash screen"
CCSprite* pSprite = CCSprite::create("HelloWorld.png");
// position the sprite on the center of the screen
pSprite->setPosition(ccp(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
// add the sprite as a child to this layer
this->addChild(pSprite, 0);
node_ = new TestNode(this);
this->addChild(node_);
return true;
}
void HelloWorld::menuCloseCallback(CCObject* pSender)
{
// CCDirector::sharedDirector()->end();
if (node_) {
node_->test();
node_ = NULL;
}
//#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
// exit(0);
//#endif
}
void HelloWorld::destroyNode()
{
node_->destroy();
}

I don't know why this works on iOS but you should not do this anyway. When you run the code
CCCallFunc *selector = CCCallFunc::create(this, callfunc_selector(TestNode::destroy));
this->runAction(selector);
which calls the function
void TestNode::destroy()
{
CCLog("+++ destroy");
delete this;
}
you are destroying an object that the CCCallFunc action still keeps a pointer to. Then when the CCCallFunc object is destroyed, it runs the CC_SAFE_RELEASE macro which will call release on your TestNode object. However, by now that TestNode object is already deallocated and that is most likely the reason for your crash.

Related

how to do a button click in Xamarin Forms Android custom info window

In my Xamarin Forms Android project I am showing a Map using CustomMapRenderer. I am popping up a Info Window in Map screen and this info window has button name called "Call". I need to do a "OnCLick" button click operation for this button. I have googled it, but unfortunately I didn't come across any solutions. at last I have started to work on converting the Android Native code -Java into Xamarin Forms Android - c#, for this conversion I have been using this answers Google Maps Android API v2 - Interactive InfoWindow (like in original android google maps) . This converted code shows A field initializer cannot reference the non static field, method or property OnInfoWindowElemTouchListener.onClickConfirmed(view, marker) this Error inside Java.Lang.Runnable please help me to resolve the problem.
OnInfoWindowElemTouchListener.cs
using System.Threading.Tasks;
using Android.App;
using Android.Content;
using Android.Gms.Maps.Model;
using Android.Graphics.Drawables;
using Android.OS;
using Android.Views;
using Android.Views.Accessibility;
using Java.Lang;
namespace Hotel.Droid
{
public abstract class OnInfoWindowElemTouchListener : Java.Lang.Object
, View.IOnTouchListener
{
private View view;
private Drawable bgDrawableNormal;
private Drawable bgDrawablePressed;
private Handler handler = new Handler();
private Marker marker;
private static bool endPressStatus = false;
private bool pressed = false;
public OnInfoWindowElemTouchListener(View view, Drawable bgDrawableNormal, Drawable bgDrawablePressed)
{
this.view = this.view;
this.bgDrawableNormal = this.bgDrawableNormal;
this.bgDrawablePressed = this.bgDrawablePressed;
}
public OnInfoWindowElemTouchListener()
{
}
public void setMarker(Marker marker)
{
this.marker = this.marker;
}
public bool OnTouch(View vv, MotionEvent e)
{
if (0 <= e.GetX() && e.GetX() <= vv.Width && 0 <= e.GetY() && e.GetY() <= vv.Height)
{
switch (e.ActionMasked)
{
case MotionEventActions.Down:
startPress();
break;
// We need to delay releasing of the view a little so it shows the
// pressed state on the screen
case MotionEventActions.Up:
//handler.PostDelayed(ConfirmClickRunnable, 150);
Task.Factory.StartNew(() => onClickConfirmed(view, marker));
Task.Delay(150);
break;
case MotionEventActions.Cancel:
endPress();
break;
default:
break;
}
}
else {
// If the touch goes outside of the view's area
// (like when moving finger out of the pressed button)
// just release the press
endPress();
}
return false;
}
private void startPress()
{
if (!pressed)
{
pressed = true;
//handler.RemoveCallbacks(ConfirmClickRunnable);
view.SetBackgroundDrawable(bgDrawablePressed);
if ((marker != null))
{
marker.ShowInfoWindow();
}
}
}
public bool endPress()
{
if (pressed)
{
this.pressed = false;
handler.RemoveCallbacks(ConfirmClickRunnable);
view.SetBackgroundDrawable(bgDrawableNormal);
if ((marker != null))
{
marker.ShowInfoWindow();
}
endPressStatus = true;
return true;
}
else {
endPressStatus = false;
return false;
}
}
private Runnable ConfirmClickRunnable = new Java.Lang.Runnable(() =>
{
if (endPressStatus)
{
onClickConfirmed(view, marker);
}
});
/*private class RunnableAnonymousInnerClassHelper : Java.Lang.Object, Java.Lang.IRunnable
{
private readonly Context outerInstance;
public RunnableAnonymousInnerClassHelper(Context outerInstance)
{
this.outerInstance = outerInstance;
}
public void Run()
{
if (endPressStatus)
{
onClickConfirmed();
}
}
}*/
protected abstract void onClickConfirmed(View v, Marker marker);
}
}
Updated
I have implemented the Task.Factory.StartNew instead of Android Runnableand now I am stucking on the below lines. I am struggling on converting this below Java codes into C#since it is written by Anonymous class concept.
Java
this.infoButtonListener = new OnInfoWindowElemTouchListener(infoButton,
getResources().getDrawable(R.drawable.btn_default_normal_holo_light),
getResources().getDrawable(R.drawable.btn_default_pressed_holo_light))
{
#Override
protected void onClickConfirmed(View v, Marker marker) {
// Here we can perform some action triggered after clicking the button
Toast.makeText(MainActivity.this, marker.getTitle() + "'s button clicked!", Toast.LENGTH_SHORT).show();
}
};
this.infoButton.setOnTouchListener(infoButtonListener);
infoButton in code is Call button
C# - Please help me to resolve the problem by converting/using(How to use) the above java code
The solution is too complicated for this window. Please see chat room for step by step solution.
https://chat.stackoverflow.com/rooms/128847/discussion-between-jamal-and-yuri-s

How to get cocos2dx into a wxGLCanvas of wxWidgets

I'm trying to create a level editor for my futur game, to do that I need to get cocos2dx scene showing in a wxGLCanvas of the wxWidgets library.
How to link the wxGLCanvas with cocos2d::GLView ?
What I've done :
Created a class ccwxGLView that inherits from GLView:
class ccwxGLView : public cocos2d::GLView
{
ccwxGLCanvas* mGLCanvas;
public:
ccwxGLView(ccwxGLCanvas* canvas) {
setGLCanvas(canvas);
}
virtual ~ccwxGLView(void) {}
static ccwxGLView* create(ccwxGLCanvas* canvas) {
auto ret = new (std::nothrow) ccwxGLView(canvas);
if(ret) {
ret->autorelease();
return ret;
}
return nullptr;
}
void setGLCanvas(ccwxGLCanvas* canvas) {
mGLCanvas = canvas;
}
ccwxGLCanvas* getGLCanvas() {
return mGLCanvas;
}
HWND getWin32Window() {
return mGLCanvas->GetParent()->GetHWND();
}
/** Force destroying EGL view, subclass must implement this method. */
virtual void end() {
mGLCanvas->Close();
wxDELETE(mGLCanvas);
mGLCanvas = nullptr;
}
/** Get whether opengl render system is ready, subclass must implement this method. */
virtual bool isOpenGLReady() {
return (mGLCanvas && mGLCanvas->IsShown());
}
/** Exchanges the front and back buffers, subclass must implement this method. */
virtual void swapBuffers() {
mGLCanvas->SwapBuffers();
}
virtual void setIMEKeyboardState(bool open) {}
virtual bool windowShouldClose() {
return (mGLCanvas == nullptr);
}
};
Created a class that inherits from wxGLCanvas :
class ccwxGLCanvas : public wxGLCanvas
{
wxGLContext* m_context;
public:
ccwxGLCanvas(wxFrame* parent, int* args)
: wxGLCanvas(parent, wxID_ANY, args, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)
{
m_context = new wxGLContext(this);
}
virtual ~ccwxGLCanvas() { delete m_context; }
void resized(wxSizeEvent& evt) {
Refresh();
}
void render(wxPaintEvent& evt) {
cocos2d::Director* director = cocos2d::Director::getInstance();
if(director != nullptr && director->getRunningScene() != nullptr)
director->drawScene();
}
};
In the AppDelegate I modified the glView initialization by :
if(!glview) {
glview = ccwxGLView::create(mGLCanvas);
director->setOpenGLView(glview);
}
And on the app init function, I wrote something like this :
wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
frame = new wxFrame((wxFrame *)NULL, -1, wxT("Hello GL World"), wxPoint(50,50), wxSize(400,200));
int args[] = {WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0};
glPane = new ccwxGLCanvas( (wxFrame*) frame, args);
sizer->Add(glPane, 1, wxEXPAND);
frame->SetSizer(sizer);
frame->SetAutoLayout(true);
frame->Show();
ccApp = new AppDelegate();
ccApp->setGLCanvas(glPane);
ccApp->applicationDidFinishLaunching();
When I run, a wxFrame (window) is shown and the app crashes immediately.
Call stack :
libcocos2d.dll!cocos2d::Renderer::setupVBO() Line 352 C++
libcocos2d.dll!cocos2d::Renderer::setupBuffer() Line 285 C++
libcocos2d.dll!cocos2d::Renderer::initGLView() Line 272 C++
libcocos2d.dll!cocos2d::Director::setOpenGLView(cocos2d::GLView * openGLView) Line 394 C++
editor.exe!AppDelegate::applicationDidFinishLaunching() Line 44 C++
editor.exe!EditorApp::OnInit() Line 25 C++
wxbase30ud_vc_custom.dll!wxAppConsoleBase::CallOnInit() Line 93 C++
wxbase30ud_vc_custom.dll!wxEntryReal(int & argc, wchar_t * * argv) Line 479 C++
wxbase30ud_vc_custom.dll!wxEntry(int & argc, wchar_t * * argv) Line 188 C++

Create Splash screen in cocos 2d-x

Hello I am creating an game in cocos2d-x and when I am scheduling an event on splash screen for run game .It shows compilation error (in expansion of macro 'schedule_selector')
Following is my code for this
Splash.h
#ifndef SPLASH_H_
#define SPLASH_H_
#include "cocos2d.h"
class CCSplashLayer : public cocos2d::CCLayer {
private :
void runGame();
public:
static cocos2d::CCScene* createScene();
virtual bool init();
CREATE_FUNC(CCSplashLayer);
};
#endif /* SPLASH_H_ */
And SplashScene.cpp
#include "splash.h"
#include "cocos2d.h"
#include "HelloWorldScene.h"
USING_NS_CC;
bool CCSplashLayer::init() {
if (!Layer::init()) {
return false;
}
Size visibleSize = Director::getInstance()->getVisibleSize();
auto sprite = Sprite::create("splash.png");
sprite->setScale(Director::getInstance()->getContentScaleFactor());
sprite->setPosition(Vec2(visibleSize.width / 2,visibleSize.height/2));
this->addChild(sprite, 0);
//This line cause problem show i symbol on this line in eclipse
this->scheduleOnce(schedule_selector(CCSplashLayer::runGame),4.0f);
return true;
}
Scene* CCSplashLayer::createScene() {
auto scene = CCScene::create();
auto layer = CCSplashLayer::create();
scene->addChild(layer);
return scene;
}
void CCSplashLayer::runGame(){
auto scene = HelloWorld::createScene();
Director::getInstance()->setDepthTest(true);
TransitionScene *transition = TransitionScene::create(0.5f, scene);
Director::getInstance()->pushScene(transition);
}
schedule_selector takes function pointer which needs a float argument for time.
Change method CCSplashLayer::runGame() to CCSplashLayer::runGame(float dt) in defination and declaration.
Also you are pushing a scene over splash scene, which is not recommended way for splash scene. You must replace splash scene with new scene because we never need to display splash again in game unless there is specific design requirement of game.
Try this macro:
#define CCDL_PERFORM_SELECTOR( __OWNER__, __DELAY__, __CALLFUNC_SELECTOR__ ) \
__OWNER__->runAction( cocos2d::Sequence::create( \
cocos2d::DelayTime::create( __DELAY__ ), \
cocos2d::CallFunc::create( CC_CALLBACK_0( __CALLFUNC_SELECTOR__,__OWNER__) ), \
nullptr )); \
(source: https://github.com/duksel/Cocos2dx-DukselLib/blob/master/Cocos2dx-DukselLib/DukselMacros.h#L70-L74)
Allow to use for any CCNode (+subclass) instance.
In your case will be:
bool CCSplashLayer::init()
{
CCDL_PERFORM_SELECTOR( this, 4.f, CCSplashLayer::runGame );
}
try like this...
in init method,
this->runAction(CCSequence::create(CCDelayTime::create(4.0f),
CCCallFuncN::create(this,callfuncN_selector(CCSplashLayer::runGame)),
NULL));
and add this method.
void CCSplashLayer::runGame(){
auto scene = HelloWorld::createScene();
Director::getInstance()->setDepthTest(true);
TransitionScene *transition = TransitionScene::create(0.5f, scene);
Director::getInstance()->pushScene(transition);
}

cocos2d-x 3.1 EXC_BAD_ACCESS on Touch event + function

I'm cocos2d-x beginner and having trouble with TouchBegan event + function.
I always get EXC_BAD_ACCESS in the [label->setString("Foo Bar");] point when I run this simple code with xCode(5.1.1 + iPhone sim 7.1).
I tried a few ways to solve, but I'm completely stuck up in this problem for 2 or 3 days.
Does anyone have any idea for the wrong point?
HelloWorld.h
#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
#include "cocos2d.h"
class HelloWorld : public cocos2d::LayerGradient
{
public:
static cocos2d::Scene* createScene();
virtual bool init();
bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event* event);
cocos2d::Label* label;
CREATE_FUNC(HelloWorld);
};
#endif // __HELLOWORLD_SCENE_H__
HelloWorld.cpp
#include "HelloWorldScene.h"
USING_NS_CC;
Scene* HelloWorld::createScene()
{
auto scene = Scene::create();
auto layer = HelloWorld::create();
scene->addChild(layer);
return scene;
}
bool HelloWorld::init()
{
if(!LayerGradient::initWithColor(Color4B(0, 0, 0, 255), Color4B(50, 50, 50, 255))){
return false;
}
Size visibleSize = Director::getInstance()->getVisibleSize();
Vec2 origin = Director::getInstance()->getVisibleOrigin();
auto label = Label::create("Hello World", "Arial", 112);
label->setPosition(Vec2(origin.x + visibleSize.width/2,
origin.y + visibleSize.height - label->getContentSize().height));
this->addChild(label, 1);
auto listener = EventListenerTouchOneByOne::create();
listener->setSwallowTouches(true);
listener->onTouchBegan = CC_CALLBACK_2(HelloWorld::onTouchBegan, this);
this->getEventDispatcher()->addEventListenerWithFixedPriority(listener, 100);
return true;
}
bool HelloWorld::onTouchBegan(Touch *touch, Event *event){
label->setString("Foo Bar");
return true;
}
Thank you.
Your problem is in this line :
auto label = Label::create("Hello World", "Arial", 112);
In this line you declare a new variable named label whose scope is only for the init function. You also have a class variable also named label and they're not the same. If you declare a variable in a method with the same name as a class variable, it will shadow it. Consider this example :
class A {
int variable;
void method() {
int variable; // this is not the same thing as the one above
variable = 5; //assignment to local variable
this->variable = 3; //asignment to class variable
}
}
So you actually don't assign anything to your class variable label which you later reference in the touch method. The easiest way to solve this would be to remove the auto keyword at auto label from your init() method.
As noted by #Losiowaty, the use of auto can be dangerous sometimes.
cocos2d::Label* label = cocos2d::Label::create("Hello World", "Arial", 112);
Also, there might be a better constructor to use: http://www.cocos2d-x.org/reference/native-cpp/V3.1rc0/db/de4/classcocos2d_1_1_label.html

How to perform drag and drop operation on sprite fetched from array and present on screen ?

I want to perform drag and drop operation on these image.
How can i make it possible with the following code.
void storeLocation::changescene()
{
this->removeAllChildren();
//CCDirector::sharedDirector()->replaceScene(storeLocation::scene());
CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
//CCScene* scene=CCScene::create();
storeLocation *layer = storeLocation::create();
CCSprite *k=CCSprite::create("background.png");
this->addChild(k,0);
k->setPosition(ccp(visibleSize.width/2+ origin.x, visibleSize.height/2 + origin.y));
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(storeLocation::menuCloseCallback));
pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width ,
origin.y + pCloseItem->getContentSize().height/2));
pCloseItem->setScale(1.5);
// create menu, it's an autorelease object
CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition(CCPointZero);
this->addChild(pMenu, 1);
this->addChild(pMenu, 1);
this->setTouchEnabled(true);
int l=5;
int posx=0,posy=0;
int count=0,r,j=-1,i=0,flag=0;
int x=20;
int b[30],a[30];
while(count<=5)
{
srand(time(0));
r=rand()%x+1;
flag=checktag(b,r,j);
if(flag==1)
{
b[i]=r;
i++;
count++;
j++;
}
}
int t;
CCObject* jt=NULL;
CCARRAY_FOREACH(images, jt)
{
// CCSize winSize = CCDirector::sharedDirector()->getWinSize();
//float i=winSize.width;
CCSprite *image = dynamic_cast<CCSprite*>(jt);
t=image->getTag();
for(i=0;i<l;i++)
{
if(t==b[i])
{
this->addChild(image);
image->setPosition(ccp(100+posx,100));
posx=posx+120;
}}}
To drag and drop images from one point to another on screen you have to use touch delegate methods
bool ccTouchBegan(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent);
void ccTouchMoved(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent);
void ccTouchEnded(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent);
Detect image on user touch in ccTouchBegan method, for this you can store all image objects in a array and check if touch is in rect of any image by using for loop.
To move the image with user touch change position of touched image(save touched image object in a global object) in ccTouchMoved.
And in ccTouchEnded method do whatever you want to do on droping image.
the easiest way to catch drag and drop events is by implementing the onTouchBegan and onTouchMoved and onTouchEnded methods like this:
auto listener = EventListenerTouchOneByOne::create();
listener->onTouchBegan = CC_CALLBACK_2(HelloWorld::onTouchBegan, this);
listener->onTouchMoved = CC_CALLBACK_2(HelloWorld::onTouchMoved, this);
listener->onTouchEnded = CC_CALLBACK_2(HelloWorld::onTouchEnded, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, sprite);
bool HelloWorld::onTouchBegan(Touch* touch, cocos2d::Event* event){
// this method is not needed but in order to implement the onTouchMoved you have to first implement onTouchBegan then the onTouchMoved
return true;
}
void HelloWorld::onTouchMoved(Touch* touch, cocos2d::Event* event){
if (sprite->getBoundingBox().containsPoint(touch->getLocation()))
{
sprite->setPosition(sprite->getPosition() + touch->getDelta());
}
}
void HelloWorld::onTouchEnded(Touch* touch, cocos2d::Event* event){
if (sprite->getBoundingBox().containsPoint(touch->getLocation()))
{
log("Sprite Drop Event");
}
}