KLCommonImageItem.lua 632 B

12345678910111213141516171819202122232425262728293031
  1. ---@class KLCommonImageItem:UIKmlLuaPanelBase
  2. ---@field view KLCommonImageItemView
  3. local KLCommonImageItem = class(UIKmlLuaPanelBase)
  4. local this =KLCommonImageItem
  5. ---创建时调用一次
  6. function this:Init()
  7. end
  8. ---创建或者刷新界面数据时调用
  9. function this:Refresh()
  10. GUI:Image_loadTexture(self.view.img, self.args.sprite, self.args.altas)
  11. end
  12. function this:SetSize(x, y)
  13. GUI:setContentSize(self.view.img, x, y)
  14. end
  15. function this:SetPosition(x, y)
  16. GUI:setPosition(self.view.img, x, y)
  17. end
  18. ---注册UI事件和服务器消息
  19. function this:RegistEvents()
  20. end
  21. function this:Close()
  22. end
  23. return this