BIS fnc initSliderValue: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *S([a-z ])" to "$1 - s$2") |
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *W([a-z ])" to "$1 - w$2") |
||
Line 13: | Line 13: | ||
|p2= ctrlEdit: [[Control]] - edit Box, usually the second control within the controls group | |p2= ctrlEdit: [[Control]] - edit Box, usually the second control within the controls group | ||
|p3= unit: [[String]] - measurement unit added behind the number within the edit box ("%" by default) | |p3= unit: [[String]] - measurement unit added behind the number within the edit box ("%" by default) | ||
|p4= default: [[Number]] - | |p4= default: [[Number]] - when present, only the value is set, functionality is not initialized | ||
|r1= [[Nothing]] | |r1= [[Nothing]] |
Revision as of 16:35, 8 November 2023
Description
- Description:
- Initialises a slider attribute control within the Eden Editor. Can also be used outside of Eden Editor.
- Execution:
- call
- Groups:
- Eden Editor
Syntax
- Syntax:
- [ctrlSlider, ctrlEdit, unit, default] call BIS_fnc_initSliderValue
- Parameters:
- ctrlSlider: Control - slider control, usually the first control within the controls group
- ctrlEdit: Control - edit Box, usually the second control within the controls group
- unit: String - measurement unit added behind the number within the edit box ("%" by default)
- default: Number - when present, only the value is set, functionality is not initialized
- Return Value:
- Nothing
Examples
- Example 1:
- Example 2:
- // Execute in Eden Editor to preview the functionality if !(is3DEN) exitWith {}; private _display = findDisplay 313; private _GRID_H = pixelGrid * pixelH * 0.5; private _GRID_W = pixelGrid * pixelW * 0.5; // Function only works if slider and edit control share the same group private _ctrlGroup = _display ctrlCreate ["ctrlControlsGroupNoScrollbars", -100]; _ctrlGroup ctrlSetPosition [0, 0, 101 * _GRID_W, 5 * _GRID_H]; // Setup the slider private _ctrlSlider = _display ctrlCreate ["ctrlXSliderH", -101, _ctrlGroup]; _ctrlSlider ctrlSetPosition [0, 0, 50 * _GRID_W, 5 * _GRID_H]; _ctrlSlider sliderSetRange [100, 2000]; // Setup the edit control private _ctrlEdit = _display ctrlCreate ["ctrlEdit", -102, _ctrlGroup]; _ctrlEdit ctrlSetPosition [51 * _GRID_W, 0, 25 * _GRID_W, 5 * _GRID_H]; _ctrlSlider ctrlCommit 0; _ctrlEdit ctrlCommit 0; _ctrlGroup ctrlCommit 0; // Set default value [_ctrlSlider, _ctrlEdit, "m", 200] call BIS_fnc_initSliderValue; // Added eventhandlers to controls [_ctrlSlider, _ctrlEdit, "m"] call BIS_fnc_initSliderValue;
Additional Information
- See also:
- Eden Editor: Configuring Attributes
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note