
-----------------------------------
ScarletSkyFury
Wed Jun 21, 2006 4:33 pm

Drawing pictures outside of the paint method
-----------------------------------
I am trying to draw pictures in a method outside the paint method but its giving me an error, it says:

The name "up" is not a method name but the name of a field member of the type "RPGame"

heres the methods that i am trying to get to draw pictures on the screen:


   public void up (Graphics g)
    {
        for (int w=0 ; w < 3 ; w++)
        {
            bufferGraphics.drawImage (screen, 0, 0, 800, 600, this);
            x = 500;
            y = 500;
            y = y + 5;
            bufferGraphics.drawImage (up [w], x, y, 50, 50, this);
        } //end for loop
    } //end up method

    public void down (Graphics g)
    {
        for (int w=0 ; w < 3 ; w++)
        {
            bufferGraphics.drawImage (screen, 0, 0, 800, 600, this);
            x = 500;
            y = 500;
            y = y - 5;
            bufferGraphics.drawImage (down [w], x, y, 50, 50, this);
        }
    } //end up method

    public void left (Graphics g)
    {
        for (int w=0 ; w < 3 ; w++)
        {
            bufferGraphics.drawImage (screen, 0, 0, 800, 600, this);
            x = 500;
            y = 500;
            x = x + 5;
            bufferGraphics.drawImage (left [w], x, y, 50, 50, this);
        }
    } //end up method

    public void right (Graphics g)
    {
        for (int w=0 ; w < 3 ; w++)
        {
            bufferGraphics.drawImage (screen, 0, 0, 800, 600, this);
            x = 500;
            y = 500;
            x = x - 5;
            bufferGraphics.drawImage (right [w], x, y, 50, 50, this);
        }
    } //end up method



and this where the errors are coming up:



if (pressdown == KeyEvent.VK_UP)
                        up ();