运行环境:GhostXP SP3
显卡:AMD Radeon HF 6310
处理器:AMD E-350 Processor
在电脑小屏幕上不明显,放到大屏幕上如下图那么明显。
BUG原因:coco2dx-3.2就加载一张图片,平移,画面产生水波纹线,貌似花屏和扫频线般,就是一直从屏幕上面往下面扫,请问如何解决?不移动或旋转水波线不出现,就平移或者旋转就出现了,不是屏幕问题测试过了,也不是帧数和分辨率问题~!
代码:
main.lua-------------------------------------------------------------------------------------------------------
cc.FileUtils:getInstance():addSearchPath(“src”)
require “Cocos2d”
require “Cocos2dConstants”
local scene = require(“YouXiZhuChangJing.YouXiZhuChangJing”)
– cclog
local cclog = function(…)
print(string.format(…))
end
– for CCLuaEngine traceback
function G__TRACKBACK(msg)
cclog("----------------------------------------")
cclog(“LUA ERROR: " … tostring(msg) … “\n”)
cclog(debug.traceback())
cclog(”----------------------------------------")
return msg
end
local function main()
collectgarbage(“collect”)
– avoid memory leak
– collectgarbage(“setpause”, 100)
– collectgarbage(“setstepmul”, 5000)
– cc.FileUtils:getInstance():addSearchPath(“src”)
– cc.FileUtils:getInstance():addSearchPath(“res”)
math.randomseed(os.time())
cc.Director:getInstance():getOpenGLView():setFrameSize(1920, 1080);
cc.Director:getInstance():getOpenGLView():setDesignResolutionSize(1920, 1080,0 )--游戏本来场景大小
local gameScene = scene:create()
if cc.Director:getInstance():getRunningScene() then
cc.Director:getInstance():replaceScene(gameScene)
else
cc.Director:getInstance():runWithScene(gameScene)
end
end
local status, msg = xpcall(main, G__TRACKBACK)
if not status then
error(msg)
end
YouXiZhuChangJing.lua
require “Cocos2d”
require “Cocos2dConstants”
cc.FileUtils:getInstance():addSearchPath(“res/runningfish”)–添加查找路径
local YouXiZhuChangJing = {}
function YouXiZhuChangJing:create()
local scene = cc.Scene:create()
local sp = cc.Sprite:create("background_arab.png")
sp:setAnchorPoint(cc.p(0,0))
local mo = cc.MoveBy:create(5,cc.p(1920,0))
local seq = cc.Sequence:create(mo,mo:reverse())
local req = cc.RepeatForever:create(seq)
– _beijing:getParent():setVisible(true)
sp:getActionManager():addAction(req,sp,false)
scene:addChild(sp)
return scene
end
return YouXiZhuChangJing