Package org.newdawn.slick.geom

Examples of org.newdawn.slick.geom.Rectangle


  public Shape getShape() {
    Shape b = bound;
    float sx = getX();
    float sy = getY();
    if (scalex != 1 || scaley != 1) {
      b = new Rectangle(sx, sy, bound.getWidth() * scalex, bound
          .getHeight()
          * scaley);
    }
    if (rotation > 0.1f || rotation < -0.1f) {
      if (cacheRotation == rotation && cacheShape != null && sx == cacheX
View Full Code Here


      this.alphaLevel = 0f;
    this.filter.a = alphaLevel;
  }

  public void setCenter(float cx, float cy) {
    Rectangle b = bound;
    if (scalex != 1 || scaley != 1) {
      b = new Rectangle(bound.getX(), bound.getY(), bound.getWidth()
          * scalex, bound.getHeight() * scaley);
    }
    b.setCenterX(cx);
    b.setCenterY(cy);
    setLocation(b.getX(), b.getY());
  }
View Full Code Here

  @Override
  public void paint(Graphics g) {   
    super.paint(g);
    if(childs.size()>0){
     //GL.glPushMatrix();
     Rectangle oldClip = g.getClip();
     g.setClip(0,0,getWidth(),getHeight());
     for (TComponent v : childs) {
       v.render(g)
     }   
     g.setClip(oldClip);
View Full Code Here

   * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
   */
  public void init(GameContainer container) throws SlickException {
    this.container = container;
 
    rect = new Rectangle(400,100,200,150);
    round = new RoundedRectangle(150,100,200,150,50);
    round2 = new RoundedRectangle(150,300,200,150,50);
    center = new Rectangle(350,250,100,100);
   
    poly = new Polygon();
    poly.addPoint(400,350);
    poly.addPoint(550,320);
    poly.addPoint(600,380);
View Full Code Here

    /**
     * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
     */
    public void init(GameContainer container) throws SlickException {
        shapes = new ArrayList();
        rect = new Rectangle(10, 10, 100, 80);
        shapes.add(rect);
        roundRect = new RoundedRectangle(150, 10, 60, 80, 20);
        shapes.add(roundRect);
        ellipse = new Ellipse(350, 40, 50, 30);
        shapes.add(ellipse);
View Full Code Here

    float width = Float.parseFloat(element.getAttribute("width"));
    float height = Float.parseFloat(element.getAttribute("height"));
    float x = Float.parseFloat(element.getAttribute("x"));
    float y = Float.parseFloat(element.getAttribute("y"));
   
    Rectangle rect = new Rectangle(x,y,width,height);
    Shape shape = rect.transform(transform);
   
    NonGeometricData data = Util.getNonGeometricData(element);
    data.addAttribute("width", ""+width);
    data.addAttribute("height", ""+height);
    data.addAttribute("x", ""+x);
View Full Code Here

    x2 = to.getX();
    y2 = to.getY();
   
    this.delay = delay;
    this.image = image;
    area = new Rectangle(x1, y1, 14, 14);
    this.shooterId = shooterId;
  }
View Full Code Here

      
       bounce = new Sound("res/sounds/bounce.wav");
       brick = new Sound("res/sounds/brick.wav");
       lostLife = new Sound("res/sounds/lifelost.wav");
      
       screenLeft = new Rectangle(0,0, -6, gc.getHeight());
       screenRight = new Rectangle(600,0, -6, gc.getHeight());
       screenTop = new Rectangle(0,0, gc.getWidth(), 6);
      
       //gc.setVSync(true);
       gc.setTargetFrameRate(200);
    }
View Full Code Here

   * @param height
   *            The height of the allowed area
   */
  public void setWorldClip(float x, float y, float width, float height) {
    predraw();
    worldClipRecord = new Rectangle(x, y, width, height);
   
    GL.glEnable(SGL.GL_CLIP_PLANE0);
    worldClip.put(1).put(0).put(0).put(-x).flip();
    GL.glClipPlane(SGL.GL_CLIP_PLANE0, worldClip);
    GL.glEnable(SGL.GL_CLIP_PLANE1);
View Full Code Here

  public void setClip(int x, int y, int width, int height) {
    predraw();
   
    if (clip == null) {
      GL.glEnable(SGL.GL_SCISSOR_TEST);
      clip = new Rectangle(x, y, width, height);
    } else {
      clip.setBounds(x,y,width,height);
    }
   
    GL.glScissor(x, screenHeight - y - height, width, height);
View Full Code Here

TOP

Related Classes of org.newdawn.slick.geom.Rectangle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.