InventoryBox
InventoryBox
ํด๋ผ์ด์ธํธ์์ ์ฌ์ฉ๋๋ Widget InventoryBox ๊ฐ์ฒด.
์์ฑ
ImageDrawType
์ธ๋ฒคํ ๋ฆฌ ๋ฐ์ค ์ด๋ฏธ์ง์ DrawType์ ์ค์ ํ๊ณ ์ป์ ์ ์์ด์ (None, Tile, Slice, Border).
-- ์ํ --
local inventoryBox = Workspace.ScreenUI.InventoryBox
inventoryBox.ImageDrawType = Enum.ImageDrawType.Image
ImageSliceLeftRight
์ธ๋ฒคํ ๋ฆฌ ๋ฐ์ค ์ด๋ฏธ์ง์ DrawType์ด Slice, Border์ผ ๋์ Slice ์ข์ฐ์์ญ(๊ฐ๊ฐ 0๋ถํฐ 1์ฌ์ด)์ ์ ํ๊ณ ์ป์ ์ ์์ด์(Left, Right).
-- ์ํ --
local inventoryBox = Workspace.ScreenUI.InventoryBox
inventoryBox.ImageDrawType = Enum.ImageDrawType.Slice
inventoryBox.SliceLeftRight = Vector.new(0.5, 0.5, 0) --X : ์ข / Y : ์ฐ
ImageSliceTopBottm
์ธ๋ฒคํ ๋ฆฌ ๋ฐ์ค ์ด๋ฏธ์ง์ DrawType์ด Slice, Border์ผ ๋์ Slice ์ข์ฐ์์ญ(๊ฐ๊ฐ 0๋ถํฐ 1์ฌ์ด)์ ์ ํ๊ณ ์ป์ ์ ์์ด์(Top, Bottom).
-- ์ํ --
local inventoryBox = Workspace.ScreenUI.InventoryBox
inventoryBox.ImageDrawType = Enum.ImageDrawType.Slice
inventoryBox.SliceTopBottom = Vector.new(0.5, 0.5, 0) --X : ์ / Y : ํ
ImageTiling
์ธ๋ฒคํ ๋ฆฌ ๋ฐ์ค ์ด๋ฏธ์ง์ DrawType์ด Tile์ผ ๋์ ์ต์ ๊ฐ์ ์ค์ ํ๊ณ ์ป์ ์ ์์ด์ (NoTile, Horizontal, Vertical, Both)
-- ์ํ --
local inventoryBox = Workspace.ScreenUI.InventoryBox
inventoryBox.ImageDrawType = Enum.ImageDrawType.Image
inventoryBox.ImageTiling = Enum.ImageTilingType.Both
ํจ์
void SetColumn(number Count)
GridBox์ ํ ๊ฐ์๋ฅผ ์ค์ ํ ์ ์์ด์.
void SetWidthPadding(number Value)
GridBox์ ํ ์ฌ์ด๋ฅผ ์ค์ ํ ์ ์์ด์.
-- ์ํ --
local inventoryBox = Workspace.ScreenUI.InventoryBox
inventoryBox:SetWidthPadding(100)
float GetWidthPadding()
์ธ๋ฒคํ ๋ฆฌ๋ฐ์ค์ ํ ์ฌ์ด๋ฅผ ๊ฐ์ ธ์ฌ ์ ์์ด์.
-- ์ํ --
local inventoryBox = Workspace.ScreenUI.InventoryBox
print(inventoryBox:GetWidthPadding())
void SetHeightPadding(number Value)
GridBox์ ์ด ์ฌ์ด๋ฅผ ์ค์ ํ ์ ์์ด์.
-- ์ํ --
local inventoryBox = Workspace.ScreenUI.InventoryBox
inventoryBox:SetHeightPadding(100)
float GetHeightPadding()
์ธ๋ฒคํ ๋ฆฌ๋ฐ์ค์ ์ด ์ฌ์ด๋ฅผ ๊ฐ์ ธ์ฌ ์ ์์ด์.
-- ์ํ --
local inventoryBox = Workspace.ScreenUI.InventoryBox
print(inventoryBox:GetHeightPadding())
void SetSlotSize(number XSize, number YSize)
GridBox์ ์ฌ๋กฏ์ ์ฌ์ด์ฆ๋ฅผ ์ค์ ํ ์ ์์ด์.
-- ์ํ --
local inventoryBox = Workspace.ScreenUI.InventoryBox
inventoryBox:SetSlotSize(50, 50)
vector2D GetSlotSize()
์ธ๋ฒคํ ๋ฆฌ๋ฐ์ค์ ์ฌ๋กฏ ์ฌ์ด์ฆ๋ฅผ ๊ฐ์ ธ์ฌ ์ ์์ด์.
-- ์ํ --
local inventoryBox = Workspace.ScreenUI.InventoryBox
print(inventoryBox:GetSlotSize())
void SetBackgroundColor(Color color)
GridBox์ ๋ฐฐ๊ฒฝ ์์ ์ค์ ํ ์ ์์ด์. (๋ณ๊ฒฝํ ์)
-- ์ํ --
local inventoryBox = Workspace.ScreenUI.InventoryBox
InventoryBox:SetBackgroundColor(Color.new(0, 0, 255, 255))
color GetBackgroundColor()
์ธ๋ฒคํ ๋ฆฌ๋ฐ์ค์ ๋ฐฐ๊ฒฝ ์์ ๊ฐ์ ธ์ฌ ์ ์์ด์.
-- ์ํ --
local inventoryBox = Workspace.ScreenUI.InventoryBox
print(InventoryBox:GetBackgroundColor())
void SetContentTransparency(number Value)
GridBox์ ํฌ๋ช ๋๋ฅผ ์ค์ ํ ์ ์์ด์. (number Value)
-- ์ํ --
local inventoryBox = Workspace.ScreenUI.InventoryBox
inventoryBox:SetContentTransparency(0.5)
void SetOrientationType(ScrollOrientationType Type)
GridBox์ ์คํฌ๋กค ํ์ ์ ์ค์ ํ ์ ์์ด์(Enum.ScrollOrientationType.Type)
void SetScrollBarValue(number ScrollRatio)
ScrollBox์ ์คํฌ๋กค๋ฐ ์์น๋ฅผ ์ค์ ๋จ์(0~1)๋ก ์กฐ์ 0 ์ด๋ฉด ๊ฐ์ฅ ์ 1 ์ด๋ฉด ๊ฐ์ฅ ์๋
number GetScrollBarValue()
ScrollBox์ ์คํฌ๋กค๋ฐ ์์น๋ฅผ ์ค์ ๋จ์๋ก ๋ฐํ
์ฌ์ฉ ๊ฐ๋ฅํ ๋ถ๋ชจ ์ค๋ธ์ ํธ ๊ธฐ๋ฅ๋ค
์์ฑ
์ด๋ฆ
์ค๋ช
์์ ฏ์ ์์น๋ฅผ ๋ณ๊ฒฝํ ์ ์์ด์. (X์ขํ ๊ฐ, Y์ขํ ๊ฐ, 0)
์์ ฏ์ ํ์ ์ ์ค์ ํ ์ ์์ด์. (์ค์ ํ ๊ฐ)
์์ ฏ์ ์ค์ผ์ผ์ ์ค์ ํ ์ ์์ด์. (์ค์ ํ ๊ฐ)
์์ ฏ์ ํฌ๊ธฐ๋ฅผ ์ค์ ํ ์ ์์ด์. (๊ฐ๋ก๊ฐ, ์ธ๋ก๊ฐ, 0)
์์ ฏ์ ๊ทธ๋ฆฌ๋ ์์๋ฅผ ์ค์ ํ ์ ์์ด์.
UI ์์ ฏ์ ํ์ ์ฌ๋ถ๋ฅผ ์ค์ ํ ์ ์์ด์. (์์ ฏ ํ์ ์ฌ๋ถ)
UI ์์ ฏ์ ๋ฐ์ ์ฌ๋ถ๋ฅผ ์ค์ ํ ์ ์์ด์. (์์ ฏ ๋ฐ์ ์ฌ๋ถ)
์์ ฏ์ ํฌ๋ช ๊ฐ์ ์ค์ ํ ์ ์์ด์. (์ค์ ํ ๊ฐ)
์์ ฏ์ ๊ณ ์ ์ฌ๋ถ๋ฅผ ์ค์ ํ ์ ์์ด์. (์ค์ ํ ํ์ )
์์ ฏ์ ์ฑ์ฐ๊ธฐ๋ฅผ ์ค์ ํ ์ ์์ด์.
์ด๋ฒคํธ
์ด๋ฆ
์ค๋ช
widget์ด ๋ณด์ฌ์ง ๋ ํธ์ถ๋๋ ์ด๋ฒคํธ์์. ์ฐ๊ฒฐํจ์ ํ์์ function(widget), widget ์ ๋ณด์ฌ์ง๋ widget ๊ฐ์ฒด ์ ๋๋ค.
widget์ด ์ ๋ณด์ฌ์ง ๋ ํธ์ถ๋๋ ์ด๋ฒคํธ์์. ์ฐ๊ฒฐํจ์ ํ์์ function(widget), widget ์ ์ ๋ณด์ฌ์ง๋ widget ๊ฐ์ฒด ์ ๋๋ค.
widget์ ๋๋๊ทธ๊ฐ ์์ ๋ ๋ ํธ์ถ๋๋ ์ด๋ฒคํธ์์. ์ฐ๊ฒฐํจ์ ํ์์ function(widget, vector2D), widget์ ํด๋ฆญํ ๊ฐ์ฒด, vector2D๋ ๋ง์ฐ์ค ์์น์์.
widget์ ๋๋๊ทธ๊ฐ ์ทจ์๋ ๋ ํธ์ถ๋๋ ์ด๋ฒคํธ์์. ์ฐ๊ฒฐํจ์ ํ์์ function(widget, vector2D), widget์ ํด๋ฆญํ ๊ฐ์ฒด, vector2D๋ ๋ง์ฐ์ค ์์น์์.
widget์ ๋๋๊ทธ๊ฐ ๋๋๋ ๋ ํธ์ถ๋๋ ์ด๋ฒคํธ์์. ์ฐ๊ฒฐํจ์ ํ์์ function(widget, vector2D, dragwidget), widget์ ๋๋ํ ๊ฐ์ฒด, vector2D๋ ๋ง์ฐ์ค ์์น, dragwidget๋ ๋๋๊ทธํ widget์์.
ํจ์
์ด๋ฆ
์ค๋ช
(deprecate) AddChildUIWidget ํจ์๋ก ์ด์ฉํ์ธ์.
์์ UI ์์ ฏ์ ์ถ๊ฐํ ์ ์์ด์. (์์์ผ๋ก ์ถ๊ฐํ UI ์์ ฏ)
๋ถ๋ชจ UI ์์ ฏ์ ์ค์ ํ ์ ์์ด์. (๋ถ๋ชจ๋ก ์ค์ ํ UI ์์ ฏ)
์์ ฏ์ ์ ๊ฑฐํ ์ ์์ด์.
์์ ฏ์ ํ์ ์ ๋ฌธ์์ด๋ก ์ป์ ์ ์์ด์.
์์ ฏ์ ํ์ ์ Enum ํ์์ผ๋ก ์ป์ ์ ์์ด์.
์์ ฏ์ DragEvent ๋ฐ์ ์ ๋ณต์ฌ๋์ด ๋ณด์ฌ์ง widget์ ์ธํ ํด์.
์์ ฏ์ DragWidget์ ์ ์ฉ๋ Offset ์ด์์.
Last updated
Was this helpful?