Information:
I want to do some tasks on images such as resize, crop, rotate and so on.
I hope they could be objects so that I can manipulate them one by one easily. In development time we could run up to several images at the same time to working on, just a-little-like game programming.
I see there's several things to choose toghether with XCode:
- Cocoa (default?)
- Quartz2D
- OpenGL (ES 2.0?)
- Cocos2D/Box2D
I'm new to mobile development as well as iOS.
Question:
- Because I could choose only one to start with, which should I choose? Or are there any other libraries/frameworks?
I've used Cocos2d Cocos2d for a game and it was pretty easy to pick up and manipulate images on screen. As it is build on top of OpenGL it abstracts you away from the nuts and bolts. But also it might be a bit heavy for your needs.
So if you can do what you need in Cocoa then use that but if you need more then look at Cocos2d.
Related
As my app's UI grows in complexity, I'm finding it tedious exporting all the graphics for things like buttons. For instance with toggle buttons: up, down, disabled, on, off * 5 buttons * 2 for retina = 50 graphics which need exporting! Is it a viable strategy to do as one does in CSS and make a sprite sheet? If so, might you point me in the direction of a snippet or two on how to handle loading and displaying the appropriate subsection?
You could use a sprite sheet, and a way to do that is here:
http://www.danielsefton.com/2012/07/texture-atlases-for-uikit-with-texturepacker/
As an alternative to sprite sheets, PaintCode is a great option from the Mac App Store. It makes it very easy to update graphics, simply copy and paste code. Unfortunately it's relatively high-priced.
If you need to create images that Paint Code can't handle, consider using a Mac app to automatically duplicate & resize the artwork, this way you only have to create it once. There are several on the Mac App Store. Some are free and others are paid. But if you want high quality resizing, it's best to use the tool you made the art with to do the downsizing (such as PhotoShop).
Ignoring price for the moment, would using Unity for a 2D game be better than building one natively in iOS, i.e. faster and more powerful because of the underlying OpenGL usage, or is it either not supported well, complete overkill, not much better than just using UIImages and/or Quartz, or for some other reason worse?
Depends on the game. If you have under 100 or so sprites, you can just use UIViews without any big issue. Over that and you're starting to get in the realm where OpenGL will matter.
If I were doing a game with with lots of sprites or particles, I'd certainly look into Unity. Then again, I'd also look into Cocos2D. (I'm not directly familiar with either, my games are all UIView-based.)
Building any game using Unity instead of just UIKit/Quartz has the advantage that it will be easier to port it to other platforms if you want to.
The core question is "what are my options for decent particle effects in an iOS app?"
I wrote an iPad app where I wanted to use a large amount of UIKit objects in the UI and just keep to a native iPad codebase feel. However I wanted nice particle effects, so instead of going with cocos2d and distancing myself from using native objects directly, I wrote my own particle effects engine utilizing quartz. It works, but the performance is very underwhelming.
Do I have to go with an openGL ES solution to get any good performance at all (openGL and uikit view don't play nicely together); Are there any libraries out there that will let me simply add a UIView that contains the particle effects systems layered in my app as I see fit to place it (pretty much what I've tried to do with pretty bad performance)?
(Forgive me if my usage/knowledge of GL is rusty; I've been out of sight for a few months and do not have a strong handle on it.)
I believe they've added particle effects to Core Animation as of iOS 5. Try this video or look up CAEmitterLayer.
I'm looking for a good example of a basic OpenGL App for Mac OS X, but not too simple.
I have a good solid base of experience with iOS and objective-c, but I've never built a Mac OS X App.
All I've been able to find are super simple examples that do all the drawing and logic in drawRect: or overly complex examples with layers and layers of abstraction. I don't want to use Glut, SDL, or any other 3rd party libs or engines.
I want to be able to drive a Game Loop and use CADisplayLink like I do on my iOS games. I'd also rather not use .xib files because I like to understand what's going on and having that black box there hides too much for me, although I'd be happy to use it as a first step if it got me everything else (game loop, CADisplayLink, etc).
My iOS code creates it's OpenGL Views by hand, but there seems to be enough of a difference between iOS and OS X that I'm having trouble making heads or tails of it. I just need to get a Window and an OpenGL view and be able to draw to that via the game loop.
Can someone point me to a good resource? The Apples examples jump between to simple and too complex as does everything else I can find on the Internet.
Sorry I can't answer to your questions. I always did use XIB files (a looong time ago, I too always wanted to re-invent the wheel, but now I'm lazy and prefer getting stuff done :p) and I never used display links.
What don't you like about overriding drawRect: ?
And the sample I used to get started with OpenGL was this one : http://developer.apple.com/library/mac/#samplecode/CocoaGL/Introduction/Intro.html#//apple_ref/doc/uid/DTS10004501
Not too complicated, and simple enough to understand it (and it doesn't use any XIB, if I remember well :p)
I want to write something like this: http://www.youtube.com/watch?v=5S4KpCkHDqM I mean, I want to have 2D gaming space, but to have stylized as 3D, so my characters will move on the surface, but will have nice 3D effect. I wounder if Flash/ActionScript will do? Any other suggestions?
Flash and Actionscript can definitely accomplish this. There are at least 2 ways to accomplish the 3D look in 2D space.
The easiest is to do as #Blender said in the comments. Render some 3D images and bring them into flash. There are easy tools in flash to create animated sprites, including a native movieClip class, that has a timeline to play back frame-based animation.
But there is also full 3D in flash. You can bring low-polygon 3D models into flash easily using free and open source libraries such as Away3d (away3d.org) and papervision (papervision3d.org). Presently, flash player 10 has runs slowly when using these libraries.
But Adobe is about to release a new version of the player (version 11) that supports open GL for 3D and has significant performance improvements.
Away3D and papervision have already developed version of their libraries to support the new beta player and openGL.
So to summarize, yes - flash can make a game like that. It is currently the best way to develop games that are intended to be played in a browser. Because at least for the time being it has the most widespread support, and is stable between platforms and browsers.
Your example is pretty much entirely 2D: it just uses effects like shadows, animation and parallax scrolling between layers to achieve a (mildly) 3D effect.
As Plastic Sturgeon and Blender have pointed out, Blender might help for creating your assets - but it has a pretty steep learning curve, and you might be more comfortable 'faking it' in Adobe Illustrator or Photoshop if you've used those before.
Once you've created your assets, you need a platform to put together your gameplay: Flash is one possibility, but you could also look at Unity3D, which has good support for 2D and 3D, and has a browser plug-in if you want to make your game web-based.
If you're looking for a java-based solution, you could try Processing, which is cross-platform, and can export to javascript for web deployment. It's not exactly designed as a gaming environment, but it might do the trick - and it's free.
Hope this helps.