SliderComponent

Sets the values within the minimum and maximum ranges, and graphically displays the values.

# Properties

[{"index":"SliderDirection Direction","0":"Sets the direction to display the minimum to maximum values graphically."}]

[{"index":"Color FillRectColor","0":"The color of the area to represent the value graphically."}]

[{"index":"DataRef FillRectImageRUID","0":"The image RUID of the area to represent the value graphically."}]

[{"index":"RectOffset FillRectPadding","0":"Sets the free space of the area to display the value graphically."}]

[{"index":"RectOffset HandleAreaPadding","0":"The free space in the movable area with the slider handle."}]

[{"index":"Color HandleColor","0":"The color of the slider handle."}]

[{"index":"DataRef HandleImageRUID","0":"The image RUID of the slider handle."}]

[{"index":"Vector2 HandleSize","0":"The size of the slider handle."}]

[{"index":"boolean IgnoreMapLayerCheck (Sync)","0":"Does not perform automatic substitution when the Map Layer's name is specified in SortingLayer."}]

[{"index":"float MaxValue","0":"The maximum Value."}]

[{"index":"float MinValue","0":"The minimum Value."}]

[{"index":"int32 OrderInLayer (Sync)","0":"Determines the priority within the same layer. A higher number indicates higher priority."}]

[{"index":"boolean OverrideSorting (Sync) (ReadOnly)","0":"Determines whether to set the SortingLayer and OrderInLayer values manually."}]

[{"index":"string SortingLayer (Sync)","0":"When two or more entities overlap, the priority is determined according to the Sorting Layer."}]

[{"index":"boolean UseHandle","0":"Sets whether to use the handle."}]

[{"index":"boolean UseIntegerValue","0":"Sets whether to use the value only as an integer."}]

[{"index":"float Value","0":"Current value."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]

# Events

[{"index":"OrderInLayerChangedEvent","0":"This event occurs when changing the Component's OrderInLayer."}]

[{"index":"SliderValueChangedEvent","0":"This event occurs when changing the Slider value."}]

[{"index":"SortingLayerChangedEvent","0":"This event occurs when changing the component's SortingLayer."}]

# Examples

This example sets the value range of SliderComponent to 0 - 100 while displaying the value in TextComponent.
    
    
    @Component
    script SliderValueDisplay extends Component
        property Entity TextEntity = nil
    
        @ExecSpace("ClientOnly")
        method void OnBeginPlay()
        local sliderComp = self.Entity.SliderComponent
        if not sliderComp then
        	return
        end
    
        sliderComp.UseIntegerValue = true
        sliderComp.MaxValue = 100
        sliderComp.MinValue = 0
        sliderComp.Value = 0
    
        self:SetSliderText(sliderComp.Value)
        end
    
        method void SetSliderText(number sliderValue)
        if not self.TextEntity then
        	return
        end
    
        local textComp = self.TextEntity.TextComponent
        if not textComp then
        	return
        end
    
        textComp.Text = string.format("%d", sliderValue)
        end
    
        @EventSender("Self")
        handler HandleSliderValueChangedEvent(SliderValueChangedEvent event)
        -- Parameters
        local Value = event.Value
        --------------------------------------------------------
        self:SetSliderText(sliderValue)
        end
    end
    

# SeeAlso

  * TextComponent
  * SliderValueChangedEvent