Java 在mt4j中更改场景的背景色而不清除

Java 在mt4j中更改场景的背景色而不清除,java,api,multi-touch,Java,Api,Multi Touch,我正在处理mt4j多点触控Java库的示例,在“advanced.drawing”示例中,我试图更改drawingScene的背景色。因为它已经将setClear设置为false,所以我无法使用clearColor选项。还有其他想法吗?谢谢在NUIGroup论坛TherioN的帮助下,我找到了一种方法。可以添加带有填充颜色的MTRectangle,然后将图形示例的SceneTexture添加到该矩形中。我将这段代码作为参考: final MTSceneTexture sceneTexture =

我正在处理mt4j多点触控Java库的示例,在“advanced.drawing”示例中,我试图更改drawingScene的背景色。因为它已经将setClear设置为false,所以我无法使用clearColor选项。还有其他想法吗?谢谢

在NUIGroup论坛TherioN的帮助下,我找到了一种方法。可以添加带有填充颜色的MTRectangle,然后将图形示例的SceneTexture添加到该矩形中。我将这段代码作为参考:

final MTSceneTexture sceneTexture = new MTSceneTexture(mtApplication,0, 0, mtApplication.width, mtApplication.height, drawingScene);
    sceneTexture.getFbo().clear(true, 255, 255, 255, 0, true);        
    sceneTexture.setStrokeColor(new MTColor(155,155,155));

    //Background
    MTRectangle background = new MTRectangle(0,0,mtApplication.width, mtApplication.height , mtApplication);
    background.setFillColor(new MTColor(255,244,150,255));

    //Add the scene texture as a child of the background rectangle so the scene texture is drawn in front
    background.addChild(sceneTexture);
    frame.addChild(background);