Animations 1 Fall 2012 CS2302: Programming Principles.

Slides:



Advertisements
Similar presentations
For(int i = 1; i
Advertisements

2D Geometric Transformations
Adobe Flash CS4 – Illustrated Unit E: Optimizing and Publishing a Movie.
Graphics.  2D Graphics using  ImageView  Canvas  ViewAnimation.
CS378 - Mobile Computing 2D Graphics A Crash Course in Using (Android) 2D Graphics Libraries.
Basic 2D Graphics in Android. Android Graphics Programming There are many ways to do graphics programming in Android – 2D vs. 3D – static vs. dynamic.
Graphics & Animation in Android. Android rendering options The Canvas API Renderscript OpenGL wrappers NDK OpenGL
Tutorial 4 Creating Special Animations. XP Objectives Create an animation using a motion guide layer Create an animation using a mask layer Animate text.
Creating Animation Pertemuan Matakuliah: L0182 / Web & Animation Design Tahun: 2008.
Basic Animation. Animation 4 options – Animated.gif – Frame by Frame animation – Tweened animation This is our focus – OpenGL ES Graphics API for more.
1 © Netskills Quality Internet Training, University of Newcastle Flash 8: Animation Techniques © Netskills, Quality Internet Training, University of Newcastle.
Lecture Series on Android Programming Lecturer: Prof.Luqun Li Teaching Assistants: Fengyou Sun, Haijun Yang, Ting.
Chapter 10: Move! Creating Animation
WMD Creating Animations Flash-5 Zhou Hong. Contents Review 1 Frame Types 2 Frame-by-Frame Animation 3 Action & Shape Tweening 4.
6-2 2D Graphics CSNB544 Mobile Application Development Thanks to Utexas Austin.
Flag Quiz App 1 CS7030: Mobile App Development. assets Folder 2 CS7030: Mobile App Development  drawable folder – Image contents at the root level 
Tutorial 6 Working with Bitmaps and Gradients, and Publishing Flash Files.
Animation.
Design Frame-by- Frame Computer Animations NOTE: Before continuing with this presentation, open the 3.01C Frame-by-Frame Animation Using PowerPoint Presentation.
Copyright © 2003 Pearson Education, Inc. Chapter 3, Slide 1 by Michael Kay The Web Wizard’s Guide to Flash.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Android – Advanced Topics Mobile Application Development Selected Topics – CPIT Oct-15.
Adobe Flash CS3 Revealed
Flash Flash. It’s components and usage. New generation of web- design  Definition Multimedia technology developed by Macromedia to allow much interactivity.
Transformational Geometry CS418 Computer Graphics John C. Hart.
Adobe Flash CS4 – Illustrated Unit D: Creating Animation.
Introduction to Flash MX 2004: Drawing, Timeline, & Simple Animation Lloyd Rieber.
ANDROID – DRAWING IMAGES – SIMPLE EXAMPLE IN INTERFACE AND EVENT HANDLING L. Grewe.
Review 2 – Adobe Flash Lab Manual
Agenda Sketchbook DUE next Tues - assignment dates listed on next page 1 - Get out your sketchbook and note these terms: Symbols (reusable object):
Mobile Programming Lecture 11 Animation and TraceView.
Adobe Flash Professional CS5 – Illustrated Unit D: Creating Animation.
XNA Basic Displaying Image & Collision Detect. What’s format image that XNA support? XNA support only.bmp.png and.jpg image..PNG have transparent region.
Computer Graphics 3D Transformations. Translation.
Tutorial 3 Creating Animations. XP Objectives Learn the different elements of animation Create frames and layers Organize frames and layers using the.
Flash Vector Illustration Animation Broadcast Media Mobile Computing Games Game Consoles Internet Edutainment Kiosks.
Basic Animation. Animation 4 options – Animated.gif – Frame by Frame animation – Tweened animation This is our focus – OpenGL ES Graphics API for more.
Working with CAD Data In ArcGIS Travis Wagner. New Features Adds CAD datasets as group layers –Still have the ability to access all feature types properties.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
XP Tutorial 3 Creating Animations. XP New Perspectives on Macromedia Flash MX Elements of Animation Layers are used to organize the content of.
Flag Quiz Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Basic 2D Graphics in Android. Android Graphics Programming There are many ways to do graphics programming in Android – 2D vs. 3D – static vs. dynamic.
Page 1 of 8 Stanford Continuing Studies CS 38 ·Hands-on Graphics Production for the Web Week Five EXERCISE 2: ANIMATION 1) Launch Fireworks. 2) Open blackbackground-stanford.gif.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 10: Move! Creating Animation 1 Android.
Adobe Flash Professional CS5 – Illustrated Unit E: Optimizing and Publishing a Movie.
CHAPTER 5 Graphics Drawing Audio. Chapter objectives: Learn to draw to a canvas Examine the process of adding drawn elements and UI controls to a layout.
Introducing To 3D Studio Max George Atanasov Telerik Corporation
Lecture 3: Animation & Graphics Topics: Animation, Graphics, Drawing Date: Feb 2, 2016.
Mobile Software Development for Android - I397 IT COLLEGE, ANDRES KÄVER, WEB:
CSE 681 Texture Mapping: Solid Texturing. CSE 681 Texture Mapping Visual complexity on demand Vary display properties over object Location on object used.
To play, start slide show and click on circle Lesson 3 Lesson 3 Lesson 3 Lesson 4 Lesson Lesson 4.
Graphics & Animation Radan Ganchev Astea Solutions.
Android Application 2D Graphics cs.
Lecture 3: Animation & Graphics
滑動版面 建國科技大學 資管系 饒瑞佶 2013/7 V1.
CS499 – Mobile Application Development
Lecture 3: Animation & Graphics
S.RENUKADEVI/AP/SCD/ANDROID - Notifications
2D Transformation.
הצטרפות לקבוצת DeDemoc
Mobile Computing With Android ACST 4550 Android Animation
Learning Objectives Build an app involving several activities
Animation Procedures Basic Concepts.
Android: Shapes.
滑動 建國科技大學 資管系 饒瑞佶 2013/4 V1 2015/5 V2.
ICG 2018 Fall Homework1 Guidance
滑動 建國科技大學 資管系 饒瑞佶.
Lecture 3: Animation & Graphics
Translate, Rotate, Matrix
Android: Shapes.
Presentation transcript:

Animations 1 Fall 2012 CS2302: Programming Principles

Animation Category 1. Tweened Animations – Scale animations – Rotate animations – Alpha animations – Translate animations 2. Frame-by-Frame Animations Fall 2012 CS2302: Programming Principles 2

Procedure to create Tweened Animations Fall 2012 CS2302: Programming Principles 3 1. Create an object of AnimationSet 2. Create an object of Animation – TranslateAnimation(int fromXType, float fromXValue, int toXType, float toXValue, int fromYType, float fromYValue, int toYType, float toYValue) – AlphaAnimation(float fromAlpha, float toAlpha) – ScaleAnimation(float fromX, float toX, float fromY, float toY, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue) – RotateAnimation(float fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue) 3. Setting parameters for the object of Animation 4. Add the object of Animation to the object of AnimationSet 5. startAnimation(animationSet);

Attributes of Animations Fall 2012 CS2302: Programming Principles 4 ANIMSTIO N YPE ATTRIBUTESVALID VALUES AlphafromAlpha / toAlphafloat from 0 to 1 ScalefromXScale / toXScalefloat from 0 to 1 fromYScale / toYScalefloat from 0 to 1 pivotX / pivotYString of the percentage of graphic width/height from 0% to 100% TranslatefromX / toXfloat from 0 to 1 fromY / toYfloat from 0 to 1 RotatefromDegrees / toDegreesfloat from 0 to 360 pivotX / pivotYString of the percentage of graphic width/height from 0% to 100%

Common Methods of Tweened Animations Fall 2012 CS2302: Programming Principles 5  setDuration(long durationMills) – set the amount of time (in milliseconds) for the animation to run  setFillAfter(boolean fillAfter) – If fillAfter is set to true, then the animation transformation is applied after the animation is over.  setFillBefore(boolean fillBefore) – If fillBefore is set to true, then the animation transformation is applied before the animation has started.  setStartOffSet(long startOffset) – Set the delay in milliseconds before the animation runs.  setRepeatCount(int repeatCount) – Defines how many times the animation should repeat.

Create Tweened Animations by editing xml file Fall 2012 CS2302: Programming Principles 6  Create a folder called anim under res folder  Create new xml files in the anim folder. Add a set tag in the xml files: <set xmlns:android="  Add rotate, alpha, scale, or translate tag in the set tag.  Use AnimationUtils.loadAnimation to load the xml file, and then create an object of Animation  startAnimation

Alpha Animation’s xml file Fall 2012 CS2302: Programming Principles 7 <set xmlns:android=" droid" _interpolator"> <alpha android:fromAlpha="1.0" android:toAlpha="0.0" android:startOffset="500" android:duration="500" />

Rotate Animation’s xml file Fall 2012 CS2302: Programming Principles 8 <set xmlns:android=" droid" _interpolator"> <rotate android:fromDegrees="0" android:toDegrees="360" android:pivotX="50%" android:pivotY="50%" android:duration="5000" />

Translate Animation’s xml file Fall 2012 CS2302: Programming Principles 9 <set xmlns:android=" droid" _interpolator"> <translate android:fromXDelta="50%" android:toXDelta="100%" android:fromYDelta="0%" android:toYDelta="100%" android:duration="2000" />

Scale Animation’s xml file Fall 2012 CS2302: Programming Principles 10 <set xmlns:android=" droid" _interpolator"> <scale android:fromXScale="1.0" android:toXScale="0.0" android:fromYScale="1.0" android:toYScale="0.0" android:pivotX="50%" android:pivotY="50%" android:duration="2000" />

Load xml file  In the MainActivity.java file – Animation animation = (Animation) AnimationUtils.loadAnimation(MainActivit y.this, R.anim.translate); – imageView.startAnimation(animation); 11 Fall 2012 CS2302: Programming Principles

Frame-By-Frame Animations  Create a xml file under res/drawable <animation-list xmlns:android=" droid" android:oneshot="false"> 12 Fall 2012 CS2302: Programming Principles

Frame-By-Frame Animations  Load the xml file – imageView.setBackgroundResource(R.drawable.anim);  Get AnimationDrawable – AnimationDrawable animationDrawable = (AnimationDrawable)imageView.getBackground(); – Start the animation – animatinDrawable.start(); 13 Fall 2012 CS2302: Programming Principles