Background + Buttons using G4P GUI Builder.... Why won't it work?
in
Contributed Library Questions
•
3 months ago
Hey folks,
I am trying to incorporate a background image using Quarks' GUI Builder. Problem is, when I set the background(img) to the picture of my choice, all the buttons are behind the background! Any ideas on how I can change this setup?
I tried to just go with it anyway but after I place about 15 buttons, I get an "ArrayIndexOutOfBoundsException:-1" error.
Also note that I'm setting the size() to the appropriate settings for the image.
I am using Processing 2.0 on Windows XP. If you are familiar with the GUI builder, here's the code for my background:
I am trying to incorporate a background image using Quarks' GUI Builder. Problem is, when I set the background(img) to the picture of my choice, all the buttons are behind the background! Any ideas on how I can change this setup?
I tried to just go with it anyway but after I place about 15 buttons, I get an "ArrayIndexOutOfBoundsException:-1" error.
Also note that I'm setting the size() to the appropriate settings for the image.
I am using Processing 2.0 on Windows XP. If you are familiar with the GUI builder, here's the code for my background:
- // Need G4P library
import g4p_controls.*;
PImage img;
public void setup(){
size(1336,909, JAVA2D);
createGUI();
customGUI();
img = loadImage("BACKGROUND.JPG");
}
public void draw(){
background(img);
}
// Use this method to add additional statements
// to customise the GUI controls
public void customGUI(){
-
EDIT: I have also tried "image(img,0,0);" instad of "background(img);". Neither seem to be successful.
1