New to obj-c and have no idea where to start: vector graphics

Nibbie
Posts: 2
Joined: 2009.05
Post: #1
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:
Code:
var mysprite:Sprite=new Sprite(); addChild(mysprite);
mysprite.graphics.beginFill(0xff0000,1);
mysprite.graphics.drawCircle(100,100,30);
mysprite.graphics.endFill();

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!
Quote this message in a reply
Nibbie
Posts: 2
Joined: 2009.05
Post: #2
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:
http://developer.apple.com/iPhone/librar...59-CH3-SW9
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!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Reflect a vector in relation to another vector ipeku 4 5,225 Dec 12, 2011 07:17 AM
Last Post: ipeku
  Vector graphics rendering: Best approach? Luipaard 5 5,007 Sep 28, 2007 08:40 AM
Last Post: TomorrowPlusX
  2d vector graphics game: GL or Flash? Krazygluon 1 3,047 Oct 30, 2006 09:57 PM
Last Post: maximile
  2D vector graphics game using AmanithVG muratmat 2 4,031 Jul 15, 2006 05:37 AM
Last Post: muratmat
  Vector versus raster graphics in openGL WhatMeWorry 2 4,038 Dec 29, 2005 01:23 AM
Last Post: WhatMeWorry