The error if I am correct is due to having to accept a script. Not sure I haven’t received that error.
ops…That is the entire picture. I am just trying to get a single tile off that with the “block[]” array which is the BufferedImage where Block is the Image. Sorry about that forgot to change that before I rar’d it.
public void paint(Graphics g)
{
//g.drawImage(dbImage, 0, 0, this);
Graphics2D g2 = (Graphics2D)g;
g2.drawImage(Block, 0, 0, this);
}
should have looked like this, which doesn’t display any image for me
public void paint(Graphics g)
{
//g.drawImage(dbImage, 0, 0, this);
Graphics2D g2 = (Graphics2D)g;
g2.drawImage(block[1], 0, 0, this);
}
I am porting from C/C++, I understand the Java API, just not all of it. The Sprite Creator I posted here was my second project, this one was my first but it was originally designed for the phone. I just figured I could learn a bit more by converting it to the computer, that and I really don’t care to have to test everything by uploading the app to my phone every time. The original code for JavaME is here if you have an applet viewer you can see what I am trying to do now that I have done with JavaME. It’s code is basically the same just porting over. If you view the JavaME code just ignore the index.html file included with the .jar/.jad files
realized that you can’t view the jar for an applet like you can with an app.
I was pointed to this
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D)g;
g2.drawImage(Block, 0, 0, this);
}
I would
public void paint(Graphics g)
{
g.drawImage(Block, 0, 0, 32, 32, 64, 64, 96, 96, this);
}
which does indeed draw a portion of the image. Am I able to take those sections of the image and put them into another image or do I have to use a BufferedImage? And if I have to use BufferedImage how would I draw that BufferedImage. I would like to put the smaller images into an array.
I guess if nothing else I could add a few variables to the map class to mark the location of each tile and where it is supposed to go and create a loop for drawing the tiles if I can’t.