You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finally, you can add your node to the node tree. You can give it a name, and index, both, or neither. Giving it a name will allow you to use this node in its Actor form after its construction.
50
51
```lua
51
-
MyNode:AddToTree('MyNode', 1)
52
+
MyNode:AddToTree(1, 'MyNode')
52
53
```
53
54
More documentation avaiable in `konko-nodes.lua`.
54
55
@@ -62,16 +63,17 @@ This will ease `invert` at its current percent to `100` starting at beat `0` for
62
63
63
64
You can insert mods using three different functions. These examples all do the same thing, but each with their own syntax and advantages.
64
65
```lua
65
-
-- In-house method - Recommended for inserting tables of percent-mod pairs
66
+
-- In-house method
66
67
Mods:Insert(0, 4, Tweens.outelastic, {
67
68
{100, 'invert'},
68
-
{100, 'tipsy'}
69
+
-- You can also specify a starting percent.
70
+
{100, 'tipsy', -100}
69
71
})
70
72
71
-
-- Mirin Method - Recommended for fast mod prototyping
@@ -94,30 +96,41 @@ There's really no limit to what you can write for a library. Since the only requ
94
96
95
97
1. If you need a certain library to function, include it! remember to use `import` for anything you'll need.
96
98
1. Try to keep your library local to avoid interfering with other libraries. Even the included standard library is local!
97
-
2. If you write a library and you need to add an actor, you should do this with `FG[#FG + 1] = Def.ActorFrame {}`. This is the same `FG` that is created in `env.lua` and added to the ActorFrame in `init.lua`. This `FG` ActorFrame has an update loop already provided that will call `UpdateCommand` every frame.
98
-
3. Another thing to consider if you write your own standard library is that you may need to write your own mod loader as well. This is why one is included. It may not make writing a mod loader clear, but it will give you an idea of what it may expect from your standard library.
99
-
4. You're more than welcome to submit your library to the [Template Library Repository](https://github.com/Tiny-Foxes/kitsu-template-libraries/)! Once approved, it will be listed with others in an easy-to-find location.
99
+
1. If you write a library and you need to add an actor, you should do this with `FG[#FG + 1] = Def.ActorFrame {}`. This is the same `FG` that is created in `env.lua` and added to the ActorFrame in `init.lua`. This `FG` ActorFrame has an update loop already provided that will call `UpdateCommand` every frame.
100
+
1. Another thing to consider if you write your own standard library is that you may need to write your own mod loader as well. This is why one is included. It may not make writing a mod loader clear, but it will give you an idea of what it may expect from your standard library.
101
+
1. You're more than welcome to submit your library to the [Template Library Repository](https://github.com/Tiny-Foxes/kitsu-template-libraries/)! Once approved, it will be listed with others in an easy-to-find location.
100
102
101
103
Generally, a library is written as follows:
102
104
```lua
105
+
-- mylib.lua --
106
+
103
107
-- You can import libraries in your library, too! That's what we call a dependency.
104
-
localstd=import'stdlib'
108
+
depend ('mylib', std, 'stdlib')
109
+
-- If the library does not have a global namespace, you can simply import it directly.
110
+
localOtherLib=import'otherlib'
105
111
106
112
-- We will fill this and return it in the end.
107
113
localMyLib= {}
108
114
setmetatable(MyLib, {})
109
115
110
116
-- We write our library definitions here.
111
117
localMyVar=std.SCX
118
+
localfunctionGetVar()
119
+
returnMyVar
120
+
end
112
121
localfunctionMyFunc(n)
113
122
returnMyVar+n
114
123
end
124
+
localfunctionAddVars()
125
+
returnOtherLib.GetVar() +MyVar
126
+
end
115
127
116
128
-- List only what you want to export. Internal variables should stay hidden to prevent other things from messing with them.
117
129
MyLib= {
118
130
VERSION='1.0',
119
-
var=MyVar,
120
-
func=MyFunc
131
+
var=GetVar,
132
+
func=MyFunc,
133
+
otherfunc=AddVars
121
134
}
122
135
MyLib.__index=MyLib
123
136
@@ -128,9 +141,9 @@ return MyLib
128
141
129
142
You should name be able to import your library into `mods.lua` or other libraries by using `import`.
130
143
```lua
131
-
locallib=import'MyLib'
144
+
locallib=import'mylib'
132
145
133
-
print(lib.var) -- Will print the value of SCREEN_CENTER_X
146
+
print(lib.var()) -- Will print the value of SCREEN_CENTER_X
134
147
localnewvar=lib.func(7)
135
148
print(newvar) -- Will print the value of SCREEN_CENTER_X + 7
Copy file name to clipboardExpand all lines: docs/outfox/staging-notes.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,12 @@
1
1
# Staging Notes
2
+
3
+
### August 29, 2022 7:07pm
4
+
Jesus Christ the docs are so out of date.
5
+
6
+
I did my best to fix up what I could with the README, but it's gonna take a while before I get to the API reference documentation. There's just a lot on my plate and it'll take a while for me to get through all of it.
7
+
8
+
I almost accidentally deleted the entire docs, by the way. What the hell is my goddamn problem.
9
+
2
10
---
3
11
### October 15, 2021 1:19am
4
12
I've finally gotten back into the swing of working on the template again. During the time I haven't been around this I've made [an entire theme](https://github.com/Tiny-Foxes/superuser-outfox"god it took forever to actually push myself to do this").
0 commit comments