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?