看到 @CF万家好 在问如何做个加载界面,这里给个简单 Example
function setup()
displayMode(FULLSCREEN)
loading = 0
last = 0
test = {}
end
function draw()
background(160, 159, 159, 255)
popStyle()
font("Georgia")
fontSize(30)
fill(255, 255, 255, 255)
text("Loading...", WIDTH / 2, HEIGHT / 1.95)
fontSize(20)
text(loading .. " %", WIDTH / 2, HEIGHT / 2.1)
pushStyle()
if loading < 100 then
_LOAD()
end
end
function _LOAD()
loading = loading + 10
for i = last, last + 1000 do
test[i] = {}
for j = last, last + 1000 do
test[i][j] = i * j
end
end
last = 1000
end
![](http://imgsrc.baidu.com/forum/w%3D580/sign=485362d43edbb6fd255be52e3925aba6/edd69e0f4bfbfbedb2ede0507ff0f736aec31fe6.jpg)
function setup()
displayMode(FULLSCREEN)
loading = 0
last = 0
test = {}
end
function draw()
background(160, 159, 159, 255)
popStyle()
font("Georgia")
fontSize(30)
fill(255, 255, 255, 255)
text("Loading...", WIDTH / 2, HEIGHT / 1.95)
fontSize(20)
text(loading .. " %", WIDTH / 2, HEIGHT / 2.1)
pushStyle()
if loading < 100 then
_LOAD()
end
end
function _LOAD()
loading = loading + 10
for i = last, last + 1000 do
test[i] = {}
for j = last, last + 1000 do
test[i][j] = i * j
end
end
last = 1000
end
![](http://imgsrc.baidu.com/forum/w%3D580/sign=485362d43edbb6fd255be52e3925aba6/edd69e0f4bfbfbedb2ede0507ff0f736aec31fe6.jpg)