|
- if win then
- GUI:win_close(win)
-
- end
- local win = GUI:Win_Create("Win_1", 0, 0, 1136, 640)
- local win = GUI:Win_Create("Win_1", 0, 0, 1136, 640)
- local imgPaths = {"res/public/1900000610.png", "res/public/1900000601.png", "res/public/1900000602.png"}
- local Image_bg = GUI:Image_Create(win, "Image_bg", 0, 0, imgPaths[1])
- GUI:setTouchEnabled(Image_bg, true)
- GUI:setTag(Image_bg, 1) -- 初始索引为1
- GUI:addOnClickEvent(Image_bg, function()
- local index = GUI:getTag(Image_bg)
- index = index % #imgPaths + 1 -- 循环切换
- GUI:Image_loadTexture(Image_bg, imgPaths[index])
- GUI:setTag(Image_bg, index)
- end)
复制代码
|
|