Egret learning diary entry --- Part VIII

Part VIII

  it is good! The first three chapters of the contents began to enter in.

  but! Since the first chapter said content is in background information egret engine, I do not write in a diary.

  Just start writing from the second chapter.

  

  Mentioned in Section 2.0 IDE (code editor) is preferably used Egret Wing Egret provided.

  

  Next is 2.1.

  

  

  

  

  To summarize the focus of section 2.1:

    1, using shortcuts.

    2, the basic function of the right mouse button menu provides.

  Do what I do, I feel is not necessary. too easy.

 

  Then look at the content of 2.2.

  

  

  Summary of focus 2.2:

    1, can create different project types

  Do what I do:

    Key 1:

      Click File, then click New Project.

      

      To create the project will be the type of option.

      

  This, the end of section 2.2 content.

 

  Then Section 2.3 content begins.

  

  The feeling is not very nutritious content. Just skip it. Have to say, it is to tell you as a beginner choose EUI project selection.

 

  Then the contents of Section 2.4.

  

  

  

  

  

  

  

  

  

  Call ~ section 2.4 of this content is really a bit much. I summarize the main points:

    1, create a blank project

    2, project structure

    3, a Hello World output log

  Do what I do:

    1、

      To tell the truth, tell the truth. I did not see the blank project word. It is estimated that before the old version of it.

      

    2、

      In fact, the book has been written project structure, quite detailed. Direct look like

    3、

      I will create a new EUI project better.

      

      Find the entrance file Main.ts. And Main.ts code of createGameScene method.

      

      CreateGameScene method in the code are deleted, written like this.

      

      Then press F5 to run the program.

      

      Then, in this window, press F6. Developers debug window appears, you can see the output of Hello World.

      

      Or you can click Tools - Switch to bring up the developer tools developers debug window.

      

      The effect is the same.

      

   At this point, the contents of the end of Section 2.4.

 

  Then see section 2.5 content.

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  同样,2.5节 内容很多,总结一下重点:

    1、使用文本和位图展示。

    2、显示列表层级。

    3、使用真机展示。

    4、Egret中,类的继承结构。

  跟着做:

    重点1:使用文本和位图展示。

      先是如何使用文本,可以通过egret.TextField 这个类 来实现。

      

      但是,效果可以看到,这里的内容没有完全显示出来。不知道是什么问题。

      我把x坐标稍微调整小点后,就可以看到全部了。应该是有个边界问题。

       

      好了,文本解决了,就该到图片如何显示了。

      

      主要逻辑是这样。

        1、通过 egret.ImageLoader类 去加载静态资源。

        2、加载完毕后,将得到的纹理保存到 egret.Texture 类。

        3、创建 egret.Bitmap 类来装载 egret.Texture类。

        4、添加 egret.Bitmap 到舞台,图片显示。

      反正我是觉得挺麻烦的,还要经过 egret.ImageLoader、egret.Texture 和 egret.Bitmap 类 这三个类。

      不能一步到位。希望以后应该会有更加方便的方法。

      好,现在图片也显示了。

      

    重点2:显示列表层级。

      点开 工具 -- 显示列表查看器 就能弹出。

      

      在这Main类里,可以看到有两个对象,一个是 文本,一个是图片。

      谁越在下面,谁越显示在前面。我们可以看到图片是在文字下面的。

      

      怎么设置对象的层级呢?

      书中有说明。

      

      我截图个也说明一下。

      

    重点3:使用真机展示。

      这个。。。太简单了。

      

      然后你就可以用你的手机扫二维码了。

    重点4:Egret中,类的继承结构。

      其实书中的截图也说明得很清楚了。

       

  至此,2.5节 的内容就完成了。

 

  接下来是 2.6节 的内容。

  

  

  

  

  

  

  

  总结一下重点:

    1、EUI项目中,egretProperties.json的作用。

    2、如何手动添加引擎提供的扩展库?

  跟着做:

    重点1:EUI项目中,egretProperties.json的作用。

      简单说,就是用来管理项目导入了什么代码库的配置文件。

    重点2:如何手动添加引擎提供的扩展库?

      可以在这里填写要添加的库,可以填写路径或者名字。

      

 

   至此,2.6节 内容结束。

 

 今天就到这里啦。呼呼 吃饭去。 

  

Guess you like

Origin www.cnblogs.com/dmc-nero/p/11201735.html