New to obj-c and have no idea where to start: vector graphics
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!
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!
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!
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!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Reflect a vector in relation to another vector | ipeku | 4 | 4,433 |
Dec 12, 2011 07:17 AM Last Post: ipeku |
|
| Vector graphics rendering: Best approach? | Luipaard | 5 | 4,552 |
Sep 28, 2007 08:40 AM Last Post: TomorrowPlusX |
|
| 2d vector graphics game: GL or Flash? | Krazygluon | 1 | 2,737 |
Oct 30, 2006 09:57 PM Last Post: maximile |
|
| 2D vector graphics game using AmanithVG | muratmat | 2 | 3,595 |
Jul 15, 2006 05:37 AM Last Post: muratmat |
|
| Vector versus raster graphics in openGL | WhatMeWorry | 2 | 3,416 |
Dec 29, 2005 01:23 AM Last Post: WhatMeWorry |
|

