ScrollView in cocos2dx v3.4

I am trying to implement ScrollView in cocos2dx v3.4

#include “CocosGUI.h” ----> It says No such file or directory.

Here is my code

auto scrollView = cocos2d::ui::ScrollView::create();
scrollView->setTouchEnabled(true);
scrollView->setContentSize(Size(100,150));
scrollView->setPosition(Vec2(50,100));
scrollView->setBounceEnabled(true);
scrollView->setDirection(cocos2d::ui::ScrollView::Direction::VERTICAL);
scrollView->setBackGroundImage(“sample.png”);
this->addChild(scrollView);

What should i change to get a scrollview?

Just try to include file by giving full path #include “ui/CocosGUI.h”.It may resolves your issue.

@manjureddy48
That worked, Thanks!
Can you share some ScrollView example to which I can refer to!

Hey

Just take a look on this

Many examples on each ui element, sounds good ahh

Good luck

1 Like