拖拽或者moveTo:
<action name="control_startup" autorun="onstart">
set(control.mouse, moveto);
set(control.touch, moveto);
</action>
先要改成drag就是将moveto改成drag阅读全文>>
首先讲examples\compass的指南针复制到根目录,然后两种方式,第一种复制到secene外面:
<!-- 表盘不动 表针动 -->
<layer name="compass1" url="compass_bg.png" keep="true" align="lefttop" x="10" y="10" children="false" scalechildren="true" destscale="1.0" onclick="switch(destscale,1.0,0.5);tween(scale,get(destscale));">
...阅读全文>>
scene外面:
<action name="bgsnd_action" autorun="onstart">
playsound(bgsnd, 'http://fs.open.kugou.com/299ee8fc00a480e899d180bb715a6231/59c10d94/G009/M0A/09/05/qYYBAFUJvZiAXUb2AD6652iMRH8210.mp3', 0);
</action>
<plugin name="soundinterface"
url.flash="%SWFP...阅读全文>>
在scene外面
<action name="do_crop_animation">
<!-- 为热点注册属性 -->
registerattribute(xframes, calc((imagewidth / %1) BOR 0));
registerattribute(yframes, calc((imageheight / %2) BOR 0));
registerattribute(frames, calc(xframes * yframes));
registerattribute(frame, 0);
set(...阅读全文>>
然后在tour.xml的scene标签外面书写:
<events name="littleplanetintro_control" keep="true"
onnewpano="
if(scene[get(xml.scene)].index == 0 OR scene[get(xml.scene)].index == 4,
skin_setup_littleplanetintro()
)"
/>
第0个场景或者第4个场景实现小行星;
或者littleplanetintro="true"
...阅读全文>>
var fs = require("fs");
var data = '';
// 创建可读流
var readerStream = fs.createReadStream('input.txt');
// 设置编码为 utf8。
readerStream.setEncoding('UTF8');
// 处理流事件 --> data, end, and error
readerStream.on('data', function(chunk) {
data += chunk;
});
readerStream.on('end',function(...阅读全文>>
var fs = require("fs");
var data = '12121';
// 创建一个可以写入的流,写入到文件 output.txt 中
var writerStream = fs.createWriteStream('output.txt');
// 使用 utf8 编码写入数据
writerStream.write(data,'UTF8');
// 标记文件末尾
writerStream.end();
// 处理流事件 --> data, end, and error
writerStream.on('finish', functio...阅读全文>>
var fs=require("fs");
var zlib=require("zlib");
// fs.createReadStream("1.txt").pipe(zlib.createGzip()).pipe(fs.createWriteStream("1.txt.gz"));//压缩
fs.createReadStream("1.txt.gz").pipe(zlib.createGunzip()).pipe(fs.createWriteStream("1.txt"));//解压
console.log("ok");阅读全文>>
今天又遇到了需要跨静态页面间传递json数据的方法,总结总结,都有其优缺点,
1.利用cookie传值的方法:(注意有缺点,当存储数据比较多的时候就可能出现丢失,取得的cookie为空,所以提前估量数据量)
function setCookie(c_name, value, expiredays) {
var exdate = new Date() ;
exdate.setDate(exdate.getDate() + expiredays);
document.cookie = c_name + "=" + escape(value) ...阅读全文>>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>iframe tag test</title>
<style type="text/css">
html, body
...阅读全文>>