CS 106A Lecture Notes - Lecture 17: Init, Gif, Gobject

145 views4 pages

Document Summary

Create image by adding objects to a canvas a. ii. Layering is called stacking order: gcanvas b. i. Graphics program automatically creates gcanvas that fills entire program window b. iii. When you call add() then you are forwarding call to gcanvas b. iv. If (obj == null) { b. v. animations b. v. 1. b. v. 2. Pause() waitforclick() b. v. 2. a. use for breakout: methods common to all gobjects, example. Grect r = r. setlocation(10,100): methods r. getheight(), move method gets rid of previous object, methods defined by interfaces a. Interface = set of methods that are implemented by a class a. i. Includes: toastbread(brea, brd); heatbagel(bagel bag); returns toast returns warmbagel method method. If we use the methods above, we are using the: gfillable is an interface a. b. Includes classes like grect or goval : gresizable (goval, grect, gimage, gscalable, takes whatever you have and stretch by b. If sf = 2 then doubles the size: animation, requires you to a. i. Private void moveball () yvel += gravity; ball. move(xvel, yvel);

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents