我试图从我有的一些方形精灵中创建一行.所以要获得我正在使用的这些精灵的宽度
tileWidth = (int)tileSet[0].renderer.bounds.size.x;
Run Code Online (Sandbox Code Playgroud)
然后形成我的行
for(int i = 0; i < tileSet.Length ; i++){
if((i+1)*tileWidth<screenWidth){
tileSet[i].transform.position = new Vector3(i*tileWidth,0,0);
}
}
Run Code Online (Sandbox Code Playgroud)
但精灵仍然相互重叠,并没有形成一个合适的行.
我在这里做错了什么,我该如何纠正呢?
如何在blender中创建一个简单的输入对话框(如图中所示)并处理通过python输入的文本.我无法找到任何好的教程.

我刚刚开始学习blender及其脚本,并尝试运行其示例代码
import bge
def main():
cont = bge.logic.getCurrentController()
own = cont.owner
sens = cont.sensors['mySensor']
actu = cont.actuators['myActuator']
if sens.positive:
cont.activate(actu)
else:
cont.deactivate(actu)
main()
Run Code Online (Sandbox Code Playgroud)
并得到以下错误:ImportError:没有名为'bge'的模块我搜索了一个解决方案,但找不到any.how来解决这个问题?我正在使用搅拌机2.65