CSC 171 Lecture 5: Tue Jan 31

53 views3 pages
1 Feb 2017
School
Course

Document Summary

Characters as they move (or idle animation, like when a character starts dgeting after not being commanded to move for a while) Objects as they change (like damaged or made healthy) Setimage( lename) is a method in the actor class. Usage #1: set an image for this actor from an image le. The le may be a jpeg, gif, or png format. the le should be located in the project directory. public void setimage(java. lang. string lename) Illegalargumentexception is the name of the error that is thrown when you do something wrong. to avoid a crash: catch (exception handler parameters) Usage #2: set the image of the actor to a greenfoot speci ed image public void setimage(greenfootimage image) How to code usage #2: myimage = new greenfootimage( name of the le ); setimage(myimage); Tuesday, january 31, 2017: you can specify the name of the le algorithmically, you can manipulate the image in memory before setting this.

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 textbook solutions