ScrollLayoutGroupComponent

You can control the components related to the scroll view as one.

# Properties

[{"index":"Vector2 CellSize","0":"Fixed size of child UI Entity. Grid type only."}]

[{"index":"ChildAlignmentType ChildAlignment","0":"Set the alignment direction of the child UI Entity if the Entity has free space. For Vertical and Grid types only."}]

[{"index":"GridLayoutConstraint Constraint","0":"Constraints on the number of rows and columns. Grid type only."}]

[{"index":"int32 ConstraintCount","0":"The number of rows or columns to freeze based on the constraint. Grid type only."}]

[{"index":"ChildAlignmentType GridChildAlignment","0":"Sets the alignment direction of the child UI Entity if the Entity has free space. For Grid type only."}]

[{"index":"Vector2 GridSpacing","0":"Horizontal and vertical spacing between child UI Entities. Grid type only."}]

[{"index":"HorizontalScrollBarDirection HorizontalScrollBarDirection","0":"The orientation of the horizontal scrollbar."}]

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

[{"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":"RectOffset Padding","0":"Sets the free space on the top, bottom, left, and right of the layout group."}]

[{"index":"boolean ReverseArrangement","0":"Determines whether to reverse the existing sort. For Vertical and Horizontal types only."}]

[{"index":"Color ScrollBarBackgroundColor","0":"The background color of the scrollbar."}]

[{"index":"DataRef ScrollBarBgImageRUID","0":"The background image of the scrollbar."}]

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

[{"index":"DataRef ScrollBarHandleImageRUID","0":"The handle image of the scrollbar."}]

[{"index":"float ScrollBarThickness","0":"The thickness of the scrollbar area."}]

[{"index":"ScrollBarVisibility ScrollBarVisible","0":"Sets whether to display the scrollbar automatically."}]

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

[{"index":"float Spacing","0":"The spacing between child UI Entities. For Vertical and Horizontal types only."}]

[{"index":"GridLayoutAxis StartAxis","0":"The alignment direction of the child UI Entity. Grid type only."}]

[{"index":"GridLayoutCorner StartCorner","0":"The starting position of the child UI Entity's alignment. Grid type only."}]

[{"index":"LayoutGroupType Type","0":"Sets the sort format of the layout group."}]

[{"index":"boolean UseScroll","0":"Sets whether to use the scroll function."}]

[{"index":"VerticalScrollBarDirection VerticalScrollBarDirection","0":"The orientation of the vertical scrollbar."}]

##### 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

[{"index":"Vector2 GetScrollNormalizedPosition()","0":"Returns the normalized position of the scroll bar."}]

[{"index":"float GetScrollNormalizedPosition(UITransformAxis axis)","0":"Returns the normalized position of the specified directional scroll bar."}]

[{"index":"void ResetScrollPosition(UITransformAxis axis)","0":"Moves the position of the scroll bar on the specified axis to the first position. The initial position depends on the direction of the scroll bar."}]

[{"index":"void SetScrollNormalizedPosition(UITransformAxis axis, float value)","0":"Moves the position of the scroll bar on the specified axis to the designated normalized position. The direction of 0 and 1 is different depending on the direction of the scroll bar."}]

[{"index":"void SetScrollPositionByItemIndex(int32 index)","0":"Moves the scroll bar to a position where the child UI Entity at a specific index is visible."}]

##### 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":"ScrollPositionChangedEvent","0":"An event that occurs when the scroll position changes on a scrollable UI Entity. Only occurs if the UI Entity has ScrollLayoutGroupComponent or GridViewComponent."}]

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

# Examples

This is an example of changing the CellSize of ScrollLayoutGroupComponent, fixing it to the first column, copying the ItemEntity up to InitItemCount, and adding it to ScrollLayoutGroupComponent.

Test by adding this component to an Entity with ScrollLayoutGroupComponent and setting the property value of ItemEntity and InitItemCount.
    
    
    @Component
    script ItemGridInitializer extends Component
        property Entity ItemEntity = nil
        property number InitItemCount = 0
    
        method void OnBeginPlay()
        self.ItemEntity = self.Entity:GetChildByName("Scroll_Image")
        self.InitItemCount = 10
    
        self:Init()
        end
    
        method void Init()
        if not self.ItemEntity then
        	return
        end
    
        local scrollLayoutComp = self.Entity.ScrollLayoutGroupComponent
        if scrollLayoutComp then
        	scrollLayoutComp.CellSize = Vector2(200, 200)
        	scrollLayoutComp.Constraint = GridLayoutConstraint.FixedColumnCount
        	scrollLayoutComp.ConstraintCount = 1
        end
    
        local i = 0
        for i = 0, self.InitItemCount, 1 do
        	local itemslot = _SpawnService:Clone("Item", self.ItemEntity, self.Entity)
        end
        end
    end
    

# SeeAlso

  * Entity
  * Vector2
  * SpawnService