Domanda

I have installed cocos3d 0.7.2. I have developed sample projects. When i tried to add new file to my project, i couldn't find the cocos3d file templates in the template window.I could see only the cocos2d templates. These are the screen shots, enter image description here enter image description here

Is that because of any installation errors ? I had followed the steps of this site

What should i do ?

Thank you

È stato utile?

Soluzione

The best place where you could get info to install this would be the readme file contained within the cocos3d package. The following instructions is an extract from the readme file. That would be the correct way to install it. It worked for me and it should have no issues. I would suggest you to reinstall it. Also the post you mentioned seems a bit old to me.

Installation

The cocos3d framework is built on cocos2d 1.x. Before installing cocos3d, you must download and install the cocos2d 1.x SDK from:

http://www.cocos2d-iphone.org/download

* PLEASE NOTE THAT cocos3d 0.7.2 IS NOT COMPATIBLE WITH cocos2d 2.x. ** BE SURE TO DOWNLOAD cocos2d 1.x FOR USE WITH cocos3d. *

Unzip the cocos3d distribution file (which you've probably already done, otherwise you wouldn't be reading this document).

Open a Terminal session, navigate to the unzipped cocos3d distribution directory and run the install-cocos3d script as follows:

./install-cocos3d.sh -f -2 "path-to-cocos2d-sources"

For example:

./install-cocos3d.sh -f -2 "../../cocos2d/cocos2d-iphone-1.1"

The cocos2d source code must be available and identified using the -2 switch so that the installer can link the cocos2d libraries to the cocos3d templates and demo projects.

If you encounter 'rsync' errors during installation, it's typically because you are trying to run the installer without first navigating to the cocos3d distribution directory. Be sure to run the installer from the cocos3d distribution directory.

That's it!

Note: Again the above extract is a part of the readme file which is in the root folder of your cocos3d directory.

I would also suggest you to read the readme file, as it contains a lot of valuable info.

EDIT: There is nothing wrong with the install. What you want can be achieved as follows

1) Select new file from navigator.

2) In the following window under iOS, select Cocoa Touch.

3) Select Objective-C class from the templates in that list.

4) Fill in the appropriate class name and under "subclass of" field type in the parent class name from where you need to inherit (Ex: CCNode) and click next.

5) That will be the template file you needed along with the necessary .h and .m files.

Altri suggerimenti

Your installation is successful. You can add class as custom by adding class normally. ie. by adding objective-c class in cocoatouch section in add new class window. There wont be any special templates for adding custom class in cocos3d.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top