Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By cronnin

Thread: partial display painting

  1. #1
    cronnin is offline Member
    Join Date
    Jan 2017
    Rep Power

    Default partial display painting

    Not sure where to put this question. What approach would you suggest for partial screen painting?
    Imagine a game in which you're driving a motorcycle with a helmet, and the image of the road only covering 1/3 of a screen. Or like watching a 4000x6000 photograph in 100% on 1920x1080 display.
    I was thinking about pre-rendering the whole world (3000x1080 pix) in resolution larger than display size, and then only showing the part that is needed depending on the drivers head axis and motorcycle direction.
    Does that sound logical in Java, or is there another approach?

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Northern Virginia, United States
    Rep Power

    Default Re: partial display painting

    In Java, this type of painting can be done with clip regions. You can also specify what rectangle to paint in the repaint method.

    Check this out for that and more on 2D graphics. The Graphics API Tutorial

    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    cronnin is offline Member
    Join Date
    Jan 2017
    Rep Power

    Default Re: partial display painting

    Nice, got it working. Thanks.
    DarrylBurke likes this.

Similar Threads

  1. New to Java need help. Have partial code written!!
    By therealvasile in forum New To Java
    Replies: 4
    Last Post: 07-11-2013, 09:43 PM
  2. Partial copy of zip archive
    By nmn in forum New To Java
    Replies: 3
    Last Post: 02-05-2013, 08:24 PM
  3. KeyListener partial problem
    By alphasil in forum AWT / Swing
    Replies: 2
    Last Post: 12-13-2012, 02:05 AM
  4. partial XML validation against xsd
    By presto in forum XML
    Replies: 2
    Last Post: 11-21-2009, 06:15 PM
  5. Display partial file contents in JTextArea
    By tmoehlman in forum New To Java
    Replies: 0
    Last Post: 11-03-2009, 12:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts