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!
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.
Related
I am using custom marker for AR.js which is working fine, But I need to create a black border less or margin less custom marker for my project but when i create it along with it's pattern it's not effected rather it's detect the old custom marker. Please help me if it's possible.
Need to develop the component shown in the image above using Objective-C language. No idea where to start and which framework to use. Any heads up/reference links to develop this component is highly appreciated.
Use a combination of UIBezierPaths with custom fill colors. You can either use a shape layer or core graphics. Bezier path allows you to construct a custom path, so the first one will be a triangle, and the second a quadrilateral.
You could also use paint code if you want to construct the path visually.
Look at this
https://www.raywenderlich.com/76433/how-to-make-a-custom-control-swift
It's a very general way to create whatever control you want.
I want to give a effect for UILabel text that will look exactly same like we are writing on a paper using pen. I searched for it but not getting any related suggestion/solutions, there are solutions like typing effect but not as I need.
The only way to accomplish this is to manually draw the stroked for the inserted letters via a graphics API (Core Graphics, OpenGL, etc.). You cannot accomplish this without manual drawing. It is possible that there's a 3rd party library that can help you with this. You can use a tool like PaintCode to extract the bezier paths and what not to help you manually drag glyphs for each letter in an alphabet and then animate those paths using Core Animation or another graphical drawing mechanism.
I'm building app for kids with lots of interactive image objects (click on pic & get result)
For example: I have cat on my screen and with click on it I need to produce sound.
After having read lots of info I got the idea that it's almost impossible to transform certain parts of image to clickable objects.
While there are lots of games on the app store which contains lots of custom shaped clickable objects. How did they manage to do this?
What I need read to get the answer? Thank you in advance.
UPDATE: I can have my clipart images as vector-graphic, e.g. .svg file. Will it make the situation simpler?
Implement each image as a UIButton and set the background of each button as the image desired. (setBackgroundImage)
Links:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIButton_Class/
Using images is one option, but if you want taps within a certain non rectangular shape, check out OBShapedButton
If you really want super accurate touches, you could construct a bezierpath in the shape of the image then use
[UIBezierPath containtsPoint:]
https://developer.apple.com/library/ios/documentation/uikit/reference/UIBezierPath_class/Reference/Reference.html#//apple_ref/occ/instm/UIBezierPath/containsPoint%3a
You could also possibly get the pixel colour underneath the touch, but that wouldn't give much room for error if the user tapped near the edge:
https://stackoverflow.com/a/7101544/78496
I am trying to capture an Image from Camera show it on the UIImageView.
After that I have some buttons for e.g. "Paint Brush", "Eraser", "Undo", "Save".
Using Brush I want to mark some items on the image captured.
What is the best way to accomplish the annotation and then save the image.
I am not sure what should be used. Should I use touchesbegan/end etc.. or some other alternative.
Regards,
Nirav
U need to understand Bézier Path Basics.Search it on Google or Apple Documentation.
The UIBezierPath class is an Objective-C wrapper for the path-related features in the Core Graphics framework. You can use this class to define simple shapes, such as ovals and rectangles, as well as complex shapes that incorporate multiple straight and curved line segments.