lufy's legend

标题: LBitmapData.DATA_CANVAS在iphone5s上面不显示 [打印本页]

作者: islzc    时间: 2017-3-23 11:59
标题: LBitmapData.DATA_CANVAS在iphone5s上面不显示
var w = canvasWidth*2;
var bitmap = new LBitmapData(bg.content);  
var bitmapData = new LBitmapData(null, 0, 0,bitmap.width+w*2, 1008, LBitmapData.DATA_CANVAS)
bitmapData.copyPixels(bitmap, new LRectangle(bitmap.width-w, 0, w, canvasHeight), new LPoint(0,0));
bitmapData.copyPixels(bitmap, new LRectangle(0, 0, bitmap.width, bitmap.height), new LPoint(w,0));
bitmapData.copyPixels(bitmap, new LRectangle(0, 0, w, canvasHeight), new LPoint(bitmap.width+w,0));
scene.addChild(new LBitmap(bitmapData));

在苹果的IOS10(7plus)下面可以正常显示 在IOS7(5s)下就不显示了

作者: lufy    时间: 2017-3-23 13:02
我没记错的话,5s下我以前也试过
文档中有demo,你用你的手机试一下看看
http://lufylegend.com/api/zh_CN/ ... l#method_copyPixels
先确定一下是不是真不能显示
作者: islzc    时间: 2017-3-23 15:13
本帖最后由 islzc 于 2017-3-23 15:27 编辑
lufy 发表于 2017-3-23 13:02
我没记错的话,5s下我以前也试过
文档中有demo,你用你的手机试一下看看
http://lufylegend.com/api/zh_CN/ ...

var w = canvasWidth*2*moveSpeed;
                        scene_1 = new LSprite();
                        scene_2 = new LSprite();
                        container.addChild(scene_1);
                        container.addChild(scene_2);
                        scene_1.visible=false;
                        scene_2.visible=false;
                        scene_1.name = "scene_1";
                        scene_2.name = "scene_2";                               
                        var loader_bg_1 = new LLoader();
                        loader_bg_1.load(data["scene_1"].src,"bitmapData");  
                        loader_bg_1.addEventListener(LEvent.COMPLETE,function(event){
                                var bitmap = new LBitmapData(loader_bg_1.content);  
                                var bitmapData_1 = new LBitmapData(null, 0, 0, bitmap.width+w*2, 1008, LBitmapData.DATA_CANVAS)
                                bitmapData_1.copyPixels(bitmap, new LRectangle(bitmap.width-w, 0, w, canvasHeight), new LPoint(0,0));
                                bitmapData_1.copyPixels(bitmap, new LRectangle(0, 0, bitmap.width, bitmap.height), new LPoint(w,0));
                                bitmapData_1.copyPixels(bitmap, new LRectangle(0, 0, w, canvasHeight), new LPoint(bitmap.width+w,0));
                                scene_1.addChild(new LBitmap(bitmapData_1));
                                scene_1.bgWidth = bitmap.width;
                                scene_1.width = bitmap.width+w*2;
                                scene_1.height = canvasHeight;
                                var loader_bg_2 = new LLoader();
                                loader_bg_2.load(data["scene_2"].src,"bitmapData");  
                                loader_bg_2.addEventListener(LEvent.COMPLETE,function(event){
                                        var bitmap2 = new LBitmapData(loader_bg_2.content);
                                        var bitmapData_2 = new LBitmapData(null, 0, 0, bitmap2.width+w*2, 1008, LBitmapData.DATA_CANVAS)
                                        bitmapData_2.copyPixels(bitmap2, new LRectangle(bitmap2.width-w, 0, w, canvasHeight), new LPoint(0,0));
                                        bitmapData_2.copyPixels(bitmap2, new LRectangle(0, 0, bitmap2.width, bitmap2.height), new LPoint(w,0));
                                        bitmapData_2.copyPixels(bitmap2, new LRectangle(0, 0, w, canvasHeight), new LPoint(bitmap2.width+w,0));
                                        scene_2.addChild(new LBitmap(bitmapData_2));
                                        scene_2.bgWidth = bitmap2.width;
                                        scene_2.width = bitmap2.width+w*2;
                                        scene_2.height = canvasHeight;
                                        creatElement(0);//添加元素                       
                                        $("#map a").show();       
                                        scene.onload = true;       
                                });  
                        });  

作者: lufy    时间: 2017-3-23 16:03
islzc 发表于 2017-3-23 15:13
var w = canvasWidth*2*moveSpeed;
                        scene_1 = new LSprite();
                        scene_2 = new LSprite();

什么意思啊?
我不是让你先试试文档中的demo,看看是引擎的问题还是你代码的问题吗




欢迎光临 lufy's legend (http://lufylegend.com/forum/) Powered by Discuz! X2.5