zoukankan      html  css  js  c++  java
  • AntItemBaseScene的功能分析

      该功能是Inventory和StoreListScene的基类。其中有些按钮是要在该画布上显示的。

      var AntDrawText ScreenTitle;   //武器还是药瓶

     1. 在InitMenuScene中初始化一些内容例如上面的。InitMenuScene函数中

      ScreenTitle.SetText(bIsStore?StoreScreenString:ItemScreenString);    //显示商店还是道具栏

      local AntScaleButton ScaleBttn;

      ScaleBttn=AntScaleButton(FindMenuObject("ToggleScreens"));  //该按钮是屏幕左上角的,道具栏和商店互相切换的按钮  

      //因为是ToggleBttn。在AntScaleButton按钮中我们可以找到函数

         SetCurrentImage来改变两个按钮的图片

      ScaleBttn.SetCurrentImage(bIsStore?2:0);

      Tips:我注意到屏幕的背后,商店和道具栏背景的动态画布颜色不同,一个为蓝色,一个为绿色,这时候就又去了

      2.处理OnTouch函数

      OnTouch函数在这个类中主要处理两个按钮,一个是ToggleBttn:就是上边的商店还是道具栏的切换.这时候我们可以这样做

       if(bIsStore)

       InputOwner.OpenMenuScene(class'AntStoreSceneList') ;            //打开该商店列表         

       InputOwner.CloseMenuScene(self);

       else

        InputOwner.OpenMenuScene(class'AntInventorySceneList') ;            //打开该商店列表         

         InputOwner.CloseMenuScene(self);

      这里就不用愚蠢的父子页面了,也容易将自己搞混。

                           另一个是backBttn:

          InputOwner.CloseMenuScene(self);

    3.在RenderScene中只有完成

      ScreenTitle.Render(Canvas);

      

  • 相关阅读:
    好用的 convert freestyle jenkins jobs to pipeline 插件使用
    MkDocs 搭建试用
    当前云安全问题&&一些想法
    asciidoctor 安装试用
    gradle asciidoc 使用
    apache phoenix 安装试用
    parceljs 基本使用———又一个前端构建工具
    tidb 集群扩容
    tidb 安装试用&&以及安装几个问题解决
    caddy quic 协议试用&& 几个问题
  • 原文地址:https://www.cnblogs.com/NEOCSL/p/3155244.html
Copyright © 2011-2022 走看看