ptouch 发表于 2012-8-22 20:24:45

MUSHClient 设置背景的代码

一直看黑色是不是有些厌烦
这个代码可以简单加载背景图片
/BGpics()启动选择背景图片
------BackgroundPictures-------
BGpics = function()
localfilter = { bmp = "bmp文件",jpg="jpg文件",png="png文件", ["*"] = "All files" }

   local filename = utils.filepicker ("选择背景图片",name, extension, filter, false) --文件选择对话框
   if filename~=nil then
      world.SetBackgroundImage (filename, 0)
   end
end --funtion
--删除背景
BGpics_del=function()
world.SetBackgroundImage ("", 0)
end

北大侠客行MUD,中国最好的MUD

flauto 发表于 2012-8-22 20:44:14

顶下。顺便问句楼主这是哪个MUD呀?

luyoujiao 发表于 2012-8-22 21:05:36

锡兰界面插件

ptouch 发表于 2012-8-22 21:31:41

本帖最后由 ptouch 于 2012-8-22 09:33 PM 编辑

用的锡兰的图片。
你要打开世界函数 干什么用

用这个函数 world.open()


openedOK = world.Open ("smaug.mcl")   -- true or false

这个函数说明

Return value

For Lua, it returns true if the file was opened OK, and false if not.

For other languages:

An object reference to the named world, if it was found.
Otherwise NULL.

Lua example

openedOK = world.Open ("smaug.mcl")   -- true or false


Lua notes

Lua is not implemented using the COM model, and thus opening a file and getting an object reference is not possible.

As of version 4.08 however, it will attempt to open the file in the same way as other languages, and return true if it succeeded, and false otherwise.

If you want a "world" userdata to refer to after opening a world, you would need to use GetWorld or GetWorldById to get a reference to the newly-opened world.
页: [1]
查看完整版本: MUSHClient 设置背景的代码