0

我正在处理 mt4j 多点触控 Java 库的示例,在“advanced.drawing”示例中,我正在尝试更改绘图场景的背景颜色。由于它已将 setClear 设置为 false,因此我无法使用 clearColor 选项执行此操作。还有其他想法吗?谢谢

4

1 回答 1

0

我在 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);
于 2010-07-28T12:45:53.563 回答