update docs
This commit is contained in:
parent
3e38345dfb
commit
6da5cece55
9 changed files with 112 additions and 15 deletions
|
|
@ -1,18 +1,12 @@
|
|||
|
||||
# Quad
|
||||
|
||||
## 목차
|
||||
처음오셨나요? [튜토리얼 문서](kr/tutorial/0gettingStarted)를 읽어보세요!
|
||||
처음부터 차근차근 Quad 모듈을 정복할 수 있어요
|
||||
|
||||
class.import
|
||||
mount
|
||||
event
|
||||
style
|
||||
store
|
||||
tween
|
||||
store.getStore (register)
|
||||
class.extend
|
||||
## 튜토리얼 문서 목차
|
||||
|
||||
## 모든 문서
|
||||
## API 레퍼런스
|
||||
|
||||
class
|
||||
*__call*, import
|
||||
|
|
@ -43,3 +37,20 @@ style
|
|||
*__call* new
|
||||
|
||||
tween (from @qwreey75:AdvancedTween)
|
||||
|
||||
## 진행중이거나 검토중
|
||||
|
||||
### Quad Component Studio
|
||||
|
||||
눈에 보이는 워지워그식 편집기를 이용해 Quad Class 를 생성합니다.
|
||||
WIP. 아직 진행중인 프로젝트.
|
||||
|
||||
### Quad Debuger
|
||||
|
||||
Register 의 상태와 Store 의 값, Class 의 동작 여부 등 Quad 의 여러 자원을 긴밀하게 디버그합니다.
|
||||
WIP. 아직 진행중인 프로젝트.
|
||||
|
||||
### Quad WebRender
|
||||
|
||||
HTML, CSS, JS 로써 스크립트를 변형해 스튜디오 없이 개발하는 가벼운 개발법입니다.
|
||||
WIP. 검토중인 프로젝트.
|
||||
|
|
|
|||
|
|
@ -7,7 +7,20 @@
|
|||
|
||||
## 설치
|
||||
|
||||
## 모듈 불러오기/초기화
|
||||
|
||||
## 테스트 환경 준비
|
||||
|
||||
테스트 환경은 rojo 와의 개발통합을 위해 Play 버튼을 누르지 않고 미리보기를 사용할 수 있도록 만들어줍니다
|
||||
이를 통해 다른 코드 방식의 UI 프레임 워크보다 빠른 개발속도를 달성할 수 있습니다
|
||||
|
||||
### 자동 리로드
|
||||
|
||||
*주의: rojo 환경이 아니라면 자동 리로드는 랙을 동반할 수 있습니다*
|
||||
> 일반적으로, 로컬 편집 환경에서 로블록스의 script editor 는 한글자 한글자 변경시 마다 .Source 를 업데이트합니다. 이는 곳 한글자 한글자 타이핑 시 마다 UI 가 업데이트 될 수 있음을 의미합니다. Quad 의 tracker 모듈은 순간적으로 많은양의 리로드가 발생하지 않도록 적절한 쿨타임과 시간분배를 가지고 있지만, 이 경우에도 Ctrl+S 를 눌러 저장해야 적용되는 vscode 와 같은 타 편집기와는 차이가 날 수 있습니다. 코드가 커짐으로 인해 자동 리로드에서 퍼포먼스적 이슈를 겪는다면, rojo 를 활용해 코드를 외부로 옮긴 후, vscode 를 스튜디오 위에 놓고 미리보기와 코드를 동시에 보면서 편집하세요.
|
||||
|
||||
|
||||
### 수동 리로드
|
||||
|
||||
[다음 페이지로 가기](kr/tutorial/1_install)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
|
||||
# 오브젝트에 아이디 부여하기, 그리고 사용하기
|
||||
|
||||
읽기 전...
|
||||
> **다른 모듈, 로컬스크립트가 접근하더라도 같은 QuadId 를 가졌다면 Store 는 공유됩니다**
|
||||
> Quad.Init(QuadId:string?)
|
||||
> 필요에 따라 다른 모듈에서의 오브젝트를 가져오는것을 막고싶다면 QuadId 를 모듈마다 다르게 설정하세요.
|
||||
|
||||
**변수에 만들어진 오브젝트를 하나하나 저장해???** 그게 편할리가 없죠. 오브젝트에 아이디를 넣고 사용해봅시다.
|
||||
|
||||
```lua
|
||||
|
|
@ -103,6 +108,12 @@ end
|
|||
id 기능을 조금더 고급적인 방법으로 사용할 수도 있습니다.
|
||||
|
||||
```lua
|
||||
local ScreenGUI = script.Parent
|
||||
local Quad = require(path.to.module).Init()
|
||||
local Class,Mount,Store = Quad.Class,Quad.Mount,Quad.Store
|
||||
|
||||
local Frame = Class "Frame"
|
||||
|
||||
--다음과 같이 a 와 b 모두 가진 프레임을 생성할 수도 있습니다.
|
||||
Frame "a,b" {
|
||||
Name = "main";
|
||||
|
|
@ -136,3 +147,29 @@ end)
|
|||
또는(or) 연산 `,` 와 그리고(and) 연산 `&` 연산을 GetObjects 에 사용할 수 있고, 생성시에는 `,` 로 여러 아이디를 부여해줄 수 있습니다. *띄어쓰기는 무시됩니다*
|
||||
|
||||
> 주의 : *고급 ID 사용시 :Remove 연산자는 사용할 수 없습니다*
|
||||
|
||||
# id 추가와 제거
|
||||
|
||||
경우에 따라 이미 생성한 오브젝트에 id 를 추가 혹은 제거해줄 수 있습니다
|
||||
|
||||
```lua
|
||||
local ScreenGUI = script.Parent
|
||||
local Quad = require(path.to.module).Init()
|
||||
local Class,Mount,Store = Quad.Class,Quad.Mount,Quad.Store
|
||||
|
||||
local Frame = Class "Frame"
|
||||
|
||||
Frame "testing" {}
|
||||
|
||||
-- 아이디를 추가합니다
|
||||
Store.AddObject(
|
||||
"a,b",Store.GetObject("testing")
|
||||
)
|
||||
|
||||
-- 아이디를 제거합니다
|
||||
Store.GetObjects("a"):Remove(Store.GetObject("testing"))
|
||||
```
|
||||
|
||||
`Store.AddObject(ids:string,item:any)` 를 이용해 아이디를 추가하고 `:Remote(item:any)` 를 이용해 아이디를 제거합니다
|
||||
|
||||
[다음 튜토리얼](./4_style)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
# 반복되는 속성값을 줄이기
|
||||
|
||||
```lua
|
||||
local ScreenGUI = script.Parent
|
||||
local Quad = require(path.to.module).Init()
|
||||
local Class,Mount,Store = Quad.Class,Quad.Mount,Quad.Store
|
||||
|
||||
local Frame = Class "Frame"
|
||||
|
||||
Frame "mainFrame" {
|
||||
Size = UDim2.fromScale(1,1);
|
||||
Frame "Child" {
|
||||
Size = UDim2.fromOffset(20,20);
|
||||
};
|
||||
Frame "Child" {
|
||||
Size = UDim2.fromOffset(20,20);
|
||||
Position = UDim2.fromOffset(30,0);
|
||||
};
|
||||
Frame "Child" {
|
||||
Size = UDim2.fromOffset(20,20);
|
||||
Position = UDim2.fromOffset(60,0);
|
||||
};
|
||||
Frame "Child" {
|
||||
Size = UDim2.fromOffset(20,20);
|
||||
Position = UDim2.fromOffset(90,0);
|
||||
};
|
||||
}
|
||||
|
||||
Mount(ScreenGUI,Store.GetObject("mainFrame"))
|
||||
```
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
# 이벤트 등록하기
|
||||
|
|
@ -2,3 +2,5 @@
|
|||
# 언어관리
|
||||
|
||||
Quad 에는 귀찮은 언어관리를 자동으로 해주는 모듈이 내장되어 있습니다.
|
||||
또한, register 와 연동해 변하는 텍스트도 알아서 언어에 맞게 출력되도록 만들 수 있습니다.
|
||||
|
||||
|
|
|
|||
|
|
@ -157,7 +157,6 @@ function module.init(shared)
|
|||
local item = items[id]
|
||||
return item and item[next(item)]
|
||||
end
|
||||
--TODO: if item is exist already, ignore this call
|
||||
-- adding object with id
|
||||
function new.AddObject(ids,object)
|
||||
for id in gmatch(ids,"[^,]+") do -- split by ,
|
||||
|
|
@ -168,7 +167,9 @@ function module.init(shared)
|
|||
array = objectListClass.__new()
|
||||
items[id] = array
|
||||
end
|
||||
insert(array, object)
|
||||
if not find(array,object) then
|
||||
insert(array, object)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -325,8 +325,8 @@ export type module_exported = {
|
|||
Lang: module_lang;
|
||||
}
|
||||
export type module = {
|
||||
Uninit: (id:string)->();
|
||||
Init: (id:string?)->module_exported;
|
||||
Uninit: (QuadId:string)->();
|
||||
Init: (QuadId:string?)->module_exported;
|
||||
}
|
||||
|
||||
return {}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ if false then if not task then _G.task = {} end end
|
|||
local module = {}
|
||||
module.__index = module
|
||||
|
||||
module.scheduleDelay = 0.1
|
||||
module.scheduleDelay = 1
|
||||
|
||||
function module:__emit(eventName,...)
|
||||
for _,func in ipairs(self.events[eventName]) do
|
||||
|
|
|
|||
Loading…
Reference in a new issue