New to obj-c and have no idea where to start: vector graphics - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: New to obj-c and have no idea where to start: vector graphics (/thread-1241.html)
New to obj-c and have no idea where to start: vector graphics - billybob - May 27, 2009 10:07 AM
I'm brand spanking new to objective-c and want to get my feet wet with vector graphics, but after spending hours looking for a very simple tutorial that explains I still don't even know how to draw something and have it appear on screen, and I'm about to pull my hair out. I've gone over the iphone developer resources, I downloaded QuartzDemo, which does exactly what I want to do but does it through 3-4 classes with no explanation of how they interact.
I don't know if anyone is familiar with Flex/Actionscript, but basically i just want to make a simple iphone app that does this:
I've found a bunch of code snippets online using CG functions, but none of them work, and i don't know if it's because I'm using the wrong "context" or because I don't have the right "view" (and I don't really know what either of those words refer to), or if I'm putting this code in the wrong place (I've tried putting it in the "viewDidLoad" and "loadView" functions, in the AppNameViewcontroller.m class of a new view based application, to no avail)
I feel like if I were just able to create a new app, and get to the point where I can draw a line or a circle or something simple with vector graphics, I'd be set; I just can't get there! If anyone can point out what I'm doing wrong here, I'd really appreciate it, TIA!
New to obj-c and have no idea where to start: vector graphics - billybob - May 27, 2009 11:17 AM
Allright, kinda figure out how to do it... I don't know if anyone else cares (of if I'm unique in how much of a dumbass i am), but to get it to draw vector graphics, first I followed this really simple tutorial by apple:
and then i took the code from this site: http://alanduncan.net/?q=node/4
and pasted it in the "drawRect" function in the myview.m file.
Though if anyone's reading this- what's the deal with this "drawRect" function? I don't see it called anywhere... so the compiler/virtual-machine calls it on it's own? If so, does it call it repeatedly, or just when the app loads or something? Thanks!