Domanda

I am developing an iPhone application that uses Cocos3d to draw shapes and images. Now I want to draw some text. Can anyone please guide me on how to draw text using Cocos3d?

Thanks in advance!

È stato utile?

Soluzione

If you want to embed text in the 3D scene (like add a sign on a wall within the 3D scene), you can use CC3BitmapLabelNode. The CC3DemoMashUp app includes an example of how to do this, in the addBitmapLabel method of CC3DemoMashUpScene. The example actually does more than you need, because it uses a specialized subclass of CC3BitmapLabelNode that wraps the text around a cylinder. But it will give you the idea of how to use CC3BitmapLabelNode.

If you want to add text as a 2D overlay as part of the user interface (like a button, menu, or message to the user), use the standard Cocos2D components for that. You can add these 2D components to your customized CC3Layer. See the CC3DemoMashUpLayer for an example of how to do this.

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