Getting IE8 compatibility with EaselJS and ExplorerCanvas

后端 未结 2 1226
小鲜肉
小鲜肉 2021-01-07 10:24

I am using EaselJS and want to allow for backwards compatibility with ExplorerCanvas.

This should be possible using the following code (see here):

c         


        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-07 10:56

    I ran across this issue as well, trying to get ExCanvas to play nice with EaselJS. Here is how I got it working. Hope this helps with your image issue.

    • Get the source code for EaselJS : https://github.com/gskinner/EaselJS.git. This will get all the javascript files separated out into their own parts.
    • Copy all those files over to a "easel" folder in your project directory.
    • The order in which the files are loaded is important, so see below on how to do it.
    • EaselJS has an option to override the createCanvas method, which is required to use ExCanvas with it. This happens after loading the SpriteSheet.js file, and BEFORE loading Graphics.js, DisplayObject.js, Container.js, etc. In the code below, I used jQuery to load the rest of the js files that easelJs needed. This all happens in the $(document).ready() function.
    • If done correctly, you should see a 700 x 700 canvas with a red line from top left to bottom right in IE (tested in 8).

      head>

              
              
              
      
              
              
              
              
              
              
              
              
              
              
      
              
      
              
      
                                       
                    
提交回复
热议问题