FlClash 配置文件结构
FlClash 的配置文件通常以 JSON 格式存在,文件名为 flclash.json,以下是一个典型的配置文件示例:
{
"version": "1..",
"renderer": "webgl",
"renderRes": {
"width": 800,
"height": 600
},
"colorSpace": "sRGB",
"renderQuality": "high",
"antialias": true,
"msaa": true,
"maxAntialiasLevel": 4,
"frameLimit": 60,
"flipY": false,
"premultiplied": true,
"alphaMode": "multiply",
"autoSwap": true,
"swapInterval": 1,
"sensitive": true,
"scaleFactor": 1,
"scaleLevels": [1, 2, 4],
"scalePreset": "default",
"scaleMin": 1,
"scaleMax": 8,
"scaleStep": 1.5,
"scaleSnap": true,
"scaleSmooth": true,
"scaleOnMax": false,
"scaleOnMin": false,
"likeScale": 1,
"likeRotate": 0,
"likeTranslate": [, 0],
"likeZoom": 1,
"likeMove": true,
"likeReset": true,
"easing": {
"easeIn": "cubic-bezier(.4, 0, 0.2, 1)",
"easeOut": "cubic-bezier(.4, 1, 0.2, 0)",
"easeInExpo": "cubic-bezier(.4, 0, 0.15, 1)",
"easeOutExpo": "cubic-bezier(.4, 1, 0.15, 0)",
"easeInCirc": "cubic-bezier(.4, 0.2, 0.15, 1)",
"easeOutCirc": "cubic-bezier(.4, 0.8, 0.15, 0)",
"easeInQuad": "cubic-bezier(.4, 0, 0.3, 1)",
"easeOutQuad": "cubic-bezier(.4, 1, 0.3, 0)",
"easeInSine": "sine",
"easeOutSine": "sine",
"easeInCosine": "cosine",
"easeOutCosine": "cosine"
},
"devicePixelRatio": 1,
"touchSupport": true,
"touchHold": 0,
"touchHoldThreshold": 0.1,
"touchHoldDuration": 0.5,
"touchHoldSensitivity": 0.5,
"wheel": {
"enable": true,
"sensitivity": 0.1,
"invert": false,
"page": 1,
"zoom": true,
"drag": false
},
"keyboard": {
"enable": true,
"keys": {
"w": "up",
"s": "down",
"a": "left",
"d": "right",
"f": "forward",
"b": "backward",
"pageup": "up",
"page": "forward",
"pagedown": "backward"
}
},
"mouse": {
"enable": true,
"hide": false,
"left": true,
"right": true,
"middle": false,
"show": true
},
"touch": {
"enable": true,
"single": true,
"double": false,
"gestures": {
"pinch": "zoom",
"swipe": "forward",
"swipeUp": "up",
"swipeDown": "down",
"swipeLeft": "left",
"swipeRight": "right"
}
},
"renderSettings": {
"wireframe": false,
"shading": "phong",
"textures": {
"maxSize": 4096,
"mipmap": true,
"sampler": "nearest"
}
},
"physics": {
"gravity": [, 0, 0],
"friction": 0.1,
"bounciness": 0.5
},
"particles": {
"enabled": false,
"count": 100,
"size": 1,
"color": "#000000",
"speed": 0.5,
"direction": "right"
}
}
参数解释
-
顶级参数
version: FlClash 的版本号。renderer: 渲染器类型,通常为webgl。renderRes: 渲染尺寸,width和height可以根据需求调整。
-
渲染参数
colorSpace: 颜色空间,默认为sRGB。renderQuality: 渲染质量,high是常见的选择。antialias: 是否抗锯齿渲染,通常为true。msaa: 是否使用多层次抗锯齿(MSAA),提升渲染质量。maxAntialiasLevel: 抗锯齿的最大级别。frameLimit: 帧率限制,避免过高的帧率。flipY: 是否翻转 Y 轴,通常为false。premultiplied: 是否预乘颜色,通常为true。alphaMode: alpha 混合模式,multiply是常见选择。autoSwap: 是否自动切换场景,通常为true。swapInterval: 切换间隔,单位为秒。sensitive: 是否敏感触发,通常为true。scaleFactor: 缩放因子,默认为1。scaleLevels: 缩放级别数组,用于缩放效果。scalePreset: 缩放预设,default是常见选择。scaleMin和scaleMax: 缩放范围。scaleStep: 缩放步长。scaleSnap: 是否按比例缩放,通常为true。scaleSmooth: 是否平滑缩放,通常为true。scaleOnMax和scaleOnMin: 是否在达到最大或最小缩放时触发回调。likeScale: 拖拽缩放比例,默认为1。likeRotate: 拖拽旋转,默认为 ``。likeTranslate: 拖拽平移,默认为[, 0]。likeZoom: 拖拽缩放,默认为1。likeMove: 是否支持拖拽移动,默认为true。likeReset: 是否支持拖拽后重置,默认为true。
-
动画参数
easing: 动画缓冲函数,默认使用cubic-bezier。devicePixelRatio: 设备像素比率,通常为1。touchSupport: 是否支持触控,默认为true。touchHold: 触控长按时间,默认为 ``。touchHoldThreshold: 长按触控区域,默认为.1。touchHoldDuration: 长按时间,默认为.5秒。touchHoldSensitivity: 长按灵敏度,通常为.5。
-
交互参数
wheel: 滚动轮的设置,enable是否开启,sensitivity敏感度,invert是否反向,page阅读模式,zoom是否支持缩放,drag是否支持拖拽。keyboard: 键盘控制,enable是否开启,keys各键的映射。mouse: 鼓励鼠标控制,enable是否开启,left左键,right右键,middle中间键,show是否显示。touch: 触控设置,enable是否开启,single是否单点触控,double




