本文整理汇总了C++中ImageView::getScale方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageView::getScale方法的具体用法?C++ ImageView::getScale怎么用?C++ ImageView::getScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageView
的用法示例。
在下文中一共展示了ImageView::getScale方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _buttonTouch
// функция обрабатывае нажатия
void SceneMain::_buttonTouch(Ref* pSender, Widget::TouchEventType type)
{
float scalePersent = 1.1f;
if (type == Widget::TouchEventType::BEGAN) {
ImageView *button = (ImageView *)pSender;
button->setScale(button->getScale()*scalePersent);
}
if (type == Widget::TouchEventType::ENDED) {
ImageView *button = (ImageView *)pSender;
button->setScale(button->getScale() / scalePersent);
// переход по урлу
if (1001 == button->getTag()) {
Application::getInstance()->openURL("http://www.spdstudio.ru/");
}
// показать экран игры
if (1002 == button->getTag()) {
CCScene *scene = SceneGame::createScene();
CCScene* transition = TransitionFade::create(0.1f, scene);
if (transition) {
Director::getInstance()->replaceScene(transition); // v 3
//CCDirector::sharedDirector()->replaceScene(transition); // v 2
}
}
}
if (type == Widget::TouchEventType::CANCELED) {
ImageView *button = (ImageView *)pSender;
button->setScale(button->getScale() / scalePersent);
}
}