S
s.magnien
Hi all.
What I'd like would be two classes:
public class Main extends java.applet.Applet
{
Room current_room;
.....
}
and
public class Room extends java.applet.Applet
{
//loads images
public void Paint(Graphics g)
{
g.drawImage(//loaded images...);
}
}
I have this working _provided_ the images are loaded through Room's
constructor Room, something like
Room(Images[]), when Main does
current_room=new Room(Images[]); in its init method.
I would like Room to load its images on its own. I tried loading them
in Room(), in init(), in Paint(), devising a custom loading function,
but nothing works. I'm fairly sure the images are loaded, as catch
doesn't return any problems, but they won't draw _except_ if the images
are loaded through Room()'s constructor.
Is this construct wrong? (if so, sorry, I am a two-day old java "coder"
) If it ain't, what am I missing?
Thank you all!
What I'd like would be two classes:
public class Main extends java.applet.Applet
{
Room current_room;
.....
}
and
public class Room extends java.applet.Applet
{
//loads images
public void Paint(Graphics g)
{
g.drawImage(//loaded images...);
}
}
I have this working _provided_ the images are loaded through Room's
constructor Room, something like
Room(Images[]), when Main does
current_room=new Room(Images[]); in its init method.
I would like Room to load its images on its own. I tried loading them
in Room(), in init(), in Paint(), devising a custom loading function,
but nothing works. I'm fairly sure the images are loaded, as catch
doesn't return any problems, but they won't draw _except_ if the images
are loaded through Room()'s constructor.
Is this construct wrong? (if so, sorry, I am a two-day old java "coder"
) If it ain't, what am I missing?
Thank you all!