local Width = 32.0 local Height = 32.0 local Time = 0 function timeCount() Time = Time + 1 if Time > 200 then Time = 0 end end function update() timeCount() circle() end function sdBox(p, b) local q = Vector3.__new(math.abs(p.x) - b.x, math.abs(p.y) - b.y) local vec = Vector3.__new(math.max(q.x,0.0), math.max(q.y,0.0), math.max(q.z,0.0)) local c = math.min(math.max(q.x,math.max(q.y,q.z)),0.0) vec.x = vec.x + c vec.y = vec.y + c vec.z = vec.z + c return Vector3.Magnitude(vec) end function dist(pos) local angle = Time / 10.0 local pos2 = Vector3.__new(pos.x * math.cos(angle) - pos.y * math.sin(angle), pos.x * math.sin(angle) + pos.y * math.cos(angle)); return sdBox(pos2, Vector3.__new(0.3, 0.3, 1)) end function circle() local t = "" local x, y for y = 1, Height do for x = 1, Width do local p = "" local x2 = (x - 0.5) / Width - 0.5 local y2 = (y - 0.5) / Height - 0.5 local color = 0.0 --グラデーション color = dist(Vector3.__new(x2, y2)) * 20.0 if color < 0.1 then p = "_" elseif color < 0.2 then p = "~" elseif color < 0.3 then p = "=" elseif color < 0.4 then p = "し" elseif color < 0.5 then p = "つ" elseif color < 0.6 then p = "に" elseif color < 0.7 then p = "け" elseif color < 0.8 then p = "ぬ" elseif color < 0.9 then p = "和" else p = "親" end t = t..p end t = t.."\n" end vci.assets._ALL_SetText("Text", t) end