fredsa / playn

Cross platform game library for N≥4 platforms
0 stars 1 forks source link

ImageLayer.setRepeatX and setRepeatY not working? #187

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. I created an ImageLayer. Tried both pointing to png and jpg.
2. imageLayer.setRepeatX(true)
3. translate my layer on the X axis, and see that is not repeating
4. I ran this in Java mode only. Have not tested on other platforms.

Running Windows 7. Pulled down the source code for PlayN about a week ago.

Original issue reported on code.google.com by scottrca...@gmail.com on 12 Jul 2012 at 1:41

GoogleCodeExporter commented 9 years ago
You must be confused as to what setRepeatX means. For example this code:

    ImageLayer layer = graphics().createImageLayer(createCanvasImage(30, 30, new Drawer() {
      public void draw(Canvas canvas) {
        canvas.setFillColor(0xFF99CCFF);
        canvas.fillCircle(15, 15, 15);
        canvas.setStrokeColor(0xFF000000);
        canvas.strokeRect(0, 0, 30, 30);
      }
    }));
    layer.setRepeatX(true);
    layer.setRepeatY(true);
    layer.setSize(100, 100);

creates an image that is 30x30 and then displays it as 100x100, where the 30x30 
image is repeated to fill the space. The result looks like the attached file.

Original comment by m...@samskivert.com on 12 Jul 2012 at 4:30

Attachments:

GoogleCodeExporter commented 9 years ago
Definitely a point of confusion. 

Thanks for your time.

Original comment by scottrca...@gmail.com on 12 Jul 2012 at 5:20