Results 21 to 23 of 23
Thread: Drawing offscreen?
- 02-23-2012, 02:01 PM #21
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Drawing offscreen?
blit = drawing one image onto another.
COnfused now about "clicking on object"?
That doesn't sound like it's to do with drawing a scrolling screen.
Anyway...when scrolling you already have the background drawn once, which is presumably what you drew in the previous iteration.
Use that image, offset by whatever amount you need.
Then draw the missing images.
eg. (and this assumes the currentBackground is the BufferedImage containg the background as last drawn)
If you have mobile content in the background the "blit hero" part will become "blit animations".Java Code:create newBackgroundImage blit the bit of the currentBackgroundImage that is still visible onto the newBackgroundImage Set current = new Blit background onto screen Blit the hero onto screen.
- 02-23-2012, 05:35 PM #22
Re: Drawing offscreen?
Problem solved ... the getsubimage made the lag. Now im drawing some of the tile parts outside of the JPanel. But thats ok? =P
- 02-24-2012, 04:24 AM #23
Similar Threads
-
offscreen.getGraphics() error
By luis.depedro in forum AWT / SwingReplies: 10Last Post: 01-21-2012, 09:43 PM -
Drawing an arc
By berkeleybross in forum Java 2DReplies: 10Last Post: 12-09-2010, 01:32 AM -
Drawing a map
By Karp in forum AWT / SwingReplies: 4Last Post: 11-07-2008, 12:26 PM -
drawing an image to an offscreen image
By hunterbdb in forum Java 2DReplies: 9Last Post: 10-30-2008, 06:17 PM -
Problem Setting offscreen background
By D34N0 in forum Java AppletsReplies: 1Last Post: 07-14-2007, 11:46 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks