G4P Lib - Slow Loading & GUI Builder Crashing Issues

This might help :grin:

slider

import g4p_controls.*;


GCustomSlider slider; 

public void setup(){
  size(480, 320, JAVA2D);
  createGUI();
  customGUI();
}

public void draw(){
  background(230);
}

public void customGUI(){
  // You will have to experiment with the 2nd and 3th parameters to get 
  // the relative position for the tooltip.
  // Since the slider has been rotated 90 degrees the 2nd parameter affects
  // the vertical position and the 3rd parameter the horizontal position
  slider.setTip("Pick a number", -40, -50);
  slider.setTipHorz(true);
}

// Create all the slider control
public void createGUI(){
  G4P.messagesEnabled(false);
  surface.setTitle("Sketch Window");
  slider = new GCustomSlider(this, 200, 40, 230, 50, "grey_blue");
  slider.setRotation(PI/2, GControlMode.CORNER);
  slider.setLimits(0.5, 0.0, 1.0);
  slider.setNbrTicks(10);
  slider.setNumberFormat(G4P.DECIMAL, 2);
  slider.setOpaque(false);
}
2 Likes