How to zoom a circular region with Cocos2d? - ios

I am working on a Cocos2d project for iPad and iPhone, and now I need to develop something that looks too small for iPhone.
My first approach was to redesign it to make it possible to look bigger, but then I though that a region zoom effect would be great. The bad point is that I don't know how to do it... I really don't know what would be the correct/best approach to do it.
I have already checked out the Cocos2D CCLens3D build in effect, but it doesn't give me the results I want.
I would love to get the same result than when you long-press a textview/textfield on the UIKit:
Thanks in advance for your help!

If your still looking for a solution:
http://rombosblog.wordpress.com/2012/06/03/magnifierglassforcocos2d/
Uses CoreGraphics to render. Although this implementation works (requires some tweaking), I found that it lacked that Gaussian distribution effect I was looking for and was quite expensive if you updated the magnifying effect in a small interval.

Related

AR.js Custom Markers

I am new to WebAR, but I have experience with building AR scenes with Unity3D and software such as Vuforia and 8thWall.
I have a question with the markers with AR.js. Why are they stuck with the thick black border? Is the software not able to just recognize a unique image like how Vuforia and Wikitude works? I apologize for how naive I may be when it comes to WebAR, however, I see this as an issue for the adoption rate of this technology if developers cannot use truly custom images and patterns. Is there a solution available that I may have missed somewhere? What happens if someone deletes/erases the big black border on the marker? Does it still work?
Thanks to anyone who can shed some light on this!
Ar.js uses artoolkit and therefore is marker based. If you want to use it, there is not much you can do about it. Still You can have unique images inside the black box but not much else.
Worth mentioning, it is possible to make the borders thinner, there's even a branch - work in progress worth looking into.
Aframe-argon tried integrating aframe and vuforia, but i'm not sure if it's up to date.

Graphic in iOs device is all distorted Unity

Right now I'm developing application for iOs by Unity3D, and I have no idea what's happening with all my graphic. All textures are absolutely distorted and I've been struggling with this for a long time with no success.
I believe Unity compresses textures before convert the project to iOS, but I really can't find out how to change this setting or even knock it off. I appreciate any help from you guys. Here's the screenshot of my Texture Settings. I've setup it according to Ray Wenderlich lesson.
P.S.: I've tried to use "Point" for Filter Mode, but it had made the texture even worse.
I would suggest disabling mitmaps to see if this solves your problem, and making sure you have the best quality settings in Edit>Player Settings>Quality
As an aside, how large is your button image? You're overriding the max size to be 2048 for what seems to be a button. That sounds a little excessive.
By "distorted" you mean "blurred"? Try to uncheck "Generate Mip Maps".

Draw image xcode6 ios8

Good afternoon,
I would like to know if I can take a picture and then draw something in the image (with the finger movement, for example, a black line "handwritted"). Is it possible?
If that's possible... How can I start doing that?
Edit:
I want to take a picture from my iPhone (that's what I currently have in my App) and then I would like to draw something in that picture.
Thanks in advance.
There is no one tutorial to this. And as #Stephen mentioned in the comments, it is not a 2 min job. However, you can start with the following tutorials.
http://w3z.in/7ef - How To Make A Simple Drawing App with UIKit.
http://w3z.in/9b1 - Apple's official UIKit guide.
http://w3z.in/e2c - iOS 7 graphics tutorial.
The key here would be to have patience, do some small experiment apps and then figure out what to do in your app.
Thanks

iOS Heavy image switching

I'm developing a app that will showcase products. One of the features of this app is that you will be able to "rotate" the product, using your finger/Pan-Gesture.
I was thinking in implementing this by taking photos of the product from different angles so when you "drag" the image, all I would have to do is switch the image according. If you drag a little, i switch only 1 image... if you drag a lot, i will switch them in cadence making it look like a movie... but i have a concerns and a probable solution:
Is this "performatic"? Since its a art/museum product showcase, the photos will be quite large in size/definition, and loading/switching when "dragged a lot" might be a problem because it would cause "flickering"... And the solution would be: instead of loading pic-by-pic i would put them all inside one massive sheet, and work through them as if they were a sprite...
Is that a good ideia? Or should I stick with the pic-by-pic rotation?
Edit 1: There`s a complicator: the user will be able to zoom in/out and to rotate the product in any axis (X, Y and Z)...
My personal opinion, I don't think this will work the way you hope or the performance and/or aesthetics will not be what you want.
1) Taking individuals shots that you then try to keyframe to based on touch events won't work well because you will have inevitable inconsistencies in 'framing' the shots such that the playback won't be smooth
2) The best way to do this, I suspect, will be to shoot it with video and shoot it with some sort of rig that allows you to keep the camera fixed while rotating the object
3) I'm pretty sure this is how most 'professional' grade product carousel type presentations work
4) Even then you will have more image frames than you need -- not sure whether you plan to embed the images files in app or download on demand -- but that is also a consideration in terms of how much downsampling you'll need to do to reduce frames/file size
Suggestion
Look at shooting these as video (somewhat like described above) and downsampling and removing excess frames using a video editor. Then you could use AVFoundation for playback and use your gestures to 'scrub' into the video frames. I worked on something like this for HTML playback at a large company and I can assure you it was done with video.
Alternatively, if video won't work for you. Your sprite sheet solution might work (consider using SpriteKit). But then keep in mind what I said about trying to keyframe one off camera shots together -- it just won't work well. Maybe a compromise would be to shoot static images but do so by fixing the camera and rotating the objects at very specific increments. That could work as well I suppose but you will need to be very careful about light and other atmospehrics. It doesn't take much variation at all to be detectable to the human eye causing the whole presentation to seem strange. Good luck.
A coder from my company did something like this before using 360 images of an object and it worked just great but it didn't have zoom. Maybe you could add zoom by adding a pinch gesture recognizer and placing the image view into a scroll view to zoom in on the static image.
This scenario sounds like what you really need is a simple 3D model loader library or write it in OpenGL yourself. But this pan and zoom behavior is really basic when you make that jump to 3D so it should be easy to find lots of examples.
All depends on your situation and time constraints :)

Stretching a UIImage across the length of a UIBezierPath

What I basically need to achieve is a Fruit Ninja - style "slash" effect, where the "slash" trails the user's touch and follows the shape of the user's gesture, and is thinner the longer the distance the user has swiped.
The simplest way to achieve this seemed to be to collect all the points the user passes through in a UIBezierPath, and "stretch" an image through the length of the BezierPath. This would achieve the kind of "trailing" effect I was looking for and also ensure that the line is thinner if the distance travelled is longer.
However I can't seem to find a way to actually implement this. Is this even possible?
Alternatives? Thanks.
P.S: This is for a low-medium priority section of a regular app and not a game, so I would like to avoid having go down to OpenGL and spend a lot of time to achieve this (with completely custom drawing, etc). Something at the SDK level would be preferred, and if that's not possible at all, we'll just figure out a different UI.
Thanks!
For pretty easy-to-use stretching teqhniques of images/views you could look into
https://github.com/hfossli/AGGeometryKit/
I recommend trying to draw using CoreGraphics. See this link
http://www.effectiveui.com/blog/2011/12/02/how-to-build-a-simple-painting-app-for-ios/
Okay. Maybe you can use this.
https://github.com/hfossli/AGDraw
Just something I wrote a while ago. Hit clear and try to draw something (clear will toggle between two types of strokes). You'll see the width of the penstroke will increase with the velocity you use.. I guess that fits your need. If you fix some bugs, please make a pull request. You are free to use the code, but I will add a MIT license later.

Resources