Timer-Based Animation

Slides:



Advertisements
Similar presentations
Tutorial 5 Windows and Frames Section A - Working with Windows.
Advertisements

Microsoft® Small Basic
Set 20 Interrupts. INTERRUPTS The Pentium has a mechanism whereby external devices can interrupt it. Devices such as the keyboard, the monitor, hard disks.
Chapter 16 Dynamic HTML and Animation The Web Warrior Guide to Web Design Technologies.
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
1 CA203 Presentation Application Creating a Multimedia Presentation Lecture # 10.
JavaScript, Third Edition
Chapter 9 Introduction to the Document Object Model (DOM) JavaScript, Third Edition.
User Interface Programming in C#: Direct Manipulation Chris North CS 3724: HCI.
How to create a Splash Screen in MS Access Carlos Coronel.
GLUT Tips and Tricks Thomas Butkiewicz, Ph.D.. GLUT Code Organization Keep you main() simple!
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
FLTK Help Session By Richard Yu Gu CS 638 -Graphics Fall, 1999.
Searching and Sorting Chapter Sorting Arrays.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
How to use the timing feature Click to choose a shape, then click on the screen and drag it to place in on the slide.
The PictureBox Control Prefix Prefix – pic Image Property PictureBox Image Property – Changes the image or file that appears inside of the PictureBox SizeMode.
CS350 – Windows Programming Formerly and more properly named: Event Driven Programming Dr. Randy Ribler.
Chapter 5: Windows and Frames
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Events and Animations CSc 2320 Fall 2014 Disclaimer: All words, pictures are adopted from “Simple JavaScript”by Kevin Yank and Cameron Adams and also from.
Copyright ©2005  Department of Computer & Information Science Beginning DHTML: Working with Browser Objects.
ECA 225 Applied Interactive Programming ECA 225 Applied Online Programming images.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2 Revised by Dr. T. Tran for CSI3140.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 – Graphical User Interfaces Java Foundations: Introduction to Programming.
JavaScript, Fourth Edition Chapter 4 Manipulating the Browser Object Model.
CS324e - Elements of Graphics and Visualization Timing Framework.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Working with Windows (No audio component) © Dr. David C. Gibbs
How to Use Google Charts. Using Google Charts Google Charts is used to provide a way to visualize data on your website. You can choose to use simple line.
Practical Session 10: Animation. Animation kinds There are three basic kinds of animation: 1. Moving object 2. Changing pictures 3. Combination of 1 and.
Slide 1 VB Graphics Controls & Timer Control. Slide 2 Default Controls.
Tutorial 11 1 JavaScript Operators and Expressions.
JavaScript and Ajax (JavaScript Functions) Week 5 Web site:
Adding Interactivity Comp 140 Fall Web 2.0 Major change in internet usage –From mostly static pages Text Graphics Simple links –To new paradigm.
Swing Timers A Swing timer fires one or more action events after a specified delay. You can use Swing timers in two ways:  To perform a task once, after.
Introduction to JavaScript Events Instructor: Sergey Goldman 1.
Internet & World Wide Web How to Program, 5/e.  JavaScript events  allow scripts to respond to user interactions and modify the page accordingly  Events.
Event Driven (Asynchronous) Programming. Event handling in Unity Subclass a class that contains event handling methods, and then override those methods.
Animations & Multimedia LESSON 9 #2.09 USING ANIMATION AND MULTIMEDIA.
Eric Roberts and Jerry Cain
Mechanics of Functions
Jerry Cain and Eric Roberts
CS345 – Event-driven Programming
Eric Roberts and Jerry Cain
Jerry Cain and Eric Roberts
Introduction to JavaScript Events
Chapter 1: An Introduction to Visual Basic 2015
Week#2 Day#1 Java Script Course
Event Driven Programming
پروتكل آموزش سلامت به مددجو
JavaScript Selection Statement Creating Array
Introduction to Computer Graphics with WebGL
Mechanics of Functions
JavaScript & jQuery Timers, Effects, and Animations
עקרונות תכנות מונחה עצמים תרגול 7: אנימציה
2.02C Frame-by-Frame Computer Animation Using PowerPoint
Objectives To define slide transitions and animations.
APEX Tips and Tricks by Glen Plaizier.
slides courtesy of Eric Roberts
slides courtesy of Eric Roberts
Interactive Graphics Jerry Cain and Ryan Eberhardt CS 106AJ
slides courtesy of Eric Roberts
slides courtesy of Eric Roberts
Multidimensional Arrays
slides courtesy of Eric Roberts
slides courtesy of Eric Roberts
עקרונות תכנות מונחה עצמים תרגול 7: אנימציה
Murach's JavaScript and jQuery (3rd Ed.)
Presentation transcript:

Timer-Based Animation Jerry Cain CS 106AJ October 15, 2018 slides courtesy of Eric Roberts

Timer Events The programs from the previous slide deck respond to mouse events by adding an event listener to the GWindow object. JavaScript also allows you to listen for timer events, which occur after a specified time interval. As with mouse events, you specify the listener for a timer event in the form of a callback function that is automatically invoked at the end of the time interval. You can add animation to a JavaScript program by setting a timer for a short interval and having the callback function make small updates to the graphical objects in the window. If the time interval is short enough (typically between 20 and 30 milliseconds), the animation will appear smooth to the human eye.

Timeouts JavaScript supports two kinds of timers. A one-shot timer invokes its callback function once after a specified delay. You create a one-shot timer by calling setTimeout(function, delay); where function is the callback function and delay is the time interval in milliseconds. An interval timer invokes its callback function repeatedly at regular intervals. You create an interval timer by calling setInterval(function, delay); The setInterval function returns a numeric value that you can later use to stop the timer by calling clearInterval with that numeric value as an argument.

A Simple Example of Animation gw dx dy square stepCount step timer 4 2 1 ... 1729 AnimatedSquare

The End