⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 set palette index.lua

📁 J2ME游戏地图编辑器。不错
💻 LUA
字号:
-- Set palette index

function main ()
 local w = mappy.getValue(mappy.MAPWIDTH)
 local h = mappy.getValue(mappy.MAPHEIGHT)

 if (w == 0) then
  mappy.msgBox ("Set palette index", "You need to load or create a map first", mappy.MMB_OK, mappy.MMB_ICONINFO)
 else
  local isok,index,a,r,g,b = mappy.doDialogue ("Set palette index", "Enter index,alpha,red,green,blue", "0,255,0,0,0", mappy.MMB_DIALOGUE2)
  if isok == mappy.MMB_OK then
   mappy.setValue (mappy.PALETTEARGB+index, a, r, g, b)
   mappy.msgBox ("Set palette index", "index "..tostring(index).." set successfully", mappy.MMB_OK, mappy.MMB_ICONINFO)
  end
 end
end

test, errormsg = pcall( main )
if not test then
    mappy.msgBox("Error ...", errormsg, mappy.MMB_OK, mappy.MMB_ICONEXCLAMATION)
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -