Render problem in FireFox
deepaksinghkushwah

Hello Support

 

I am using flow example and found that in firefox, it's making problem when I set size of screen or set starting position. It's working fine in google chrome.

 

App = function(){
    this.load = function(){
        // load assets
    };
    
    this.init = function(){
        this.createMenu();
    };
    
    this.createMenu = function(){
        var screenWidth = wade.getScreenWidth();
        var screenHeight = wade.getScreenHeight();
        
        var backSprite = new Sprite();
        backSprite.setSize(screenWidth, screenHeight);
        backSprite.setDrawFunction(wade.drawFunctions.gradientFill_({x: 0, y: 1},['#444','#000']));
        var backObject = new SceneObject(backSprite);
        wade.addSceneObject(backObject);
    }
}

 

Please check and let me know. I've attached screen shot.

 

Regards

All 2 Comments
Gio

Hi

 

I'm not sure I understand what the problem is from that screenshot. I tried that code on Firefox, and it's drawing a gradient-filled box (like the one in your picture) in the middle of the screen. I am observing the same behavior in Chrome and Firefox. I am using Firefox 26 on Windows, is it the same version that you are using?

 

What I see here appears to be correct. As mentioned a bit further down in the sample, the screenWidth and screenHeight variables, at that point, refer to the size of the canvas (that is not yet the size of the browser window, but whatever was set in the html file). The canvas is then resized (after the init function has been executed), so you should handle onResize events if you want to resize the box dynamically.

 

Any more details you could give us about the problem you are experiencing would be a great help to us.

 

Thanks

Gio

Oh by the way, please make sure that you have the latest WADE 1.0.1 (there was a bug with gradients in previous versions)

Post a reply
Add Attachment
Submit Reply
Login to Reply