こんな感じ。
if(isTouch(touch->getLocation(), &(questButton.parts)))
{
auto questList = getQuestList();
auto questName = questList->begin();
for(int i = 0; i < questList->size(); i++)
{
log("loop");
questListMenu.questListMenu[i].parts.sprite = Sprite::create("btn02_03_s_bl.png");
questListMenu.questListMenu[i].parts.sprite->setAnchorPoint(Vec2(0.0, 0.0));
questListMenu.questListMenu[i].parts.size = Size(questListMenu.questListMenu->parts.sprite->getContentSize().width * questListMenu.scaleRate,
questListMenu.questListMenu->parts.sprite->getContentSize().height);
questListMenu.questListMenu[i].parts.point = Vec2(questListMenu.parts.point.x, questListMenu.parts.point.y - questListMenu.questListMenu->parts.sprite->getContentSize().height * (i + 1));
questListMenu.questListMenu[i].parts.sprite->setPosition(questListMenu.questListMenu[i].parts.point);
questListMenu.questListMenu[i].parts.sprite->setScale(questListMenu.scaleRate, 1);
this->addChild(questListMenu.questListMenu[i].parts.sprite, 5);
questListMenu.questListMenu[i].questName.label = Label::createWithTTF("", "fonts/msgothic.ttc", 18);
auto str = String();
str.appendWithFormat("%s", questName.operator*());
questListMenu.questListMenu[i].questName.label->setString(str.getCString());
questListMenu.questListMenu[i].questName.label->setAnchorPoint(Vec2(0.0, -0.3));
questListMenu.questListMenu[i].questName.point = Vec2(questListMenu.questListMenu[i].parts.point.x + questListMenu.questListMenu[i].parts.size.width / 30.0, questListMenu.questListMenu[i].parts.point.y);
questListMenu.questListMenu[i].questName.label->setPosition(questListMenu.questListMenu[i].questName.point);
this->addChild(questListMenu.questListMenu[i].questName.label, 6);
questName++;
}
}
あとはこれを指でスクロールさせたいんだけど、
難しそうな気がする。
でもできたらいろいろ応用ができそうだけど。