Presentations PowerPoint
Presentation A series of pictures (slides) to present in sequence What is a picture? –An array of graphical elements Lines, rectangles, ovals, text, images, curves What is a presentation?
Presentation is an array of pictures 0) slide 1 0) line(10,20,30,20,black) 1) text(10,35,”Greetings earthlings”) 2) text(10,50,”Alien Enterprise Society”) 1) slide 2 0) image(10,10,”earth.gif”) 1) text(10,100,”Conquest is our goal!”) 2) slide
Two functions function drawPicture( picture ) {image = new array(screenWidth, screenHeight); for (each index, i, in picture) {draw picture[i] into image } return image; } function show(image) {show image on the screen; }
Events CurrentSlide –index of the slide we are currently showing onLeftClick - click the left mouse button CurrentSlide=CurrentSlide + 1; image = drawPicture(Presentation[CurrentSlide]); show(image); What happens if currentSlide >= Presentation.length?
Events onLeftClick - click the left mouse button if (CurrentSlide < Presentation.length) {CurrentSlide = CurrentSlide + 1; image = drawPicture(Presentation[CurrentSlide]); show(image); } else {show end of show image }
Events onRightClick - right mouse button clicked CurrentSlide = CurrentSlide - 1; image = drawPicture(Presentation[CurrentSlide]); show(image); What if CurrentSlide is already zero?
Events onRightClick - right mouse button clicked if (CurrentSlide > 0) {CurrentSlide = CurrentSlide - 1; image = drawPicture(Presentation[CurrentSlide]); show(image); } else {do nothing and stay at slide zero; }
The Presentation Tree PowerPoint SlideShow 1 mySlideShowyourSlideShow 0)Intro 1)Body2)End 0)line1)rect2)oval3)text Program File (slide show) Slides Graphics
Attributes in the tree Where is the Font? –graphic Color –graphic Bold –graphic Color Scheme –slide Default Color Scheme (color scheme for a new slide) –file (slideshow) Program - PowerPoint File - slideshow Slide Graphic
Animations Appear from Left Magically appear Drop from top Dissolve
Adding Animations Right Click on object to animate
Magically Appear To each graphic add a “visible” boolean field
Magically Appear function drawPicture( picture ) {image = new array(screenWidth, screenHeight); for (each index, i, in picture) {if (picture[i].visible) {draw picture[i] into image } } return image; }
Magically Appear A = index of the graphic to animate; picture[A].visible = true; image = drawPicture(picture); show(image);
Blend function B - blend value that varies from 0.0 to 1.0 Start - value we want to start with End - value we want to end with val = (1.0-B)*Start + B*End; B==0.0 then val==Start B==1.0 then val==End B==0.5 then val == average of Start and End
Appear from Left StartX = value of X way off the left of the screen EndX = value of X where we want the graphic Steps = number of steps in animation sequence A = index of the graphic to animate; for (each blend value, B, between 0.0 and 1.0) {picture[A].X = (1.0-B)*StartX+B*EndX; image = drawPicture(picture); show(image); }
Appear from Left StartX = value of X way off the left of the screen EndX = value of X where we want the graphic Steps = number of steps in animation sequence A = index of the graphic to animate; for (each blend value, B, between 0.0 and 1.0) {picture[A].X = (1.0-B)*StartX+B*EndX; image = drawPicture(picture); show(image); } B = 0.0
Appear from Left B = 0.1 StartX = value of X way off the left of the screen EndX = value of X where we want the graphic Steps = number of steps in animation sequence A = index of the graphic to animate; for (each blend value, B, between 0.0 and 1.0) {picture[A].X = (1.0-B)*StartX+B*EndX; image = drawPicture(picture); show(image); }
Appear from Left B = 0.3 StartX = value of X way off the left of the screen EndX = value of X where we want the graphic Steps = number of steps in animation sequence A = index of the graphic to animate; for (each blend value, B, between 0.0 and 1.0) {picture[A].X = (1.0-B)*StartX+B*EndX; image = drawPicture(picture); show(image); }
Appear from Left B = 0.5 StartX = value of X way off the left of the screen EndX = value of X where we want the graphic Steps = number of steps in animation sequence A = index of the graphic to animate; for (each blend value, B, between 0.0 and 1.0) {picture[A].X = (1.0-B)*StartX+B*EndX; image = drawPicture(picture); show(image); }
Appear from Left B = 0.7 StartX = value of X way off the left of the screen EndX = value of X where we want the graphic Steps = number of steps in animation sequence A = index of the graphic to animate; for (each blend value, B, between 0.0 and 1.0) {picture[A].X = (1.0-B)*StartX+B*EndX; image = drawPicture(picture); show(image); }
Appear from Left B = 1.0 StartX = value of X way off the left of the screen EndX = value of X where we want the graphic Steps = number of steps in animation sequence A = index of the graphic to animate; for (each blend value, B, between 0.0 and 1.0) {picture[A].X = (1.0-B)*StartX+B*EndX; image = drawPicture(picture); show(image); }
Drop from Top StartY = value of Y way above the top of the screen EndY = value of Y where we want the graphic Steps = number of steps in animation sequence A = index of the graphic to animate; for (each blend value, B, between 0.0 and 1.0) {picture[A].Y = (1.0-B)*StartY+B*EndY; image = drawPicture(picture); show(image); }
Rise from Bottom StartY = value of Y way below the bottom of the screen EndY = value of Y where we want the graphic Steps = number of steps in animation sequence A = index of the graphic to animate; for (each blend value, B, between 0.0 and 1.0) {picture[A].Y = (1.0-B)*StartY+B*EndY; image = drawPicture(picture); show(image); }
Dissolve newImage - image after the dissolve oldImage - image before the dissolve start with oldImage copy every 20th pixel from newImage copy every 19th pixel from newImage copy every 18th pixel from newImage.. copy every pixel from newImage