Fandom

武装突袭 Wiki

LinearConversion

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 分享

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

Introduced with Arma 3 version 0.50
  

点击图片可看到更多讯息

开始使用于

游戏:
Arma 3
版本:
0.50

描述

描述:
Converts given value from given "from" range to wanted "to" range. If clipping is set to true, the resulting value is guaranteed to be within "to" range no matter what.

Say given range is 0 to 1 and wanted range is 0 to 100 (percent calculation). Given value 0.55 then will be
linearConversion [0,1,0.55,0,100]; //55
but if given value is 1.1
linearConversion [0,1,1.1,0,100,false]; //110
or if clipping is true
linearConversion [0,1,1.1,0,100,true]; //100

基本句法

句法:
linearConversion [minFrom, maxFrom, value, minTo, maxTo, clip]
参数:
[minFrom, maxFrom, value, minTo, maxTo, clip]: Array

minFrom: Number - start "from" range

maxFrom: Number - end "from" range

value: Number - given value from "from" range

minTo: Number - start "to" range

maxTo: Number - end "to" range

clip (Optional): Boolean - if true, resulting value cannot leave "to" range. Default: false
返回值:
Number - respectful value from "to" range

范例

范例1:
linearConversion [4, 8, 5, 0, 1, false];

范例2:
Calculate days from 1/1/1970: fnc_daysFromEpoc = { private _year = param [0]; private _days = 0; for "_i" from 1970 to _year - 1 do { _days = _days + round linearConversion [0, 1, dateToNumber [_i, 12, 31, 23, 59], 0, 365, false]; }; _days + linearConversion [0, 1, dateToNumber _this, 0, 365, false]; };

hint str (date call fnc_daysFromEpoc);

额外资讯

多人游戏:
-
也可以看看:

roundfloorceil

注意事项

此处撰写句法皆为可行用法. 可到官网[1]专页回报错误. 你可以使用讨论页面或是论坛来进行讨论.
新增注意事项 | 如何新增?

Notes

Posted on Mar 29, 2014 - 09:39
ffur2007slx2_5
(A3 0.50) It is recommended to use linearConversion instead of BIS_fnc_linearConversion: linearConversion [0,100,50,0,50,true ]; //same as [[0,100],50,[0,50]] call BIS_fnc_linearConversion As for clamp, true will disable new value out of its range while false won't: linearConversion [0,100,150,0,50,true ]; //return 50 linearConversion [0,100,150,0,50,false ]; //return 75

Bottom Section

更多维基

随机维基