¡@

Home 

2014/10/15 ¤U¤È 10:15:02

iphone Programming Glossary: topoint

Implementing touch-based rotation in cocoa touch

http://stackoverflow.com/questions/2780536/implementing-touch-based-rotation-in-cocoa-touch

currentPoint touch locationInView self current position of touch if touch view self Utility getDistance currentPoint toPoint self.middle ROTATE_RADIUS middle is centre of view Utility getDistance currentPoint toPoint self.middle MOVE_RADIUS will.. getDistance currentPoint toPoint self.middle ROTATE_RADIUS middle is centre of view Utility getDistance currentPoint toPoint self.middle MOVE_RADIUS will be rotation gesture remember state of view at beginning of touch CGPoint top CGPointMake self.middle.x.. currentPoint touch locationInView self current position of touch if touch view self Utility getDistance currentPoint toPoint self.middle ROTATE_RADIUS Utility getDistance currentPoint toPoint self.middle MOVE_RADIUS a rotation gesture rotate tile..

Draw a line over UIViewController

http://stackoverflow.com/questions/3003458/draw-a-line-over-uiviewcontroller

Interaction Enabled in the XIB... EDIT Code sample @interface TransparentDrawingView UIView CGPoint fromPoint CGPoint toPoint void drawLineFrom CGPoint from to CGPoint to @end @implementation TransparentDrawingView void initObject Initialization.. code self initObject return self void drawRect CGRect rect Drawing code Draw a line from 'fromPoint' to 'toPoint' void drawLineFrom CGPoint from to CGPoint to fromPoint from toPoint to Refresh self setNeedsDisplay @end share improve..

Moving UIView up when keyboard shown

http://stackoverflow.com/questions/5220818/moving-uiview-up-when-keyboard-shown

@interface UIView FormScroll void scrollToY float y void scrollToView UIView view void scrollElement UIView view toPoint float y @end UIView FormScroll.m #import UIView FormScroll.h @implementation UIView FormScroll void scrollToY float y UIView.. view CGRect theFrame view.frame float y theFrame.origin.y 15 y y 1.7 self scrollToY y void scrollElement UIView view toPoint float y CGRect theFrame view.frame float orig_y theFrame.origin.y float diff y orig_y if diff 0 self scrollToY diff else..

Undo drawing in Paint Application

http://stackoverflow.com/questions/6689600/undo-drawing-in-paint-application

point for int p 0 p undo objectAtIndex l count 1 p self drawErase undo objectAtIndex l objectAtIndex p CGPointValue toPoint undo objectAtIndex l objectAtIndex p 1 CGPointValue Erase NO glColor4f app.rg app.bg app.gg kBrushOpacity void drawErase.. l objectAtIndex p 1 CGPointValue Erase NO glColor4f app.rg app.bg app.gg kBrushOpacity void drawErase CGPoint start toPoint CGPoint end static GLfloat eraseBuffer NULL static NSUInteger eraseMax 64 NSUInteger vertexCount 0 count i EAGLContext setCurrentContext..

Save OpenGL Drawn item as a Image

http://stackoverflow.com/questions/9660723/save-opengl-drawn-item-as-a-image

previousLocation.y bounds.size.height previousLocation.y Render the stroke self renderLineFromPoint previousLocation toPoint location Handles the end of a touch event when the touch is a tap. void touchesEnded NSSet touches withEvent UIEvent event.. self previousLocation.y bounds.size.height previousLocation.y self renderLineFromPoint previousLocation toPoint location Drawings a line onscreen based on where the user touches void renderLineFromPoint CGPoint start toPoint CGPoint.. toPoint location Drawings a line onscreen based on where the user touches void renderLineFromPoint CGPoint start toPoint CGPoint end static GLfloat vertexBuffer NULL static NSUInteger vertexMax 64 NSUInteger vertexCount 0 count i EAGLContext..

Record the drawing as a m4v video file - OpenGL

http://stackoverflow.com/questions/9661259/record-the-drawing-as-a-m4v-video-file-opengl

previousLocation.y bounds.size.height previousLocation.y Render the stroke self renderLineFromPoint previousLocation toPoint location Handles the end of a touch event when the touch is a tap. void touchesEnded NSSet touches withEvent UIEvent event.. self previousLocation.y bounds.size.height previousLocation.y self renderLineFromPoint previousLocation toPoint location Drawings a line onscreen based on where the user touches void renderLineFromPoint CGPoint start toPoint CGPoint.. toPoint location Drawings a line onscreen based on where the user touches void renderLineFromPoint CGPoint start toPoint CGPoint end static GLfloat vertexBuffer NULL static NSUInteger vertexMax 64 NSUInteger vertexCount 0 count i EAGLContext..