Reputation: 1348
How to Implement Scrolling functionality in cocos2d Surfaceview in android? Please give me some suggestion.
Upvotes: 1
Views: 1312
Reputation: 1807
You can direct add android ui scrollview in cocos2d-android 1 like that
Activity mActivity=CCDirector.sharedDirector().getActivity();
View view=(LinearLayout) LayoutInflater.from(mActivity).inflate(R.layout.level_scroll,null);
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
mActivity.addContentView(view, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
}
});
You can make level_scroll.xml as per your requirement.
Upvotes: 1
Reputation: 214
There is no scroll view available in cocos2d, but check the below details if it can help you.
This example for screen reslution 320 x 480.
Hope it will work for you and if any other details required then comment on this
Upvotes: 3