PlayN - Draw on an Image

蓝咒 提交于 2019-12-14 02:38:27

问题


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.



来源:https://stackoverflow.com/questions/8938961/playn-draw-on-an-image

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!