Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macfanboy

macrumors 6502a
Original poster
Jun 5, 2007
915
162
Wirelessly posted (Mozilla/5.0 (iPod; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A347 Safari/525.20)

how would I put a shape on a random position? I can put it at a random point from 0 to 480 (height) and 0 to 320 (width) but it would change the size
 

xsmasher

macrumors regular
Jul 18, 2008
140
0
Can you post the lines of code you're using to draw the image, or to set it's frame?

You want change frame.origin.x and frame.origin.y, but leave frame.size.width and frame.size.height alone. It sounds like you're changing the size, but not the origin.
 

macfanboy

macrumors 6502a
Original poster
Jun 5, 2007
915
162
Wirelessly posted (Mozilla/5.0 (iPod; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A347 Safari/525.20)

I haven't written the code yet because Im on vacation. I just used logic to realize this would happen but couldn't find an easy solution to it. Thank you for helping. It seems like it will work now.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.