Armaturedatamanager::getinstance ()->addarmaturefileinfo ("Effect/hitscreen/hitscreen. Exportjson ");
Boolplayonclickarmation::ontouchbegan (touch* touch,event* Event)
{
armature = Armature::create ("Hitscreen");
This->addchild (armature);
Armature->setposition (Touch->getlocation ());
Armature->getanimation ()->playwithindex (0);
Armature->getanimation ()->setmovementeventcallfunc (playonclickarmation::armaturecallback);
return true;
}
Voidplayonclickarmation::ontouchmoved (touch* touch,event* Event)
{
}
voidplayonclickarmation::ontouchended (touch* touch,event* Event)
{
}
Voidplayonclickarmation::armaturecallback (armature *armature,movementeventtype movementType, const std::string & Movementid)
{
if (Movementtype ==complete)
{
if (armature)
{
Armature->removefromparentandcleanup (TRUE);
}
}
This section of code implements the effect of tapping the screen.