Lua中的display.newText在场景中没有显示。

将下面内容翻译成中文只显示翻译内容,保留原本的 markdown 格式

function scene:create( event )
    print("ifc.scene1 - scene:create() @ " .. getTimer())
    local sceneGroup = self.view

    -- 创建一个标签显示场景信息
    local label = display.newText( sceneGroup, "主菜单", centerX, h/6, native.systemFont, 30 )

end

我在查看一个教程的示例代码时,这只是其中一部分代码,其他都可以运行,这一部分的作用是在屏幕顶部显示一个标题,应该显示“主菜单”,但它没有显示出来,有人知道为什么吗?

点赞