Skip to content

This project demonstrates how we can add UIKit components onto the scene created by Cocos2d-X.

Notifications You must be signed in to change notification settings

Jornason/Cocos2d-X-plus-UIKit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cocos2d X plus UIKit

This project demonstrates how we can add UIKit components onto the scene created by Cocos2d-X.

Youtube demo: http://youtu.be/KesskERGoM0

#The Magic Lies in #include "XBridge.h" #include "AppController.h" #include "RootViewController.h" #include "XBridgeTableViewController.h"

using namespace cocos2d;

void XBridge::doSth() {
	id sth = [[UIApplication sharedApplication] delegate];
	if ([sth isKindOfClass:[AppController class]]) {        
    	XBridgeTableViewController *tempTableViewController = [[XBridgeTableViewController alloc] initWithNibName:nil bundle:nil];        
    	tempTableViewController.tableView.frame = CGRectMake(100, 100, 200, 100);
    	AppController *controller = (AppController *)sth;
    	[controller.viewController.view addSubview:tempTableViewController.tableView];
	}
}

#Screenshot

#Contact Email: diwufet@gmail.com

About

This project demonstrates how we can add UIKit components onto the scene created by Cocos2d-X.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published