Beispiel #1
0
int Window_( lua_State* L )
{
  UIWindow* window = new UIWindow;

  SetName(L, window);
  SetTopLeftWidthHeight(L, window);
  SetTooltip(L, window);
  SetAnim(L, window, UIPanel::NORMAL_ANIM_, "normalAnim");
  SetAnim(L, window, UIPanel::DISABLED_ANIM_, "disabledAnim");
  SetTextUserData(L, window);

  AddWidget(L, window);

  // 配置关闭按钮

  if (util::HasField(L, "closeBtn"))
  {
    lua_pushstring(L, "closeBtn");
    lua_gettable(L, -2);
    if (lua_istable(L, -1))
      SetButton(L, window->GetCloseButton());
    lua_pop(L, 1);
  }

  SetAlpha(L, window);

  lua_pushlightuserdata(L, window);

  return 1;
}