local index = 0 local handler = nil handler = scheduler.scheduleGlobal(function( ... ) -- 加载界面 app.sceneManager:pushLayer(require('app.scenes.PageShop').new()) self:performWithDelay(function( ... ) -- 移除界面 app.sceneManager:popLayer() index = index + 1 if index >= 100then scheduler.unscheduleGlobal(handler) end end, 0.5) end, 0.5)
functionGameUtils.SetSpriteGrey(sprite,is_grey) if sprite and sprite.setGLProgramState then if is_grey then local pProgram = cc.GLProgram:createWithByteArrays(ShaderData.vertDefaultSourceGrey, ShaderData.pszFragSourceGrey) ... sprite:setGLProgram(pProgram) else local pProgram = cc.GLProgramState:getOrCreateWithGLProgram(cc.GLProgramCache:getInstance():getGLProgram("ShaderPositionTextureColor_noMVP")) sprite:setGLProgramState(pProgram) end end end
functionGameUtils.SetSpriteGrey(sprite,is_grey) if sprite and sprite.setGLProgramState then if is_grey then local pProgram = cc.GLProgramCache:getInstance():getGLProgram("ShaderPositionTextureColor_Gray") ifnot pProgram then pProgram = cc.GLProgram:createWithByteArrays(ShaderData.vertDefaultSourceGrey, ShaderData.pszFragSourceGrey) pProgram:bindAttribLocation(cc.ATTRIBUTE_NAME_POSITION, cc.VERTEX_ATTRIB_POSITION) pProgram:bindAttribLocation(cc.ATTRIBUTE_NAME_COLOR, cc.VERTEX_ATTRIB_COLOR) pProgram:bindAttribLocation(cc.ATTRIBUTE_NAME_TEX_COORD, cc.VERTEX_ATTRIB_FLAG_TEX_COORDS) pProgram:link() pProgram:updateUniforms() cc.GLProgramCache:getInstance():addGLProgram(pProgram, "ShaderPositionTextureColor_Gray") end sprite:setGLProgram(pProgram) else sprite:setGLProgram(cc.GLProgramCache:getInstance():getGLProgram("ShaderPositionTextureColor_noMVP")) end end end