為什么只要加上老師給的縮放代碼打開的EXE文件就會黑屏呢
local MainScene = class("MainScene", cc.load("mvc").ViewBase)
function MainScene:onCreate()
? ? -- add background image
? ? display.newSprite("HelloWorld.png")
? ? ? ? :move(display.center)
? ? ? ? :addTo(self)
display.newSprite("res/1.jpg",100,100)
:move(display.center)
:addTo(self)
--[[local a = cc.ScaleTo:create(2.0,0.5)
qrossini:runAction(a)]]
? ? -- add HelloWorld label
? ? cc.Label:createWithSystemFont("Hello Player", "Arial", 40)
? ? ? ? :move(display.cx, display.cy + 200)
? ? ? ? :addTo(self)
end
return MainScene
2022-03-30