MobileMenuScene读一读

  MobileMenuScene是显示MobileUI的交互页面。罗列一下该类中的内容

  1.MobileMenuScene中有MenuName这种String类,相当于ID

  2.其次MobileMenuScene中最重要的是

  var array<MobileMenuObject> MenuObjects;

  3.var font SceneCaptionFont;  是字体

  4.还有不接受输入的

  var bool bSceDoesNotRequireInput;

  位置信息

  float left,top,width,height;

  初始

  float InitialLeft;

  float InitialTop;

  float InitialWidth;

  float InitialHeight;

  float AuthoredGlobalScale;   //Retina显示就设成2

  float Opacity

  UITouchSound

  UIUnTouchSound

2.关于函数

  InitMenuScene(MobilePlayerInput PlayerInput,int ScreenWidth,int ScreenHeight,bool bIsFirstInitialization);  //初始化一些屏幕比例还是数值比例

3. Font GetSceneFont()

  return class'Engine'.static.GetSmallFont();

4.渲染所有的Object

  function RenderScene()

  {    //呼唤每一个MenuObject自己的渲染函数进行渲染

    foreach MenuObjects(MenuObject)

    {

      MenuObject.RenderObject(Canvas,RenderDelta);   //MenuObject自己的渲染函数
    }
  }

5.交互

  根据Tag和每一个MenuObject交互 

 event OnTouch(MobileMenuObject Sender,ETouchType EventType,float TouchX,float TouchY)

6.自己能定义一个区域来交互

event bool OnSceneTouch(ETouchType EventType,float TouchX,float TouchY,bool bInside)

7.打开关闭的逻辑层

  当Scene打开后调用这个类,可以理解成PostBeginPlay来用

  function Opened(String Mode){}     //param是一种打开模式

8.function ModeTopMenu()

最高层

9.在关闭前调用,

function bool Closing()

{

  return true;

}

10在关闭后,并且该Scene从栈中退出

function Closed()

{

  return true;
}

11.根据Tag来找对应的Object

function MobileMenuObject FindMenuObject(String tag)

12.可以使用ConsoleCommand来调用页面,Debug方便

function bool MobileMenuCommand(string Command)

{

return false;
}

13.defaultproperties

Opacity=1

原文地址:https://www.cnblogs.com/NEOCSL/p/3134377.html