I’m trying to implement a gameplay like Flight control and harbor master on the iphone using unity iphone 1.7 where the user essentially draws lines as paths for the player and other objects. I’ve got it working on the PC as i thought testing on the pc would be fast and easy. I’ve used the basic OpenGL drawing calls to draw each point on the line.
It seems like everything works fine in the unity editor and i can see the lines being drawn through mouse inputs. But now when i convert mouse input to iphone touch inputs and tried testing it on the iPad the lines don’t show up for some reason. It adds the vertices to the vertex buffer with correct co-ordinates but just doesn’t draw on the device.
Any reasons why OpenGL drawing calls wouldn’t work on the iPad?
There are other techniques of free drawing using Unity. You can either use Line Renderer which is not the best of the solutions in terms of the memory if you are considering drawing a lot of lines on the screen because it adds a component for each set of points on the screen and the other is by drawing meshes using the Graphics class which is again available only in Unity Pro. I’m not sure if either of this work for the iphone but these are all i found from all the forums and online support for unity. Ofcourse OpenGL is the fastest of all these techniques by using GL calls but that too is not supported on the iphone. Long story short there are 3 techniques of line drawing that i know using unity:
Line Renderer
Using the Graphics class and
OpenGL
I hope unity 3 has the support for line drawing on the iphone using OpenGL.
You could tab into it, but using unity for such a thing is more than just a massive overkill cause you catapult yourself out of the 3G download limit for no reason as you don’t need or have much use for unity at all in this case as this is really a UIKit + CoreGraphics + CoreAnimations thing
The drawing part is actually a small tack on at the end of a larger app. Just a lil extension a the backend where a kid could draw a picture for the ‘main character.’ so I was looking to find some module that would allow this. I wonder if the like could be ‘outside’ the Unity portion of an app?
As for the 3G dl limit… I’ve pretty much resigned myself to never even coming close…
Ah I see
Yeah well in that case you could use UIKit + CoreGraphics for an “overlay draw view” basically for this purpose and then use the present functionality in UIKit to grab the content, store it as image and load it from unity again
Create lines using the Mesh class. That’s what I do with Vectrosity, and it’s the fastest since you only have to update lines by script if they actually move, and you can have many line segments with one object and one draw call, even if they’re different colors.