A couple graphics questions...


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: A couple graphics questions...

  1. #1
    Join Date
    Dec 2005
    Posts
    1

    A couple graphics questions...

    Hey Everyone

    I'm working on a game in Java (I know I know... I should do it in C++... but I love Java!) Anyway... I've got two big problems:

    1.) When I load images to display them, I'm trying to have them "preload" at startup. But this doesn't work. The game starts and a couple seconds later the images start popping up one by one. Is there anyway to know when the images have actually finnished lasing?
    I'm using getToolkit().createImage("my image.gif") to load them.

    2.)Rotating images... I've gotten this to work nicely by using this code:

    Graphics2 g2 = (Graphics2)g;
    //rotate
    g2.rotate(xDegrees);
    g2.drawImage(image,x,y,observer);
    //"unrotate"
    g2.rotate(-xDegrees);

    However, sometimes when I call this, the "unrotate" part doesn't seem to kick in. The whole screen is left rotated and looks REALLY messy.
    Does anyone know why this would be or a better way of drawing a rotated image on the screen?

    Thanks!!!

  2. #2
    Join Date
    Sep 2005
    Location
    istanbul / Turkey
    Posts
    133
    looks REALLY messy.
    you draw image but you dont clear the surface
    before you do "un-rotate".

    g.rotate() do not re-draw anything already drawn.
    it rotates the coordinate system for the objects
    you will draw after method( rotate) call.

  3. #3
    Join Date
    Oct 2005
    Posts
    107
    1.) When I load images to display them, I'm trying to have them "preload" at startup. But this doesn't work. The game starts and a couple seconds later the images start popping up one by one. Is there anyway to know when the images have actually finnished lasing?
    I'm using getToolkit().createImage("my image.gif") to load them.

    MediaTracker
    http://java.sun.com/j2se/1.4.2/docs/...iaTracker.html

Similar Threads

  1. Three brief graphics questions ...
    By Shannon in forum VB Classic
    Replies: 2
    Last Post: 10-18-2005, 02:49 AM
  2. Re: A couple of NetApi questions.
    By Joe \Nuke Me Xemu\ Foster in forum VB Classic
    Replies: 2
    Last Post: 09-08-2002, 07:06 PM
  3. Two More Graphics Questions
    By Rob Lowney in forum .NET
    Replies: 3
    Last Post: 07-20-2001, 04:31 PM
  4. A couple questions with ADO
    By JJ in forum VB Classic
    Replies: 1
    Last Post: 05-21-2001, 02:00 PM
  5. A couple of semantic questions...
    By Sean Woods in forum .NET
    Replies: 28
    Last Post: 02-05-2001, 06:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center