0

I'm messing around with the examples of mt4j multitouch Java library and in the "advanced.drawing" example, i'm trying to change the background color of the drawingScene. Since it has set the setClear to false i'm not able to do it with the clearColor option. Any other ideas? Thanks

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 に答える