PlayN - Draw on an Image

2019-08-13 03:41发布

问题:

I have recently started using PlayN for a hobby project and has now stumbled upon a problem.

I would like to draw some lines and text onto an Image and save this image for later use. In Java I would just make a BufferedImage and use its graphicsBuffered to draw upon, but I can not find any similar solution in PlayN.

Is this at all possible, and if so how ?

I somehow need to be able to convert a BufferedImage to an Image and the other way around.

回答1:

Create a CanvasImage, draw your image onto the CanvasImage, and then draw your text and lines on top of it. You can then use the CanvasImage in an ImageLayer to put it into your scene graph.



标签: image playn