void attractTarget(SikuliGuideAnchor a, Point targetLocation) { try { Pattern pattern = a.getPattern(); SikuliGuideImage img = new SikuliGuideImage(pattern.getImage()); Clickable clickable = new Clickable(); clickable.setLocationRelativeToComponent(img, Layout.OVER); guide.addToFront(clickable); clickable.clickPoint = a.getCenter(); Link link = new Link(); link.image = img; link.anchor = a; links.add(link); img.setShadowDefault(); img.setActualLocation(a.getActualLocation()); Dimension currentSize = a.getActualSize(); Dimension targetSize = new Dimension(currentSize); targetSize.width *= 1.5; targetSize.height *= 1.5; img.addResizeAnimation(currentSize, targetSize); Point currentLocation = new Point(a.getActualLocation()); targetLocation.x -= targetSize.width / 2; targetLocation.y -= targetSize.height / 2; img.addMoveAnimation(currentLocation, targetLocation); guide.addToFront(img); img.startAnimation(); guide.repaint(); } catch (IOException e) { e.printStackTrace(); } }
public GUICommPack() { super(null, "CommPack"); this.xSize = 248; this.ySize = 193; this.offsy = -45; launchButton.clickAction = new Runnable() { public void run() {} }; power.state = 99; focus.state = 99; addClickable(power); addClickable(focus); addClickable(rate); addClickable(ptf); addClickable(dtf); addClickable(rtf); power.clickAction = new Adjustor.StateToNumberText(power, ptf); // ptf.clickAction= new Adjustor.NumberTextToState(ptf, power); focus.clickAction = new Adjustor.StateToNumberText(focus, dtf); // dtf.clickAction= new Adjustor.NumberTextToState(dtf, dispersion); rate.clickAction = new Adjustor.StateToNumberText(rate, rtf); // rtf.clickAction= new Adjustor.NumberTextToState(rtf, rate); addClickable(launchButton); launchButton.clickAction = calldown; power.clickAction.run(); focus.clickAction.run(); rate.clickAction.run(); }
@Override public void draw(Gui gui) { super.draw(gui); glDisable(GL_TEXTURE_2D); glColor4b( (byte) (color & 0xff0000 / 0x10000), (byte) (color & 0x00ff00 / 0x100), (byte) (color & 0x0000ff), (byte) (0xff)); // TODO FIX glEnable(GL_TEXTURE_2D); glColor4f(1, 1, 1, 1); Minecraft.getMinecraft() .renderEngine .bindTexture(new ResourceLocation("t1a:gui/Clickables.png")); }