CreateSlider (Function): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>JulienDethurens |
m Text replacement - "<SyntaxHighlight code="lua">" to "<syntaxhighlight lang="lua">" |
||
(19 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<onlyinclude> | <onlyinclude> | ||
{{ | {{Function|name = CreateSlider | ||
|arguments = [[number]] | |arguments = [[number]] <var>steps</var>, [[number]] <var>width</var>, [[UDim2]] <var>position</var> | ||
|returns = [[Frame]] | |returns = [[RBX.lua.Frame (Object)|Frame]] <var>sliderGui</var>, [[RBX.lua.IntValue (Object)|IntValue]] <var>sliderPosition</var> | ||
|description = Returns 2 objects, (sliderGui, sliderPosition). | |description = Returns 2 objects, (<var>sliderGui</var>, <var>sliderPosition</var>). <var>sliderGui</var> is a [[RBX.lua.Frame (Object)|Frame]] that contains the entire slider gui. <var>sliderPosition</var> is an [[RBX.lua.IntValue (Object)|IntValue]] whose current value specifies the specific step the slider is currently on (This value can be modified by a script, and the slider with adjust position). The <var>steps</var> argument specifies how many different positions the slider can hold along the bar. <var>width</var> specifies in pixels how wide the bar should be (modifiable afterwards if desired). <var>position</var> argument should be a UDim2 for slider gui positioning. | ||
}} | }} | ||
Line 10: | Line 9: | ||
</onlyinclude> | </onlyinclude> | ||
<table><tr><td>< | <table><tr><td><syntaxhighlight lang="lua"> | ||
local RbxGui = LoadLibrary( | local RbxGui = assert(LoadLibrary('RbxGui')) | ||
local screenGui = Instance.new( | local screenGui = Instance.new('ScreenGui') | ||
screenGui.Parent = game.Players.LocalPlayer.PlayerGui | screenGui.Parent = game.Players.LocalPlayer.PlayerGui | ||
Line 20: | Line 19: | ||
exampleSliderValue.Value = 5 | exampleSliderValue.Value = 5 | ||
</ | </syntaxhighlight></td><td>[[Image:CreateSlider.jpg|thumb|250px|CreateSlider Example]]</td></tr></table> | ||
==See Also== | |||
*[[RbxGui (Library)|RbxGui]] | |||
[[Category:Functions]] |
Latest revision as of 06:10, 27 April 2023
CreateSlider( number steps, number width, UDim2 position ) | |
Returns | Frame sliderGui, IntValue sliderPosition |
Description: | Returns 2 objects, (sliderGui, sliderPosition). sliderGui is a Frame that contains the entire slider gui. sliderPosition is an IntValue whose current value specifies the specific step the slider is currently on (This value can be modified by a script, and the slider with adjust position). The steps argument specifies how many different positions the slider can hold along the bar. width specifies in pixels how wide the bar should be (modifiable afterwards if desired). position argument should be a UDim2 for slider gui positioning. |