예제 #1
0
  @Override
  public void initResources() {

    final int MARGIN = 30;
    int x = container.getWidth();
    int y = container.getHeight();
    Image tmp = ResourceManager.getImage("butRetour");

    int larg = tmp.getWidth();
    int haut = tmp.getHeight();
    int yBut = y - haut - MARGIN;

    shapeListeServers = new Rectangle(MARGIN, 50, x / 2 - MARGIN - 10, yBut - 50);

    listeServers =
        new ListeDeroulante(
            container,
            ResourceManager.getImage("transparent"),
            (int) shapeListeServers.getX() + 5,
            (int) shapeListeServers.getY() + 5);
    listeServers.setScrolled(true);
    listeServers.setMaxElementsToDraw((int) shapeListeServers.getHeight() / 20);

    butRetour =
        new MouseOverArea(
            container, ResourceManager.getImage("butRetour"), MARGIN, yBut, larg, haut);
    butRetour.setMouseOverImage(ResourceManager.getImage("butRetourOver"));

    butCreerServer =
        new MouseOverArea(container, tmp, tmp.getWidth() + MARGIN * 2, yBut, larg, haut);
    butCreerServer.setMouseOverImage(ResourceManager.getImage("MenuJouerOver"));

    timerRefreshServers = new Timer(7000);
  }
예제 #2
0
 public SpellButton(GUIContext container, int x, int y, int size) {
   super(container);
   this.height = size;
   this.width = size;
   this.x = x;
   this.y = y;
   try {
     spellImage = new Image("data/img/spells/spell1.bmp");
     spellImagemo = new Image("data/img/spells/spell1mo.bmp");
     spellImageoc = new Image("data/img/spells/spell1oc.bmp");
   } catch (SlickException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
   area = new MouseOverArea(container, spellImage, x, y, width, height);
   area.setMouseOverImage(spellImagemo);
   area.setMouseDownImage(spellImageoc);
 }