Create Text Sheet

May 30, 2013 at 10:44 AM
Hello,

I'm trying to display texts on my scene (I need to display the name of all my objects on their header) but, what i'm doing not seems to work. The images of the objects appear but only a part of the texts appears.

Someone can help me please ?
for(var idCharacter in characters) {

    character = characters[idCharacter];

    var sheetCharacter = new sheetengine.Sheet(
        {x:0, y:0, z:0}, 
        {alphaD:0, betaD:0, gammaD:45},
        {w:30, h:30}
    );

    sheetCharacter.context.drawImage(images[character.type], 0, 0);
    sheetCharacter.canvasChanged();

    
    var sheetText = new sheetengine.Sheet(
        {x:0, y:0, z:0},
        {alphaD:0, betaD:0, gammaD:0},
        {w:10, h:10}
    );

    sheetText.context.font      = "27px Verdana";
    sheetText.context.fillStyle = "#000000";
    sheetText.context.textAlign = "center";
    sheetText.context.strokeText(character.name, 0, 0);

    var sheetObjectIle = new sheetengine.SheetObject(
        {x:character.x*tileSize, y:character.y*tileSize, z:0}, 
        {alphaD:0, betaD:0, gammaD:0},
        [sheetCharacter, sheetText],
        {w:150, h:150, relu:0, relv:0},
        false
    );
}
Regards,