- 注册时间
- 2016-6-17
- 最后登录
- 2017-4-5
- 阅读权限
- 20
- 积分
- 47
- 精华
- 0
- 帖子
- 6
|
本帖最后由 islzc 于 2017-3-23 15:27 编辑
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;
});
});
|
|