• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

graphics.drawImage()

 
Vishakha Ahuja
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens if y coordinate for drawImage() method is provided as a negative number ?
I found a program in a book that uses negative y-coordinate to draw image and when I changed it to zero, or +ve number, I did not get the expected animation effect.
Thanks,
Regards,
Vishakha
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Assuming that you have not redefined your coordinate system, if you set your vertical coordinate (the y-coordinate) to a negative integer, the image is simply drawn off of the screen (unless it's big enough and the negative y-coordinate is small enough that it's partially on the viewable screen and partially off of it).
So, if your image is 100 pixels tall and you begin it's display at (200, -25), it will be off of the screen by 25 pixels with the bottom 75 pixels showing on screen.
Hope that helps.
Good Luck,
-Dirk Schreckmann
[ January 31, 2002: Message edited by: Dirk Schreckmann ]
 
Vishakha Ahuja
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot. Now I understand how this particular animation works with negative coordinates.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic