views:

23

answers:

1

Hi all,

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

A: 

I've found with the help of TherioN from NUIGroup forums a way to do it. It is possible to add a MTRectangle with the fill color and then add the SceneTexture of the drawing example to that rectangle. I leav the piece of code as reference:

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);
Fgblanch