CreateSlider (Function): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>JulienDethurens
Created page with "<onlyinclude> {{User:JulienDethurens/Sandbox|name = CreateSlider |arguments = number '''steps''', number '''width''', UDim2 '''position''' |returns = [[Frame..."
>JulienDethurens
No edit summary
Line 1: Line 1:
<onlyinclude>
<onlyinclude>
{{User:JulienDethurens/Sandbox|name = CreateSlider
{{Function|name = CreateSlider
|arguments  = [[number]] '''steps''', [[number]] '''width''', [[UDim2]] '''position'''
|arguments  = [[number]] '''steps''', [[number]] '''width''', [[UDim2]] '''position'''
|returns    = [[Frame]] ''sliderGui'', [[IntValue]] ''sliderPosition''
|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.  
|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.  
|library      = RbxGui
}}
}}


Line 11: Line 10:


<table><tr><td><code lua>
<table><tr><td><code lua>
local RbxGui = LoadLibrary("RbxGui")
local RbxGui = assert(LoadLibrary('RbxGui'))


local screenGui = Instance.new("ScreenGui")
local screenGui = Instance.new('ScreenGui')
screenGui.Parent = game.Players.LocalPlayer.PlayerGui
screenGui.Parent = game.Players.LocalPlayer.PlayerGui



Revision as of 04:15, 4 February 2012

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.


local RbxGui = assert(LoadLibrary('RbxGui'))

local screenGui = Instance.new('ScreenGui') screenGui.Parent = game.Players.LocalPlayer.PlayerGui

local exampleSliderGui, exampleSliderValue = RbxGui.CreateSlider(10,200,UDim2.new(0.5, 270, 0.5, 232)) exampleSliderGui.Parent = screenGui

exampleSliderValue.Value = 5

CreateSlider Example