小编you*_*kel的帖子

Lua中如何将一个字符串插入到另一个字符串中?

Lua中是否有一个函数可以返回一个字符串,该字符串插入到给定位置的另一个字符串中?

例如string.insert(str1, str2, pos)

使用它:string.insert('Hello World!', 'My ', 6)成为Hello My World!等等。

string lua

3
推荐指数
1
解决办法
5586
查看次数

Getting multiple values from a function without creating a variables in LUA

Is there any way to get several values from a function without creating variables for it?

local major, minor, revision, codename = love.getVersion() -- Get current LÖVE version as a string.
Run Code Online (Sandbox Code Playgroud)

So instead of making four different variables (or array) we'll use something that will just return a value you need.

get( love.getVersion(), 0 ) -- Will return the first value (major).
Run Code Online (Sandbox Code Playgroud)

I read somewhere that I can use square brackets and triedlove.getVersion()[1] but it says "Attempt to index …

lua love2d

2
推荐指数
1
解决办法
780
查看次数

允许用户从计算机中选择字体并在网站上使用该字体

我希望我的用户能够从他们的计算机中选择一种字体并更新网页以使用该字体。

<style>
html * { font-family: Arial !important; }
</style>
Run Code Online (Sandbox Code Playgroud)

我使用html *并且css我想将字体系列更改为用户的文件。

<script>
function change_css() {
    // ???
}
</script>
Run Code Online (Sandbox Code Playgroud)
<div>
  <div</div>
  <input type="file" name="upload" id="upload"/>
  <input type="submit" value="submit" onclick="change_css();">
</div>
Run Code Online (Sandbox Code Playgroud)

如何实施?

html javascript css

0
推荐指数
1
解决办法
2194
查看次数

标签 统计

lua ×2

css ×1

html ×1

javascript ×1

love2d ×1

string ×1