Mobile Application Development L06: ios Drawing and Animation



Similar documents
Praktikum Entwicklung von Mediensystemen mit ios

2. About iphone ios 5 Development Essentials. 5. Joining the Apple ios Developer Program

Sprite Kit Programming Guide

View Controller Programming Guide for ios

Development of Computer Graphics and Digital Image Processing on the iphone Luciano Fagundes

Objective C and iphone App

Advanced Graphics and Animations for ios Apps

Recipes4Success. Animate a Rocket Ship. Frames 6 - Drawing Tools

Overview of the Adobe Flash Professional CS6 workspace

Course Project Lab 3 - Creating a Logo (Illustrator)

Beginner level: Modules 1 to 18. Advanced level: Quick review of modules 1 to 18, then following to module A Simple ios Application

Assignment 2: Matchismo 2

How To Develop An App For Ios (Windows)

LAMBDA CONSULTING GROUP Legendary Academy of Management & Business Development Advisories

ACE: After Effects CS6

WPF Shapes. WPF Shapes, Canvas, Dialogs 1

ITP 342 Mobile App Dev. Alerts

Responsive Web Design (RWD) Best Practices Guide Version:

Start Developing ios Apps Today

Getting Started With DraftSight A Guide For AEC Users

ART 170: Web Design 1

Adobe Illustrator CS6. Illustrating Innovative Web Design

Silverlight for Windows Embedded Graphics and Rendering Pipeline 1

2. Create the User Interface: Open ViewController.xib or MainStoryBoard.storyboard by double clicking it.

The key to successful web design is planning. Creating a wireframe can be part of this process.

Graphic Objects and Loading Them into TGF2/MMF2

ACE: Illustrator CC Exam Guide

ECDL / ICDL Presentation Syllabus Version 5.0

Omnitapps Cloud Request Version 1.0 Manual

Visualization of 2D Domains

Creating a Poster in PowerPoint A. Set Up Your Poster

Flash MX 2004 Animation Lesson

Lab 2: Visualization with d3.js

Flash MX Image Animation

Tag Specification Document

m ac romed ia Fi r e wo r k s Curriculum Guide

Developer's Cookbook. Building Applications with. The Android. the Android SDK. A Addison-Wesley. James Steele Nelson To

Step 1: Setting up the Document/Poster

Done. Click Done to close the Capture Preview window.

Cross-Compiling Android Applications to the iphone

Layout Tutorial. Getting Started

WEB DESIGN COURSE CONTENT

INTRODUCTION TO IOS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 13 02/22/2011

Copyright 2010 The Pragmatic Programmers, LLC.

Figure 3.5: Exporting SWF Files

Fireworks for Graphics and Images

VIRGINIA WESTERN COMMUNITY COLLEGE

Creating Hyperlinks & Buttons InDesign CS6

Adobe Illustrator CS5 Part 1: Introduction to Illustrator

WEB MAPPING TOOL DOCUMENTATION

Anime Studio Debut vs. Pro

CPIT-285 Computer Graphics

MicroStrategy Analytics Express User Guide

Assignment I Walkthrough

3D Animation Graphic Designer

Getting Started: Creating the Backdrop

Lesson 7 - Creating Animation II

Blender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 9 The Game Engine

Learn iphone and ipad game apps development using ios 6 SDK. Beginning. ios 6 Games. Development. Lucas Jordan. ClayWare Games tm

Using PowerPoint s Advanced Features. What Are Advanced Features? Basic Skills:

ClarisWorks 5.0. Graphics

Android and OpenGL. Android Smartphone Programming. Matthias Keil. University of Freiburg

Adobe Certified Expert Program

Charts for SharePoint

Sending images from a camera to an iphone. PowerShot G1X MarkII, PowerShot SX600 HS, PowerShot N100, PowerShot SX700 HS, PowerShot ELPH 340 HS

Shipment Label Header Guide

User Guide. idraw for Mac OS X v2.5.1

SketchUp Instructions

Super Resellers // Getting Started Guide. Getting Started Guide. Super Resellers. AKJZNAzsqknsxxkjnsjx Getting Started Guide Page 1

Adobe Illustrator CS6 Tutorial

Adobe InDesign Creative Cloud

Introduction to Microsoft Publisher : Tools You May Need

SAS BI Dashboard 4.3. User's Guide. SAS Documentation

CMS Basic Training. Getting Started

Mobile Web Site Style Guide

Microsoft Office PowerPoint Creating a new presentation from a design template. Creating a new presentation from a design template

WEST JEFFERSON HILLS SCHOOL DISTRICT THOMAS JEFFERSON HIGH SCHOOL DIGITAL DESIGN GRADES

ONYX. Preflight Training. Navigation Workflow Issues Preflight Tabs

Chapter 9 Slide Shows

13-1. This chapter explains how to use different objects.

Making a Poster Using PowerPoint 2007

Using Adobe Dreamweaver CS4 (10.0)

WP Popup Magic User Guide

ArcGIS. Tips and Shortcuts. for Desktop

Adobe Dreamweaver Exam Objectives

MyGraphicsLab ADOBE ILLUSTRATOR CC COURSE FOR GRAPHIC DESIGN & ILLUSTRATION Curriculum Mapping to ACA Objectives

Access 2007 Creating Forms Table of Contents

Printing Guide. MapInfo Pro Version Contents:

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

Transcription:

Mobile Application Development L06: ios Drawing and Animation Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9)

Views 2

UIView Defines a rectangular area on the screen Responsibilities Draw content Arrange subviews React to touch events 3

Simple Views UILabel UIButton UITextField UISwitch UISlider UIActivityIndicatorView UIProgressView UISegmentedControl UIPageControl 4

Bar Views Status Bar iphone 10:15 PM UINavigationBar UISearchBar Search UIToolbar UITabBar 5

Complex Views MKMapView UITableView UIWebView UITextView 6

Draw content How? CoreGraphics Get the graphics context Configure the brush (color, line width, etc.) Define a shape Stroke or fill the shape Where? Subclass UIView override - (void)drawrect:(cgrect)rect For redraw: [view setneedsdisplay] 7

Drawing Example - (void)drawrect:(cgrect)rect { // Get the graphics context CGContextRef context = UIGraphicsGetCurrentContext(); // Set stroke and fill color [[UIColor whitecolor] set]; // Define a line as the shape to be drawn! CGContextMoveToPoint(context, 10.0, 30.0);! CGContextAddLineToPoint(context, 310.0, 30.0); // Stroke the line! CGContextStrokePath(context); } 8

Layout (Sub-) Views Where? In the interface description (.xib) In a View Controller (e.g., loadview) In a View (initwithframe:) How? Manage the view hierarchy (subviews, superviews) Manage the frame and bounds 9

Frame vs. Bounds Frame Origin: 0, 0 Size : 320, 480 Bounds Origin: 0, 300, 0 100 Size : 320, 480 10

Frame vs. Bounds Frame Origin: 0, 1000 Size : 320, 480 Bounds Origin: 300, 100 Size : 320, 480 11

Frame vs. Bounds Frame Origin: 0, 0 Size : 320, 480 380 Bounds Origin: 300, 100 Size : 320, 380 480 12

Automatic Layout parent.autoresizessubviews = YES Define an autoresize mask In the interface description (.xib) view.autoresizingmask =... Resizing Behavior flexible left / top / right / bottom margin flexible width / height 13

React to Touch Events How? view.userinteractionallowed = YES Multitouch: view.multipletouchenabled = YES Where? Subclass UIView Override event handling methods Events are also forwarded to the View Controller! 14

Touch Events // initial touch - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event // updated touch - (void)touchesmoved:(nsset *)touches withevent:(uievent *)event // cancelled touch (by external event) - (void)touchescancelled:(nsset *)touches withevent:(uievent *)event // finished touch - (void)touchesended:(nsset *)touches withevent:(uievent *)event 15

Animation 16

Core Animation Implicit Animations Explicit Animations Changing animatable properties triggers implicit animations Create an animation object that defines and controls the animation 17

Implicit Animations static int i = 0; // start an implicit animation [UIView animatewithduration:1.0 animations:^{ // move the view view.center = CGPointMake(50+random() % 220, 50+random() % 360); // rotate the view view.transform = CGAffineTransformMakeRotation( random() % 360); // change the color view.backgroundcolor = i++ % 2? [UIColor bluecolor] : [UIColor redcolor]; }]; 18

Explicit Animations Create Animation Object CABasicAnimation CAKeyframeAnimation Configure animation Duration Timing function Key-path of animated property From and to value 19

Example: Move Animation CGPoint position = CGPointMake(100, 200); // create an animation object CABasicAnimation *move = [[CABasicAnimation alloc] init]; // configure the key path and value move.keypath = @"position"; move.tovalue = [NSValue valuewithcgpoint: position]; // set the animation duration move.duration = 1.0; // start the animation [timelabel.layer addanimation:move forkey:@"moveanimation"];! 20

Transformations Animations can use affine transformations to manipulate the layer s geometry CGAffineTransform Every rendered pixel is transformed Common transformations: CGContextTranslateCTM: move origin CGContextScaleCTM: change size CGContextRotateCTM: rotate around anchorpoint 21