Compare commits

...

10 Commits

Author SHA1 Message Date
c31d902074 alpha 2 2024-06-12 19:02:03 +03:00
7d18d380ab add noble as submodule 2024-06-12 18:46:49 +03:00
79702f4c8f remove noble 2024-06-12 18:41:38 +03:00
025880c358 redesign music and drone selection 2024-06-12 01:22:12 +03:00
43512c90c7 alpha 0.1 2024-06-10 01:50:27 +03:00
4d7f25c027 assemble minigame 2024-06-04 21:21:40 +03:00
2d7f65d7fb new cool backgroud 2024-06-03 21:15:23 +03:00
b0256d7ae3 bg 2024-06-03 20:08:46 +03:00
9cd5c1bd81 fix inertia 2024-06-03 00:34:03 +03:00
4f6d0a6c24 inertia and refactor 2024-06-03 00:31:15 +03:00
149 changed files with 2550 additions and 14451 deletions

3
.gitmodules vendored
View File

@@ -1,3 +1,6 @@
[submodule "Noble Engine"] [submodule "Noble Engine"]
path = source/libraries/noble path = source/libraries/noble
url = https://github.com/NobleRobot/NobleEngine.git url = https://github.com/NobleRobot/NobleEngine.git
[submodule "source/libraries/noble"]
path = source/libraries/noble
url = https://github.com/NobleRobot/NobleEngine.git

View File

@@ -3,5 +3,6 @@
## TODO: ## TODO:
- [ ] Menu audio - [ ] Menu audio
- [ ] Tags, zOffset from constants - [x] Tags, zOffset from constants
- [ ] Add global game state (?) - [ ] Add global game state (?)
- [x] Add inertia to the player

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,47 @@
--metrics={"baseline":7,"xHeight":0,"capHeight":0,"pairs":{},"left":[],"right":[]}
datalen=1136
data=iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAAAXNSR0IArs4c6QAAAw1JREFUaEPlV1ty4zAMa+5/6HaaRhkGxoOSnTiZ9qPdtWRTJEEAunz9/Xzf/tY/F/Js7MO19H5aH6HqvhGDvTv2uz3Xtd9feGgWBItQE2RJ12dpnSU3zlbjsoKr9XtMTBCrxRKpwWMAUkD3Tio4Q5hC1XUvS5AFwSqnamIRHAQxYYUohRoF4Q1EK67TrK3Mp4P1bzycJ1XEVJCH9dqtDu6PSpzNKOE0yhHTCXZZVM3nLpZrMnViYbnuYMAq+nHPEKKYQNSZ2wupwjOFqfNY30vjQc+uGHNGx7o610lSaXDSQyzKgw5i4FWaTuKfEmSHrAhK8kXjK8t1hBVTWsgSRcSs6vPGCHSqvgJB6y4gQzW/yTLi2WMH0xAnJ9EploIpJuOkpxqS6pCWE+zo5BEs6jrpRilatTT8r1wfRKOkYvosHZ2zFRJ3SeZrlRVLCHHwVbedO8ENtkpsKnWmCD37BtI8Cvee+C3DvydAlYFaAAYvt672q++Pju9KkIl/uu5sNKg8QJg7inc66WJQt/NuHVSFcC7H+tVnJMi0ybHi0yE6w2IMIk6U8bbC5obFr4XfzaLT2vJJLyRTrTqA5rhDMF2rxzyoc0rTTkaZ65a5Fd1lBUmsnDQ0ych1vaUlN7cyE5DJzDhQ53bS0dWnJDhz43CuRdE+86KrLHvvYLJhKKCdDnSMgoI8fr+bIMa8fp/p4FEzOGPPcK+DH3MsUmfVbUK5dNyPLMuqmDruWHP2trPhFCW8nyR19qyuA6qL44Pd9a7T6c4kWkE7o4r6UbeUIeh4WTWLlTHrzI0ZY+PgmJma7mclqGDTYcTVBKmZOCLBZNZZ1Wm1y0PHqqwAddQe/t1lKTWriqScIXBwx/mq/+84l1q4uw5iRbrCvmLdViDaJRU6s9gZNdjIhEguzu1jF5BQGMQdMtiaNBX/SgeZruHwsplIOneqaZhJQBWAeUM216ckymau6x07bHhKUhsqvT1gppfpFSMJRedvkyB1AeR0iuYdfE9NsjODq07EdfplSc8kqCD89iz6smqeEegH9dmYQMkYMS4AAAAASUVORK5CYII=
width=8
height=8
tracking=1
0 8
1 8
2 8
3 8
4 8
5 8
6 8
7 8
8 8
9 8
space 8
<EFBFBD> 8
A 8
B 8
C 8
D 8
E 8
F 8
G 8
H 8
I 8
J 8
K 8
L 8
M 8
N 8
O 8
P 8
R 8
Q 8
S 8
T 8
U 8
V 8
W 8
X 8
Y 8
Z 8

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,408 @@
--metrics={"baseline":8,"xHeight":0,"capHeight":0,"pairs":{"Fc":[-2,1],"Fe":[-2,1],"Fo":[-2,1],"Fm":[-2,1],"Fn":[-2,1],"Fr":[-2,1],"Fu":[-2,1],"Fw":[-2,1],"Jc":[-1,1],"Je":[-1,1],"Jo":[-1,1],"Jm":[-1,1],"Jn":[-1,1],"Jr":[-1,1],"Ju":[-1,1],"Jw":[-1,1],"Tc":[-2,1],"Te":[-2,1],"To":[-2,1],"Tm":[-2,1],"Tn":[-2,1],"Tr":[-2,1],"Tu":[-2,1],"Tw":[-2,1],"Yc":[-1,1],"Ye":[-1,1],"Yo":[-1,1],"Ym":[-1,1],"Yn":[-1,1],"Yr":[-1,1],"<22>B":[-1,1],"<22>D":[-1,1],"<22>E":[-1,1],"<22>F":[-1,1],"<22>H":[-1,1],"<22>K":[-1,1],"<22>L":[-1,1],"<22>M":[-1,1],"<22>N":[-1,1],"<22>P":[-1,1],"<22>R":[-1,1],"<22>b":[-1,1],"<22>h":[-1,1],"<22>k":[-1,1],"<22>C":[-1,1],"<22>G":[-1,1],"<22>O":[-1,1],"<22>Q":[-1,1],"<22>U":[-1,1],"<22>W":[-1,1],"<22>l":[-1,1],"<22>c":[-1,1],"<22>e":[-1,1],"<22>o":[-1,1],"<22>m":[-1,1],"<22>n":[-1,1],"<22>r":[-1,1],"<22>u":[-1,1],"<22>w":[-1,1],"H<>":[-1,2],"M<>":[-1,2],"N<>":[-1,2],"d<>":[-1,2],"U<>":[-1,2],"V<>":[-1,2],"W<>":[-1,2],"aT":[-2,2],"aY":[-1,2],"a<>":[-1,2],"mT":[-2,2],"mY":[-1,2],"m<>":[-1,2],"nT":[-2,2],"nY":[-1,2],"n<>":[-1,2],"qT":[-2,2],"qY":[-1,2],"q<>":[-1,2],"gT":[-2,2],"gY":[-1,2],"g<>":[-1,2],"oT":[-2,2],"oY":[-1,2],"o<>":[-1,2],"wT":[-2,2],"w<>":[-1,2],"yT":[-2,2],"y<>":[-1,2],"A<>":[-1,0],"B<>":[-1,0],"C<>":[-1,0],"DI":[-1,0],"DT":[-1,0],"D<>":[-1,0],"E<>":[-1,0],"FJ":[-1,0],"Fa":[-3,0],"Fd":[-2,0],"Ff":[-1,0],"Fg":[-2,0],"Fj":[-4,0],"Fp":[-2,0],"Fq":[-2,0],"Fs":[-2,0],"Ft":[-1,0],"Fv":[-2,0],"Fx":[-2,0],"Fy":[-2,0],"Fz":[-2,0],"F<>":[-1,0],"G<>":[-1,0],"If":[-1,0],"Ig":[-1,0],"Iq":[-1,0],"Is":[-1,0],"It":[-1,0],"Iv":[-1,0],"Iy":[-1,0],"I<>":[-1,0],"JJ":[-1,0],"Ja":[-1,0],"Jd":[-1,0],"Jf":[-1,0],"Jg":[-1,0],"Jj":[-1,0],"Jp":[-1,0],"Jq":[-1,0],"Js":[-1,0],"Jt":[-1,0],"Jv":[-1,0],"Jx":[-1,0],"Jy":[-1,0],"Jz":[-1,0],"J<>":[-1,0],"Kf":[-1,0],"Kg":[-1,0],"Kq":[-2,0],"Ks":[-1,0],"Kt":[-1,0],"Kv":[-1,0],"Ky":[-1,0],"K<>":[-1,0],"LT":[-2,0],"LV":[-2,0],"LY":[-2,0],"Lf":[-1,0],"Lg":[-1,0],"Lq":[-4,0],"Ls":[-1,0],"Lt":[-1,0],"Lv":[-2,0],"Ly":[-1,0],"L<>":[-1,0],"O<>":[-1,0],"PJ":[-1,0],"Pa":[-1,0],"Pj":[-1,0],"P<>":[-1,0],"Q<>":[-1,0],"R<>":[-1,0],"S<>":[-1,0],"TJ":[-1,0],"Ta":[-2,0],"Td":[-2,0],"Tf":[-1,0],"Tg":[-2,0],"Tj":[-2,0],"Tp":[-2,0],"Tq":[-2,0],"Ts":[-2,0],"Tt":[-1,0],"Tv":[-2,0],"Tx":[-2,0],"Ty":[-2,0],"Tz":[-2,0],"T<>":[-1,0],"Xf":[-1,0],"Xg":[-1,0],"Xq":[-1,0],"Xs":[-1,0],"X<>":[-1,0],"YJ":[-1,0],"Ya":[-1,0],"Yd":[-1,0],"Yf":[-1,0],"Yg":[-1,0],"Yj":[-2,0],"Yq":[-1,0],"Ys":[-1,0],"Y<>":[-1,0],"Zf":[-1,0],"Zg":[-1,0],"Zq":[-1,0],"Zs":[-1,0],"Z<>":[-1,0],"bT":[-2,0],"bY":[-1,0],"bt":[-1,0],"b<>":[-1,0],"cT":[-2,0],"cY":[-1,0],"c<>":[-1,0],"eI":[-1,0],"eT":[-2,0],"eY":[-1,0],"e<>":[-1,0],"f<>":[-1,0],"hT":[-2,0],"hY":[-1,0],"ht":[-1,0],"h<>":[-1,0],"iT":[-1,0],"iV":[-1,0],"iY":[-1,0],"if":[-1,0],"ig":[-1,0],"iq":[-1,0],"is":[-1,0],"it":[-1,0],"iv":[-1,0],"iy":[-1,0],"i<>":[-1,0],"j<>":[-1,0],"kT":[-2,0],"kV":[-1,0],"kY":[-1,0],"kf":[-1,0],"kg":[-1,0],"kq":[-1,0],"ks":[-1,0],"kt":[-1,0],"kv":[-1,0],"ky":[-1,0],"k<>":[-1,0],"lT":[-1,0],"lV":[-1,0],"lY":[-1,0],"lf":[-1,0],"lg":[-1,0],"lq":[-1,0],"ls":[-1,0],"lt":[-1,0],"lv":[-1,0],"ly":[-1,0],"l<>":[-1,0],"pI":[-1,0],"pT":[-2,0],"pX":[-1,0],"pY":[-1,0],"pZ":[-1,0],"p<>":[-1,0],"rI":[-1,0],"rT":[-2,0],"rX":[-1,0],"rY":[-1,0],"rZ":[-1,0],"r<>":[-1,0],"sT":[-2,0],"sY":[-1,0],"ss":[-1,0],"st":[-1,0],"sv":[-1,0],"s<>":[-1,0],"tT":[-2,0],"t<>":[-1,0],"uT":[-2,0],"u<>":[-1,0],"vI":[-1,0],"vJ":[-1,0],"vT":[-2,0],"vZ":[-1,0],"va":[-1,0],"vj":[-1,0],"v<>":[-1,0],"xT":[-2,0],"xf":[-1,0],"x<>":[-1,0],"zT":[-2,0],"z<>":[-1,0],"<22>A":[-1,0],"<22>I":[-1,0],"<22>J":[-1,0],"<22>S":[-1,0],"<22>T":[-1,0],"<22>V":[-1,0],"<22>X":[-1,0],"<22>Y":[-1,0],"<22>Z":[-1,0],"<22>a":[-1,0],"<22>d":[-1,0],"<22>f":[-1,0],"<22>g":[-1,0],"<22>i":[-1,0],"<22>j":[-1,0],"<22>p":[-1,0],"<22>q":[-1,0],"<22>s":[-1,0],"<22>t":[-1,0],"<22>v":[-1,0],"<22>x":[-1,0],"<22>y":[-1,0],"<22>z":[-1,0],"<22><>":[-2,0]},"left":["BDEFHKLMNPRbhk","CGOQ","UWl","ceo","mnr","uw"],"right":["HMNd","UVW","amnq","go","wy"]}
datalen=2384
data=iVBORw0KGgoAAAANSUhEUgAAAFAAAABaCAYAAAAvitHLAAAAAXNSR0IArs4c6QAABrZJREFUeF7tW9F26zYMW/7/o3tPuiiHQUAClCwnTbuXrpZEiRAIwt56+e//f75uP8ePC/w+xvH5mOauz+JjnLgPxmYxqv1X15f4XA/KwLk+G0nEAzAA49y4WVzPAMku6RoD52cXx/aDu3/6FfNdOj8DMAMUE4usqQBSBxwgOJfJwFHVEdcwMqjzleN46DFZBa1uOUsoYzJjuyrhzjiTmYr9jChMBr5jRADjwlkAHTZUJTS73in76mIdiaE67ZbNTGKdEmeMdjVUaXjVoKJ8ZPNaJewmjQlXAHfY7IDBGLyTgRLAsk03LA6CWumUskOrGpW5haoRxvPb+1f2QNmBv3HwWzOdlemGskFYEqoCUKeq9V1mo8Wp1tMxl4GqicTxLoDMOqG1Gc0u/mR6zcCNF9QGKCBMYx8BoAteppGZ92TsyNiXdWwXvEwb8QxP8xwAFfscLUSQbZGG4LMMW5Gn0ga9C4BR51zDi4k5LGJAugSh8xwAHYY5N1zZnA6AlS9z5ADPsR1AdwMHxKoJxOSRTQgMNpk4Pytz93wtljoM3A3gkTZmAHkkiGX+DoCrJfzR638agEdUgyrlFibMP+2wCkexUJn0bB8H+Jmyf/p0XlkB5xBHAdURcudcak4F3lgbz3RnKX5QZZNYgFnPtQKwAmE29lLc6S+xjdMecQFLSRpnreJLBkYTi/8e93Y2aQmwkdiYsrq3cwHZHAvARi50qnPAWYFXsdV49Jnqgp1YD3mogA6w7U0hqFqvxtUZV9eX8Y8AUCXw0ePVdzSmf+NZ93MU6ghrXtQm3B521quzYQ5Ok0v3x0QYI9EjYUmwEolrzh5X58WKUCVenp/dlnqmAFTjrOujr9x9Aa67yBrQ/XwZ3av/dsCSHc9GYAYA3nyUj2zM6aAuw939W5gcYaRjAhWAmVy4AHQvFS+osz5jaNTC73juJlUnVSU7A9CPKmElouptQK0/G8CXNpEO01yb4wL4ahtTeWLLxny04d2VXPycpUQ+M9GxUzIWuQzsiHxHI9n5DjPyDoCOlah0kjWZ1e7fAXDmAu34ZwOIAu9cDlqHrOujq6gchg2Q+p/wI4ArZtZhIBpw1d3ZuPKZajzGPATgMxl4BoCM0W4JZy6gfFE4AkCnHPBVL3P6rFm6AKgm2Bmv3kQGZvc3EXVApVMdAEesd28i1QU/6LjDwNREhl2e3hHJmGJApsHqgtW4a2NcI/3EwF0e81fEzbpw9kmHmWlkKM5RDHmXcVUBLPeHv1SqSowBmoHsPHd08xCboXwcKZPMZ9ISdzWw0gfl53YzDJucMuts3PGx0wAqEX4nAB2vmQHILlo5kKc/NqR1DjTvbnQGA/GSGVuyc88Q4A4JlnBF79mNFIDsljONZK9q0VtWIO0Yo00EQWS/s1LpMLOjUzEuA3DH+Soj/VCQThNZ1UB3faU3DMRYEc6bjbrgaRvzKwzvriQzBjIKqwbj6CfLQ4m7yn11PcZvxXMAVM3D6YAVCK0Dk0Cr65cBlF7ntoPSkPjm4BhvW6jFH307AI45qooyLNL11evS0s2oulsYR8AwOXQIHRsVj2W9SjrdyynhBTyspRVICiDFUGWDyvg/AcClBJOPCSgfFQ7s8u4sd76cvJqBOwCMMWfi3y/AAbAjwJVNyYyqU8NOCTP9wsvPmoiro0/ru93SSfZXzWG1j11MAeKIdCdm1mWzy1b7q/MvjWetuvNWoRJQ48ouqfVqfAkgtdgFsNLB3QkwRnbcA5pjRg6l80tGutOlMs90VAlXyTslPtZjF2bm2zbSpc+5+SjXJ7HXuS5DMw3MLkHFj+NbAESKu1bEuqEDjez48OFYLzTKA/yXAZgdKANflcjMm0D2saLDwOgLVwhwz8/9mNBtIko3s87LjG6mq24jUevVeCTJn5FWtqQ7/i5vIqoMu3mdNv8PwEWo4yf9GCrrdEyjSo24LXA0FFNxm4bSW2dc+cBUbyOAOKmTQOcAlU1iFeEAoHyqajjMK7KO/eQ6zgCww9AZAEd8lUv0gMyUZzpcXuBsCccDdBuA87qHPtJh0C4AGQHu+WebVtKavWq5DWkHgJmhR3Y6IDN2ovE/HcCqiUStcZtUpwTdEsdzMNY/nc9lzWKz/9zlHQArka1o72pkpXtvewNdALMu6ehGtVdZ4l9fXzj+Dejlcumcf8slZF2Y+boMJIdh1RzJvCuACBZ7tgUhEdRhlAJIjVfibOX8kwB0LAYm/Qeg+dV4VwlLFr47AzsMckqeAYKvQxK0B+f6AU1EOf0jbEwL1HeZ/HIb8C5AzJ7jH4LivYj9MkczAAAAAElFTkSuQmCC
width=8
height=9
tracking=1
0 6
1 4
2 6
3 6
4 6
5 6
6 6
7 6
8 6
9 6
space 4
! 3
" 6
# 6
$ 6
% 6
& 6
' 3
( 4
) 4
* 6
+ 6
, 3
- 6
. 2
/ 5
: 2
; 3
< 5
= 5
> 5
? 6
@ 6
A 6
B 6
C 6
D 6
E 6
F 6
G 6
H 6
I 4
J 6
K 6
L 6
M 6
N 6
O 6
P 6
Q 6
R 6
S 6
T 6
U 6
V 6
W 6
X 6
Y 6
Z 6
[ 4
\ 5
] 4
^ 5
_ 6
` 3
a 6
b 6
c 6
d 6
e 6
f 6
g 6
h 6
i 3
j 6
k 6
l 3
m 6
n 6
o 6
p 6
q 6
r 6
s 6
t 6
u 6
v 6
w 6
x 6
y 6
z 6
{ 4
| 2
} 4
~ 6
<EFBFBD> 8
Fc -2
Fe -2
Fo -2
Fm -2
Fn -2
Fr -2
Fu -2
Fw -2
Jc -1
Je -1
Jo -1
Jm -1
Jn -1
Jr -1
Ju -1
Jw -1
Tc -2
Te -2
To -2
Tm -2
Tn -2
Tr -2
Tu -2
Tw -2
Yc -1
Ye -1
Yo -1
Ym -1
Yn -1
Yr -1
<EFBFBD>B -1
<EFBFBD>D -1
<EFBFBD>E -1
<EFBFBD>F -1
<EFBFBD>H -1
<EFBFBD>K -1
<EFBFBD>L -1
<EFBFBD>M -1
<EFBFBD>N -1
<EFBFBD>P -1
<EFBFBD>R -1
<EFBFBD>b -1
<EFBFBD>h -1
<EFBFBD>k -1
<EFBFBD>C -1
<EFBFBD>G -1
<EFBFBD>O -1
<EFBFBD>Q -1
<EFBFBD>U -1
<EFBFBD>W -1
<EFBFBD>l -1
<EFBFBD>c -1
<EFBFBD>e -1
<EFBFBD>o -1
<EFBFBD>m -1
<EFBFBD>n -1
<EFBFBD>r -1
<EFBFBD>u -1
<EFBFBD>w -1
H<EFBFBD> -1
M<EFBFBD> -1
N<EFBFBD> -1
d<EFBFBD> -1
U<EFBFBD> -1
V<EFBFBD> -1
W<EFBFBD> -1
aT -2
aY -1
a<EFBFBD> -1
mT -2
mY -1
m<EFBFBD> -1
nT -2
nY -1
n<EFBFBD> -1
qT -2
qY -1
q<EFBFBD> -1
gT -2
gY -1
g<EFBFBD> -1
oT -2
oY -1
o<EFBFBD> -1
wT -2
w<EFBFBD> -1
yT -2
y<EFBFBD> -1
A<EFBFBD> -1
B<EFBFBD> -1
C<EFBFBD> -1
DI -1
DT -1
D<EFBFBD> -1
E<EFBFBD> -1
FJ -1
Fa -3
Fd -2
Ff -1
Fg -2
Fj -4
Fp -2
Fq -2
Fs -2
Ft -1
Fv -2
Fx -2
Fy -2
Fz -2
F<EFBFBD> -1
G<EFBFBD> -1
If -1
Ig -1
Iq -1
Is -1
It -1
Iv -1
Iy -1
I<EFBFBD> -1
JJ -1
Ja -1
Jd -1
Jf -1
Jg -1
Jj -1
Jp -1
Jq -1
Js -1
Jt -1
Jv -1
Jx -1
Jy -1
Jz -1
J<EFBFBD> -1
Kf -1
Kg -1
Kq -2
Ks -1
Kt -1
Kv -1
Ky -1
K<EFBFBD> -1
LT -2
LV -2
LY -2
Lf -1
Lg -1
Lq -4
Ls -1
Lt -1
Lv -2
Ly -1
L<EFBFBD> -1
O<EFBFBD> -1
PJ -1
Pa -1
Pj -1
P<EFBFBD> -1
Q<EFBFBD> -1
R<EFBFBD> -1
S<EFBFBD> -1
TJ -1
Ta -2
Td -2
Tf -1
Tg -2
Tj -2
Tp -2
Tq -2
Ts -2
Tt -1
Tv -2
Tx -2
Ty -2
Tz -2
T<EFBFBD> -1
Xf -1
Xg -1
Xq -1
Xs -1
X<EFBFBD> -1
YJ -1
Ya -1
Yd -1
Yf -1
Yg -1
Yj -2
Yq -1
Ys -1
Y<EFBFBD> -1
Zf -1
Zg -1
Zq -1
Zs -1
Z<EFBFBD> -1
bT -2
bY -1
bt -1
b<EFBFBD> -1
cT -2
cY -1
c<EFBFBD> -1
eI -1
eT -2
eY -1
e<EFBFBD> -1
f<EFBFBD> -1
hT -2
hY -1
ht -1
h<EFBFBD> -1
iT -1
iV -1
iY -1
if -1
ig -1
iq -1
is -1
it -1
iv -1
iy -1
i<EFBFBD> -1
j<EFBFBD> -1
kT -2
kV -1
kY -1
kf -1
kg -1
kq -1
ks -1
kt -1
kv -1
ky -1
k<EFBFBD> -1
lT -1
lV -1
lY -1
lf -1
lg -1
lq -1
ls -1
lt -1
lv -1
ly -1
l<EFBFBD> -1
pI -1
pT -2
pX -1
pY -1
pZ -1
p<EFBFBD> -1
rI -1
rT -2
rX -1
rY -1
rZ -1
r<EFBFBD> -1
sT -2
sY -1
ss -1
st -1
sv -1
s<EFBFBD> -1
tT -2
t<EFBFBD> -1
uT -2
u<EFBFBD> -1
vI -1
vJ -1
vT -2
vZ -1
va -1
vj -1
v<EFBFBD> -1
xT -2
xf -1
x<EFBFBD> -1
zT -2
z<EFBFBD> -1
<EFBFBD>A -1
<EFBFBD>I -1
<EFBFBD>J -1
<EFBFBD>S -1
<EFBFBD>T -1
<EFBFBD>V -1
<EFBFBD>X -1
<EFBFBD>Y -1
<EFBFBD>Z -1
<EFBFBD>a -1
<EFBFBD>d -1
<EFBFBD>f -1
<EFBFBD>g -1
<EFBFBD>i -1
<EFBFBD>j -1
<EFBFBD>p -1
<EFBFBD>q -1
<EFBFBD>s -1
<EFBFBD>t -1
<EFBFBD>v -1
<EFBFBD>x -1
<EFBFBD>y -1
<EFBFBD>z -1
<EFBFBD><EFBFBD> -2

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,105 @@
--metrics={"baseline":5,"xHeight":0,"capHeight":0,"pairs":{},"left":[],"right":[]}
datalen=1708
data=iVBORw0KGgoAAAANSUhEUgAAAEYAAABQCAYAAACkoQMCAAAAAXNSR0IArs4c6QAABLlJREFUeF7tW9Fy2zAMW/7/o7PLVvVoGSBAym6dnPuSayRRJEgRsNw+/vz/eX59Pr4+48drDH2frcvsZbbHujFn3pfZ7a6jMbw2HoGjTV3AGHjo+/jdPK6SwBKkwB7rsv02YwOYl+EIklsxA3E3szFDqCpi5pnN4Sso7u8kz2MqwTtfZjBUhtGGWRazCmCgjj3s7IZ2oFqBXZGxxFgmsmMSgYpOHdFjWJBVP50eurPpnFlUsh//3Q0MSfENTBMYp1kpqq409CgdMu2kmqxLEjQ+VTFdYGbBNTe3jJarbNWZL+XICjCqAbPsK8ZyWTDTMzLwMAHup4BRwbNxVTGMQrsVmvnZ0lIKGGXUcQgJNaR645FQVaP8Pr3HdCtGrVsBXNk+ZLyK/CGbvoORG5hEx2TXAL+V3DOOWsnmykPkmaBVROHww2E01JQhEcT7GDRBCTGHrqvHtZRZIzste1ermFYQC+DQxDsXVY5WMXz7ntIp+ahxsipduTTb2K2WeUVqV8BanXt4pa0AsxrMpdffwJg6Bk3LnoY7Y4rpmM1sXXds9K4dI7P3LUgboIdBtj4TjWePIa1SvfTavGFUbPHacH4TEHVQZQyKqvDyj1VulojZv5jcbAzGoCqmS9XxOPx0pXUrZuPnrGOqGiHrByq71Qx3+4iichjDzUoJK11aT/yWc3fFmDqmcj9LNcDELlnzRY1y9J757Kt7o47+iTFsisR5iFTNCz3gjTVorZIF0acZjAgakgeZL6UxdR+DjCmNkVWSsjcDiqoEVcbhonGlYo5wRmkOtkdVGylBuatiBUymHej5NHqMclQ9krAjirSRagXw2N+sdOuYmiK6K0boGHbmlVZxekW1Ua7ScEWLMe2z+xPWihjLqPcoxmL+VMBGjTz77t+YYqWMec4EpioQs/mun5tDNQu86usHRoVOxWSqmAVaBcwVlLtOoyrG0THZtaHTg5jIU8dajcfjkvmBtA/954kat33g7Juub4FXK2t150t5/msb9RyCvOmsUU3UjdreWwHjUJ29mQkma/gOEcBGGv5RDY1Du87rk2rgTvZWaB4lK/PRkQ47m0x+x+DOAIaB1wpi8UUdPDUKGNVjnOqozrnUUao6//Hzz9IxMeusIV4a3LOAuXTQjnMOKzmNkj3vVNe67OLEtjTH1THoIUzpio5jXWCyo6v8hAQD/zYkRHQGfXZFowMaupZoxaAqpmVU6AoFTKZesyuO7A0maxk0PgXMCIJJaWdDdKSU8kXjTsWMvVjAzO4uvgorHamAj7TV6WVyjQJGNS65AZhweVDeUnh1MtFZoyqmY1OteZuKUccle6jLmrd6GERJWWXB0+h6zqZyNKPWFdpFlK58YXTdYlbn9UmXkplDLu2yJGWUG4+xulKZqX1j13nhpo4S0ynoMQLpjHl9drQdUDNA7Sp2BJ4TjGq47zAOK8Zhp7dgk2IGaHU6gBT3+ozpDjAD1XmuOu+ZgES0eilE5+aLglEPfCwgtQ6OP5/PWN7/bD8eDyeBhwKrKI1VC9IZjF1KQb2AiUDMvx8afWLMudpUma9WTBrblYCZSxf1ksoRy5SmTPiVgJHO/uSEK/aYn4z/8nuVGuPloznQwb/SelBv0W6ASwAAAABJRU5ErkJggg==
width=7
height=8
tracking=1
0 4
1 2
2 4
3 3
4 4
5 4
6 4
7 4
8 4
9 4
space 3
! 1
" 3
# 5
$ 4
% 3
& 5
' 2
( 2
) 2
* 4
+ 3
, 2
- 3
. 1
/ 3
: 1
; 2
< 3
= 3
> 3
? 4
@ 4
A 4
B 4
C 4
D 4
E 3
F 3
G 4
H 4
I 3
J 4
K 4
L 3
M 5
N 4
O 4
P 4
Q 4
R 4
S 4
T 3
U 4
V 4
W 5
X 5
Y 4
Z 3
[ 2
\ 3
] 2
^ 3
_ 4
` 2
a 4
b 4
c 3
d 4
e 4
f 2
g 4
h 4
i 1
j 2
k 3
l 1
m 5
n 4
o 4
p 4
q 4
r 3
s 4
t 2
u 4
v 4
w 5
x 4
y 4
z 4
{ 3
| 1
} 3
~ 4
<EFBFBD> 7

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@@ -1,5 +0,0 @@
-- These are example strings.
"menuResumeGame" = "Resume"
"menuNewGame" = "New Game"
"menuOptions" = "Options"
"menuCredits" = "Credits"

View File

@@ -1,5 +0,0 @@
-- These are example strings.
"menuResumeGame" = "サイカイ "
"menuNewGame" = "アタラシイゲーム"
"menuOptions" = "セッテイ"
"menuCredits" = "クレジット"

View File

@@ -1,26 +0,0 @@
title = 'Noble Engine API reference'
project = 'Noble Engine'
description = 'A li\'l game engine for Playdate.'
format = 'markdown'
no_lua_ref = true
wrap = true
no_space_before_args = true
backtick_references = true
dir = '../../.docs'
file = {
'../../',
exclude = {
'../../.lua',
'../../.luarocks',
'../../.docs'
}
}
style = "."
template = "."
examples = "../../templates"

View File

@@ -1,524 +0,0 @@
@import url(https://fonts.googleapis.com/css?family=Quicksand:300,700);
@import url(https://fonts.googleapis.com/css?family=Lato);
@import url(https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@200;300;400;600;700;900&display=swap);
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body {
margin: 2em;
font-family: "Lato", arial, helvetica, geneva, sans-serif;
background-color: #ffcb1f;
color: #31302f;
}
code,
tt {
font-family: "Source Code Pro", monospace;
font-size: 1.1em;
letter-spacing: -1px;
font-weight: 600;
color: #056d8d;
}
span.types:before {
content: ": ";
}
span.types:after {
content: "";
}
.type,
.default,
.optional {
color: #74726e;
}
.default .value {
font-weight: bold;
}
.parameters {
list-style-type: none;
}
.parameters li {
margin-bottom: 10px;
line-height: 1.5em;
}
.parameter {
font-weight: 600;
color: #045771;
}
body, td, th {
font-size: .95em;
line-height: 1.2em;
}
p, ul {
margin: 10px 0 0 0px;
}
ul {
padding-left: 25px;
}
strong {
font-weight: bold;
}
em {
font-style: italic;
}
.logo {
width: 100%;
background-image: url("logo.png");
background-repeat: no-repeat;
background-position: center;
height: 150px;
}
.logo h1 {
display: none;
}
h1 {
font-family: 'Quicksand', sans-serif;
font-weight: bold;
color: #cf5a5a;
font-size: 2.5em;
margin: 20px 0 30px 0;
}
h2, h3, h4 {
font-family: 'Quicksand', sans-serif;
font-weight: 700;
margin: 15px 0 10px 0;
}
h2 {
font-size: 1.25em;
color: #cf5a5a;
}
h3 {
font-size: 1.15em;
}
h4 {
font-size: 1em;
}
.section-header {
margin-top: 50px;
padding: 10px;
padding-left: 15px;
margin-left: -25px;
border-radius: 50px;
border-left: 20px solid #cf5a5a;
background-color: #e9cfc8;
color: #31302f;
}
a:link {
font-weight: bold;
color: #cf5a5a;
text-decoration: none;
}
a:visited {
font-weight: bold;
color: #cf5a5a;
text-decoration: none;
}
a:link:hover {
text-decoration: underline;
}
hr {
background: #cf5a5a;
border-radius: 100px;
height: 6px;
margin: 60px 20%;
border: none;
}
blockquote {
margin-left: 3em;
}
ul {
list-style-type: none;
}
p.name {
font-family: "Andale Mono", monospace;
padding-top: 1em;
}
span.item-name {
background-color: #fbd350;
display: inline-block;
color: #31302f;
padding: 10px 20px;
border-radius: 25px;
border: 2px solid #bf9817;
font-size: 1em;
font-family: "Source Code Pro", monospace;
font-weight: 700;
letter-spacing: -1px;
}
pre {
background-color: #056d8d;
border: 2px solid #03475c;
-webkit-box-shadow: 0 0 10px 0 rgba(49, 48, 47, 0.5);
box-shadow: 0 0 10px 0 rgba(49, 48, 47, 0.5);
border-radius: 15px;
color: #f0ece3;
padding: 15px 20px;
margin: 10px 0 10px 0;
font-family: "Source Code Pro", monospace;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
overflow-x: auto;
width: 100%;
font-weight: 400;
}
pre .keyword {
color: #ffcb1f;
}
pre .string, pre .number {
color: #eb6e6e;
font-weight: bold;
}
pre .comment {
color: #b4b1aa;
}
pre.example {
font-size: .85em;
}
table.index td {
text-align: left;
vertical-align: top;
}
#container {
margin-left: auto;
margin-right: auto;
border-radius: 25px;
-webkit-box-shadow: 0 0 25px 0 rgba(49, 48, 47, 0.3);
box-shadow: 0 0 25px 0 rgba(49, 48, 47, 0.3);
overflow: hidden;
max-width: 1600px;
}
#product {
text-align: center;
height: 500px;
background-color: #31302f;
color: #f0ece3;
}
#product > :before {
content: 'Noble Engine';
}
#product big {
font-size: 2em;
}
#main {
background-color: #31302f;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
}
#navigation {
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
-ms-flex-negative: 0;
flex-shrink: 0;
-ms-flex-preferred-size: auto;
flex-basis: auto;
width: 275px;
padding: 0 10px;
overflow: hidden;
color: #f0ece3;
}
#navigation a:link, #navigation a:visited {
font-weight: normal;
}
#navigation .nav-module,
#navigation .nav-modules {
color: #31302f;
padding: 15px;
border-radius: 20px;
}
#navigation .nav-module a:link, #navigation .nav-module a:visited,
#navigation .nav-modules a:link,
#navigation .nav-modules a:visited {
color: #31302f;
}
#navigation .nav-module ul a:active, #navigation .nav-module ul a:hover, #navigation .nav-module ul .selected,
#navigation .nav-modules ul a:active,
#navigation .nav-modules ul a:hover,
#navigation .nav-modules ul .selected {
color: #f0ece3;
background-color: #cf5a5a;
padding: 5px 10px;
margin-left: -10px;
border-radius: 30px;
text-decoration: none;
}
#navigation .nav-module ul .selected,
#navigation .nav-modules ul .selected {
line-height: 2em;
margin-left: -28px;
padding-left: 28px;
border-radius: 0 30px 30px 0;
font-weight: bold;
}
#navigation .nav-module {
background-color: #eb6e6e;
margin: 0 -10px 20px 10px;
border-radius: 20px 0 0 20px;
}
#navigation .nav-module h2 {
background-color: #cf5a5a;
color: #f0ece3;
margin: 0;
}
#navigation .nav-module ul a:active, #navigation .nav-module ul a:hover {
color: #31302f;
background-color: #ffcb1f;
}
#navigation .nav-modules {
background-color: #f3e5bc;
margin: 0 10px 30px 10px;
padding-top: 5px;
}
#navigation h1 {
color: #eb6e6e;
line-height: 80%;
font-family: 'Quicksand', sans-serif;
font-weight: 900;
font-size: 32px;
padding-left: 20px;
padding-bottom: 20px;
}
#navigation h2 {
color: #31302f;
font-size: 1.1em;
background-color: #f0ece3;
padding: 5px 10px;
margin-right: 20px;
border-radius: 30px;
text-decoration: none;
}
#navigation ul {
font-size: 1em;
list-style-type: none;
margin: 1px 1px 10px 1px;
padding-left: 0px;
}
#navigation li {
display: block;
margin: 0px 0px 6px 12px;
padding-left: 0px;
}
#navigation li li a {
margin: 0px 3px 0px -1em;
}
#content {
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
-ms-flex-negative: 1;
flex-shrink: 1;
-ms-flex-preferred-size: auto;
flex-basis: auto;
min-width: 0;
padding: 2em;
padding-left: 3.5em;
border-left: 4px solid #cf5a5a;
-webkit-box-shadow: inset 0 0 50px 0 rgba(207, 90, 90, 0.25);
box-shadow: inset 0 0 50px 0 rgba(207, 90, 90, 0.25);
background-color: #f0ece3;
}
#about {
clear: both;
padding: 20px;
border-top: 2px solid #31302f;
background-color: #cf5a5a;
color: #f0ece3;
}
#about a:link, #about a:visited, #about a:hover, #about a:active {
color: #ffcb1f;
}
@media print {
body {
font: 12pt "Times New Roman", "TimeNR", Times, serif;
}
a {
font-weight: bold;
color: #1c4e68;
text-decoration: underline;
}
#main {
background-color: #ffffff;
border-left: 0px;
}
#container {
margin-left: 2%;
margin-right: 2%;
background-color: #ffffff;
}
#content {
padding: 1em;
background-color: #ffffff;
}
#navigation {
display: none;
}
pre.example {
font-family: "Andale Mono", monospace;
font-size: 10pt;
page-break-inside: avoid;
}
}
table.module_list {
border-width: 1px;
border-style: solid;
border-color: #b1e3fa;
border-collapse: collapse;
}
table.module_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #b1e3fa;
}
table.module_list td.name {
background-color: #e0f4fc;
min-width: 200px;
}
table.module_list td.summary {
width: 100%;
}
table.function_list {
border-width: 1px;
border-style: solid;
border-color: #b1e3fa;
border-collapse: collapse;
}
table.function_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #b1e3fa;
}
table.function_list td.name {
background-color: #e0f4fc;
min-width: 200px;
}
table.function_list td.summary {
width: 100%;
}
ul.nowrap {
overflow: auto;
white-space: nowrap;
}
dl.table dt,
dl.function dt {
padding-top: 1em;
}
dl.table dd dd,
dl.function dd {
padding-bottom: 30px;
margin: 10px 0 10px 20px;
border-bottom: 2px dotted #056d8d;
}
dl.table dd > :last-child,
dl.function > :last-child {
border-bottom: none;
}
dl.table h3,
dl.function h3 {
font-size: .95em;
}
/* stop sublists from having initial vertical space */
ul ul {
margin-top: 0px;
}
ol ul {
margin-top: 0px;
}
ol ol {
margin-top: 0px;
}
ul ol {
margin-top: 0px;
}
/* make the target distinct; helps when we're navigating to a function */
a:target + * {
border: 2px solid #31302f;
border-bottom: 6px solid #31302f;
background-color: #cf5a5a;
color: #f0ece3;
}
/*# sourceMappingURL=ldoc.css.map */

File diff suppressed because one or more lines are too long

View File

@@ -1,299 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=$(ldoc.doc_charset)"/>
<head>
<title>$(ldoc.title)</title>
<link rel="stylesheet" href="$(ldoc.css)" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
# local no_spaces = ldoc.no_spaces
# local use_li = ldoc.use_li
# local display_name = ldoc.display_name
# local iter = ldoc.modules.iter
# local function M(txt,item) return ldoc.markup(txt,item,ldoc.plain) end
# --local nowrap = ldoc.wrap and '' or 'nowrap'
<!-- Menu -->
<div id="navigation">
<a href="../$(ldoc.output).html"><div class="logo">
<h1>$(ldoc.project)</h1>
</div></a>
# --------- contents of module -------------
# if module and not ldoc.no_summary and #module.items > 0 then
<div class="nav-module">
<h2>$(module.name)</h2>
<ul>
# for kind, items in module.kinds() do
# kind = kind:gsub("modules.", ""):gsub(" Functions", ""):gsub("%.", "\u{200B}.")
<h3>$(kind)</h3>
<ul>
# for item in items() do
# local subName = item.name
# if (item.name:sub(1, #module.name) == module.name) then
# subName = item.name:sub(#module.name+1, #item.name)
# elseif (module.name == "Noble") then
# subName = "." .. item.name
# end
<li><a href="#$(item.name)">$(subName)</a></li>
# end
</ul>
# end
</ul>
</div>
# end
# -------- contents of project ----------
# local this_mod = module and module.name
<div class="nav-modules">
# for kind, mods, type in ldoc.kinds() do
<div class="nav-kind">
# if ldoc.allowed_in_contents(type,module) then
<h3>$(kind)</h3>
<ul>
# for mod in mods() do
# local name = display_name(mod)
# if mod.name == this_mod then
<li><span class="selected">$(name)</span></li>
# else
<li><a href="$(ldoc.ref_to_module(mod))">$(name)</a></li>
# end
# end
</ul>
# end
</div>
# end
</div>
</div>
<div id="content">
# if ldoc.body then -- verbatim HTML as contents; 'non-code' entries
$(ldoc.body)
# elseif module then -- module documentation
<h1>$(module.name)</h1>
<p>$(M(module.summary,module))</p>
<p>$(M(module.description,module))</p>
# if module.tags.include then
$(M(ldoc.include_file(module.tags.include)))
# end
# if module.see then
# local li,il = use_li(module.see)
<h3>See</h3>
<ul>
# for see in iter(module.see) do
$(li)<a href="$(ldoc.href(see))">$(see.label)</a>$(il)
# end
</ul>
# end
# if module.usage then
# local li,il = use_li(module.usage)
<h3>Usage</h3>
# for usage in iter(module.usage) do
<pre class="example">$(ldoc.escape(usage))</pre>
# end
# end
# if module.info then
<h3>Info</h3>
<ul>
# for tag, value in module.info:iter() do
<li><strong>$(tag)</strong>: $(M(value,module))</li>
# end
</ul>
# end
<hr/>
# --- currently works for both Functions and Tables. The params field either contains
# --- function parameters or table fields.
# local show_return = not ldoc.no_return_or_parms
# local show_parms = show_return
# for kind, items in module.kinds() do
# local kitem = module.kinds:get_item(kind)
# local has_description = kitem and ldoc.descript(kitem) ~= ""
# kind = kind:gsub("modules.", ""):gsub(" Functions", "")
<h2 class="section-header $(has_description and 'has-description')"><a name="$(no_spaces(kind))"></a>$(kind)</h2>
<!-- $(M(module.kinds:get_section_description(kind),nil)) -->
# if kitem then
# if has_description then
<div class="section-description">
$(M(ldoc.descript(kitem),kitem))
</div>
# end
# if kitem.usage then
<h3>Usage</h3>
<pre class="example">$(ldoc.prettify(kitem.usage[1]))</pre>
# end
# end
<dl class="function">
# for item in items() do
<dt>
<a name = "$(item.name)"></a>
<span class="item-name">$(display_name(item))<span>
# if ldoc.prettify_files and ldoc.is_file_prettified[item.module.file.filename] then
<a style="float:right;" href="$(ldoc.source_ref(item))">line $(item.lineno)</a>
# end
</dt>
<dd>
$(M(ldoc.descript(item),item))
# if ldoc.custom_tags then
# for custom in iter(ldoc.custom_tags) do
# local tag = item.tags[custom[1]]
# if tag and not custom.hidden then
# local li,il = use_li(tag)
<h3>$(custom.title or custom[1])</h3>
<ul>
# for value in iter(tag) do
$(li)$(custom.format and custom.format(value) or M(value))$(il)
# end
# end
</ul>
# end
# end
# if show_parms and item.params and #item.params > 0 then
# local subnames = module.kinds:type_of(item).subnames
# if subnames then
<h3>$(subnames)</h3>
# end
<ul class="parameters">
# for parm in iter(item.params) do
# local param,sublist = item:subparam(parm)
# if sublist then
<li><span class="parameter">$(sublist)</span>$(M(item.params.map[sublist],item))
<ul>
# end
# for p in iter(param) do
# local name,tp,def = item:display_name_of(p), ldoc.typename(item:type_of_param(p)), item:default_of_param(p)
<li><span class="parameter">$(name)</span>
# if tp ~= '' then
<span class="types">$(tp)</span>
# end
# if def == true then
<span class="optional">(optional)</span>
# elseif def then
<span class="default">= <span class="value">$(def)</span> (default)</span>
# end
# if item:readonly(p) then
<em>readonly</em>
# end
<br/>
$(M(item.params.map[p],item))
</li>
# end
# if sublist then
</ul>
</li>
# end
# end
</ul>
# end
# if show_return and item.retgroups then local groups = item.retgroups
<h3>Returns</h3>
# for i,group in ldoc.ipairs(groups) do local li,il = use_li(group)
<ol>
# for r in group:iter() do local type, ctypes = item:return_type(r); local rt = ldoc.typename(type)
$(li)
# if rt ~= '' then
<span class="types">$(rt)</span>
# end
$(M(r.text,item))$(il)
# if ctypes then
<ul>
# for c in ctypes:iter() do
<li><span class="parameter">$(c.name)</span>
<span class="types">$(ldoc.typename(c.type))</span>
$(M(c.comment,item))
</li>
# end
</ul>
# end
# end
</ol>
# if i < #groups then
<h3>Or</h3>
# end
# end
# end
# if show_return and item.raise then
<h3>Raises</h3>
$(M(item.raise,item))
# end
# if item.see then
# local li,il = use_li(item.see)
<h3>See</h3>
<ul>
# for see in iter(item.see) do
$(li)<a href="$(ldoc.href(see))">$(see.label)</a>$(il)
# end
</ul>
# end
# if item.usage then
# local li,il = use_li(item.usage)
<h3>Usage</h3>
# for usage in iter(item.usage) do
<pre class="example">$(ldoc.prettify(usage))</pre>
# end
# end
</dd>
# end -- for items
</dl>
# end
# else -- if module; project-level contents
# if ldoc.description then
<h2>$(M(ldoc.description,nil))</h2>
# end
# if ldoc.full_description then
<p>$(M(ldoc.full_description,nil))</p>
# end
# for kind, mods in ldoc.kinds() do
<h2>$(kind)</h2>
# kind = kind:lower()
<table class="module_list">
# for m in mods() do
<tr>
<td class="name" $(nowrap)><a href="$(no_spaces(kind))/$(m.name).html">$(m.name)</a></td>
<td class="summary">$(M(ldoc.strip_header(m.summary),m))</td>
</tr>
# end
</table>
# end
# end -- if module
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc $(ldoc.version)</a>.
# if not module then
Last updated $(ldoc.updatetime)
# end
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,443 +0,0 @@
@import url(https://fonts.googleapis.com/css?family=Quicksand:300,700);
@import url(https://fonts.googleapis.com/css?family=Lato);
@import url(https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@200;300;400;600;700;900&display=swap);
$red: #cf5a5a;
$redBright: #eb6e6e;
$yellow: #ffcb1f;
$blue: #056d8d;
$white:#f0ece3;
$black:#31302f;
* {
box-sizing: border-box;
}
body {
margin: 2em;
font-family: "Lato", arial, helvetica, geneva, sans-serif;
background-color: $yellow;
color: $black;
}
code,
tt {
font-family: "Source Code Pro", monospace;
font-size: 1.1em;
letter-spacing: -1px;
font-weight: 600;
color: $blue;
}
span.types:before { content:": "; }
span.types:after { content:""; }
.type,
.default,
.optional {
color: ($black * 0.65) + ($white *0.35);
}
.default .value { font-weight: bold; }
.parameters {
list-style-type: none;
li {
margin-bottom: 10px;
line-height: 1.5em;
}
}
.parameter {
font-weight: 600;
color: $blue * 0.8;
}
body, td, th { font-size: .95em; line-height: 1.2em;}
p, ul { margin: 10px 0 0 0px;}
ul {
padding-left: 25px;
}
strong { font-weight: bold;}
em { font-style: italic;}
.logo {
h1 {
display: none;
}
width: 100%;
background-image: url('logo.png');
background-repeat: no-repeat;
background-position: center;
height: 150px;
}
h1 {
font-family: 'Quicksand', sans-serif;
font-weight: bold;
color: $red;
font-size: 2.5em;
margin: 20px 0 30px 0;
}
h2, h3, h4 {
font-family: 'Quicksand', sans-serif;
font-weight: 700;
margin: 15px 0 10px 0; }
h2 { font-size: 1.25em; color: $red; }
h3 { font-size: 1.15em; }
h4 { font-size: 1em; }
.section-header {
margin-top: 50px;
padding: 10px;
padding-left: 15px;
margin-left: -25px;
border-radius: 50px;
border-left: 20px solid $red;
background-color: ($white * 0.8) + ($red * 0.20);
color: $black;
}
a:link { font-weight: bold; color: $red; text-decoration: none; }
a:visited { font-weight: bold; color: $red; text-decoration: none; }
a:link:hover { text-decoration: underline; }
hr {
background: $red;
border-radius: 100px;
height: 6px;
margin: 60px 20%;
border: none;
}
blockquote { margin-left: 3em; }
ul { list-style-type: none; }
p.name {
font-family: "Andale Mono", monospace;
padding-top: 1em;
}
span.item-name {
background-color: ($white*0.25) + ($yellow*0.75);
display: inline-block;
color: $black;
padding: 10px 20px;
border-radius: 25px;
border: 2px solid $yellow*0.75;
//border-bottom: none;
//border-bottom: 4px solid $red*0.75;
font-size: 1em;
font-family: "Source Code Pro", monospace;
font-weight: 700;
letter-spacing: -1px;
}
pre {
background-color: $blue;
border: 2px solid $blue*0.65;
box-shadow: 0 0 10px 0 rgba($black, 0.5);
border-radius: 15px;
color: $white;
padding: 15px 20px;
margin: 10px 0 10px 0;
//font-family: "Andale Mono", monospace;
font-family: "Source Code Pro", monospace;
//font-size: 20px !important;
tab-size: 4;
overflow-x: auto;
width: 100%;
font-weight: 400;
.keyword {
color: $yellow;
}
.string, .number {
color: $redBright;
font-weight: bold;
}
.comment {
color: $white*0.75;
}
}
pre.example {
font-size: .85em;
}
table.index td { text-align: left; vertical-align: top; }
#container {
margin-left: auto;
margin-right: auto;
border-radius: 25px;
box-shadow: 0 0 25px 0 rgba($black, .3);
overflow: hidden;
max-width: 1600px;
}
#product {
text-align: center;
height: 500px;
background-color: $black;
color: $white;
> :before{
content: 'Noble Engine';
}
}
#product big {
font-size: 2em;
}
#main {
background-color: $black;
display: flex;
flex-direction: row;
}
#navigation {
flex-grow: 1;
flex-shrink: 0;
flex-basis: auto;
width: 275px;
padding: 0 10px;
overflow: hidden;
color: $white;
a:link, a:visited {
font-weight: normal;
}
.nav-module,
.nav-modules {
color: $black;
padding: 15px;
a:link, a:visited {
color: $black;
}
border-radius: 20px;
ul {
a:active, a:hover, .selected {
color: $white;
background-color: $red;
padding: 5px 10px;
margin-left:-10px;
border-radius: 30px;
text-decoration: none;
}
.selected{
line-height: 2em;
margin-left: -28px;
padding-left: 28px;
border-radius: 0 30px 30px 0;
font-weight: bold;
}
}
}
.nav-module {
background-color: $redBright;
margin: 0 -10px 20px 10px;
border-radius: 20px 0 0 20px;
h2 {
background-color: $red;
color: $white;
margin: 0;
}
ul {
a:active, a:hover {
color: $black;
background-color: $yellow;
}
}
}
.nav-modules {
background-color: ($white*0.8) + ($yellow*0.2);
margin: 0 10px 30px 10px;
padding-top: 5px;
}
h1 {
color: $redBright;
line-height: 80%;
font-family: 'Quicksand', sans-serif;
font-weight: 900;
font-size: 32px;
padding-left: 20px;
padding-bottom: 20px;
}
h2 {
color: $black;
font-size:1.1em;
background-color: $white;
padding: 5px 10px;
margin-right: 20px;
border-radius: 30px;
text-decoration: none;
}
ul {
font-size:1em;
list-style-type: none;
margin: 1px 1px 10px 1px;
padding-left: 0px;
}
li {
//font-size: 14px;
display: block;
margin: 0px 0px 6px 12px;
padding-left: 0px;
}
li li a {
margin: 0px 3px 0px -1em;
}
}
#content {
flex-grow: 1;
flex-shrink: 1;
flex-basis: auto;
min-width: 0; // For pre elements...
//margin-left: 14em;
padding: 2em;
padding-left:3.5em;
border-left: 4px solid $red;
box-shadow: inset 0 0 50px 0 rgba($red, 0.25);
background-color: $white;
}
#about {
clear: both;
padding: 20px;
border-top: 2px solid $black;
background-color: $red;
color:$white;
a:link, a:visited, a:hover, a:active {
color: $yellow;
}
}
@media print {
body {
font: 12pt "Times New Roman", "TimeNR", Times, serif;
}
a { font-weight: bold; color: #1c4e68; text-decoration: underline; }
#main {
background-color: #ffffff;
border-left: 0px;
}
#container {
margin-left: 2%;
margin-right: 2%;
background-color: #ffffff;
}
#content {
padding: 1em;
background-color: #ffffff;
}
#navigation {
display: none;
}
pre.example {
font-family: "Andale Mono", monospace;
font-size: 10pt;
page-break-inside: avoid;
}
}
table.module_list {
border-width: 1px;
border-style: solid;
border-color: #b1e3fa;
border-collapse: collapse;
}
table.module_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #b1e3fa;
}
table.module_list td.name { background-color: #e0f4fc; min-width: 200px; }
table.module_list td.summary { width: 100%; }
table.function_list {
border-width: 1px;
border-style: solid;
border-color: #b1e3fa;
border-collapse: collapse;
}
table.function_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #b1e3fa;
}
table.function_list td.name { background-color: #e0f4fc; min-width: 200px; }
table.function_list td.summary { width: 100%; }
ul.nowrap {
overflow:auto;
white-space:nowrap;
}
dl.table dt,
dl.function dt {
padding-top: 1em;
}
dl.table dd,
dl.function {
dd {
padding-bottom: 30px;
margin: 10px 0 10px 20px;
border-bottom: 2px dotted $blue;
}
> :last-child {
border-bottom: none;
}
}
dl.table h3,
dl.function h3 {
font-size: .95em;
}
/* stop sublists from having initial vertical space */
ul ul { margin-top: 0px; }
ol ul { margin-top: 0px; }
ol ol { margin-top: 0px; }
ul ol { margin-top: 0px; }
/* make the target distinct; helps when we're navigating to a function */
a:target + * {
border: 2px solid $black;
border-bottom: 6px solid $black;
background-color: $red;
color: $white;
}

View File

@@ -1,485 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-module">
<h2>NobleScene</h2>
<ul>
<h3>Properties </h3>
<ul>
<li><a href="#noblescene.name">noblescene.name</a></li>
<li><a href="#noblescene.backgroundColor">noblescene.backgroundColor</a></li>
</ul>
<h3>Tables </h3>
<ul>
<li><a href="#noblescene.inputHandler">noblescene.inputHandler</a></li>
<li><a href="#noblescene.sprites">noblescene.sprites</a></li>
</ul>
<h3>Methods</h3>
<ul>
<li><a href="#noblescene:addSprite">noblescene:addSprite</a></li>
<li><a href="#noblescene:removeSprite">noblescene:removeSprite</a></li>
</ul>
<h3>Callbacks </h3>
<ul>
<li><a href="#noblescene:init">noblescene:init</a></li>
<li><a href="#noblescene:enter">noblescene:enter</a></li>
<li><a href="#noblescene:start">noblescene:start</a></li>
<li><a href="#noblescene:update">noblescene:update</a></li>
<li><a href="#noblescene:drawBackground">noblescene:drawBackground</a></li>
<li><a href="#noblescene:exit">noblescene:exit</a></li>
<li><a href="#noblescene:finish">noblescene:finish</a></li>
<li><a href="#noblescene:pause">noblescene:pause</a></li>
<li><a href="#noblescene:resume">noblescene:resume</a></li>
</ul>
</ul>
</div>
<div class="nav-modules">
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><span class="selected">NobleScene</span></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><a href="../modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>NobleScene</h1>
<p>An abstract scene class.</p>
<p> Do not copy this file as a template for your scenes. Instead, your scenes will extend this class.
See <a href="../examples/SceneTemplate.lua.html">templates/SceneTemplate.lua</a> for a blank scene that you can copy and modify for your own scenes.
If you are using <a href="http://github.com/NobleRobot/NobleEngine-ProjectTemplate">NobleEngine-ProjectTemplate</a>,
see <code>scenes/ExampleScene.lua</code> for an implementation example.</p>
<h3>Usage</h3>
<pre class="example">YourSceneName = {}
class(&quot;YourSceneName&quot;).extends(NobleScene)
local scene = YourSceneName
</pre>
<hr/>
<h2 class="section-header "><a name="Properties"></a>Properties </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "noblescene.name"></a>
<span class="item-name">noblescene.name<span>
</dt>
<dd>
The name of this scene. Optional.
If you do not set this value, it will take on the scene's <code>className</code>.
</dd>
<dt>
<a name = "noblescene.backgroundColor"></a>
<span class="item-name">noblescene.backgroundColor<span>
</dt>
<dd>
This is the background color of this scene.
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "noblescene.inputHandler"></a>
<span class="item-name">noblescene.inputHandler<span>
</dt>
<dd>
All scenes have a default inputHandler which is made active when the scene starts.
If you do not define your scene's <a href="../classes/NobleScene.html#noblescene.inputHandler">inputHandler</a>, it is <code>nil</code> and input is disabled when this scene
starts.
<h3>See</h3>
<ul>
<a href="../modules/Noble.Input.html#Noble.Input.setHandler">Noble.Input.setHandler</a>
</ul>
<h3>Usage</h3>
<pre class="example">YourSceneName.inputHandler = {
AButtonDown = <span class="keyword">function</span>()
// Your code here
<span class="keyword">end</span>,
AButtonHold = <span class="keyword">function</span>()
// Your code here
<span class="keyword">end</span>,
<span class="comment">-- ...
</span> <span class="comment">-- ...
</span>}
<span class="comment">-- OR...
</span><span class="comment">-- Use a non-scene-specific inputHandler, defined elsewhere.
</span>YourSceneName.inputHandler = somePreviouslyDefinedInputHandler
<span class="comment">-- OR...
</span><span class="comment">-- Reuse another scene's inputHandler.
</span>YourSceneName.inputHandler = SomeOtherSceneName.inputHandler</pre>
</dd>
<dt>
<a name = "noblescene.sprites"></a>
<span class="item-name">noblescene.sprites<span>
</dt>
<dd>
When you add a sprite to your scene, it is put in this table so the scene can keep track of it. </p>
<p> This is intended as <code>read-only</code>. You should not modify this table directly.
<h3>See</h3>
<ul>
<a href="../classes/NobleScene.html#noblescene:addSprite">addSprite</a>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Methods"></a>Methods</h2>
<!-- -->
<dl class="function">
<dt>
<a name = "noblescene:addSprite"></a>
<span class="item-name">noblescene:addSprite(__sprite)<span>
</dt>
<dd>
Use this to add sprites to your scene instead of <code>playdate.graphics.sprite:add()</code>. </p>
<p> If your sprite is a <a href="../classes/NobleSprite.html#">NobleSprite</a>, using <code>NobleSprite:add()</code> will also call this method.</p>
<p> Sprites added with this method that are tracked by the scene. Any not manually removed before transitioning to another scene are automatically removed in <a href="../classes/NobleScene.html#noblescene:finish">finish</a>.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__sprite</span>
<span class="types"><span class="type">playdate.graphics.sprite</span></span>
<br/>
The sprite to add to the scene.
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../classes/NobleSprite.html#noblesprite:add">NobleSprite:add</a></li>
<li><a href="../classes/NobleScene.html#noblescene:removeSprite">removeSprite</a></li>
</ul>
</dd>
<dt>
<a name = "noblescene:removeSprite"></a>
<span class="item-name">noblescene:removeSprite(__sprite)<span>
</dt>
<dd>
Use this to remove sprites from your scene instead of <code>playdate.graphics.sprite:remove()</code>. </p>
<p> If your sprite is a <a href="../classes/NobleSprite.html#">NobleSprite</a>, using <code>NobleSprite:remove()</code> will also call this method.</p>
<p> Sprites not manually removed before transitioning to another scene are automatically removed in <a href="../classes/NobleScene.html#noblescene:finish">finish</a>.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__sprite</span>
<span class="types"><span class="type">playdate.graphics.sprite</span></span>
<br/>
The sprite to add to the scene.
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../classes/NobleSprite.html#noblesprite:remove">NobleSprite:remove</a></li>
<li><a href="../classes/NobleScene.html#noblescene:addSprite">addSprite</a></li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Callbacks"></a>Callbacks </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "noblescene:init"></a>
<span class="item-name">noblescene:init()<span>
</dt>
<dd>
Implement this in your scene if you have code to run when your scene's object is created.
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> YourSceneName:<span class="function-name">init</span>()
YourSceneName.super.<span class="function-name">init</span>(self)
<span class="comment">--[Your code here]--
</span><span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "noblescene:enter"></a>
<span class="item-name">noblescene:enter()<span>
</dt>
<dd>
Implement if you want to run code as the transition to this scene begins, such as UI animation, triggers, etc.
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> YourSceneName:<span class="function-name">enter</span>()
YourSceneName.super.<span class="function-name">enter</span>(self)
<span class="comment">--[Your code here]--
</span><span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "noblescene:start"></a>
<span class="item-name">noblescene:start()<span>
</dt>
<dd>
Implement if you have code to run once the transition to this scene is complete. This method signifies the full activation of a scene. If this scene's <a href="../classes/NobleScene.html#noblescene.inputHandler">inputHandler</a> is defined, it is enabled now.
<h3>See</h3>
<ul>
<a href="../classes/NobleScene.html#noblescene.inputHandler">inputHandler</a>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> YourSceneName:<span class="function-name">start</span>()
YourSceneName.super.<span class="function-name">start</span>(self)
<span class="comment">--[Your code here]--
</span><span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "noblescene:update"></a>
<span class="item-name">noblescene:update()<span>
</dt>
<dd>
Implement to run scene-specific code on every frame while this scene is active.
<strong>NOTE:</strong> you may use coroutine.yield() here, because it only runs inside of playdate.update(), which is a coroutine.
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> YourSceneName:<span class="function-name">update</span>()
YourSceneName.super.<span class="function-name">update</span>(self)
<span class="comment">--[Your code here]--
</span><span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "noblescene:drawBackground"></a>
<span class="item-name">noblescene:drawBackground(__x, __y, __width, __height)<span>
</dt>
<dd>
Implement this function to draw background visual elements in your scene.
This runs when the engine need to redraw a background area.
By default it runs every frame and fills the background with self.backgroundColor. All arguments are optional.
Use <code>Graphics.sprite.setAlwaysRedraw(false)</code> after <code>Noble.new()</code> to optimize partial redraw.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__x</span>
<br/>
</li>
<li><span class="parameter">__y</span>
<br/>
</li>
<li><span class="parameter">__width</span>
<br/>
</li>
<li><span class="parameter">__height</span>
<br/>
</li>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> YourSceneName:<span class="function-name">drawBackground</span>(__x, __y, __width, __height)
YourSceneName.super.<span class="function-name">drawBackground</span>(self) <span class="comment">-- optional, invokes default behavior.
</span> <span class="comment">--[Your code here]--
</span><span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "noblescene:exit"></a>
<span class="item-name">noblescene:exit()<span>
</dt>
<dd>
Implement this in your scene if you have "goodbye" code to run when a transition to another scene
begins, such as UI animation, saving to disk, etc.
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> YourSceneName:<span class="function-name">exit</span>()
YourSceneName.super.<span class="function-name">exit</span>(self)
<span class="comment">--[Your code here]--
</span><span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "noblescene:finish"></a>
<span class="item-name">noblescene:finish()<span>
</dt>
<dd>
Implement this in your scene if you have code to run when a transition to another scene
is complete, such as resetting variables.
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> YourSceneName:<span class="function-name">finish</span>()
YourSceneName.super.<span class="function-name">finish</span>(self)
<span class="comment">--[Your code here]--
</span><span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "noblescene:pause"></a>
<span class="item-name">noblescene:pause()<span>
</dt>
<dd>
<code>pause()</code> / <code>resume()</code></p>
<p> Implement one or both of these in your scene if you want something to happen when the game is paused/unpaused
by the system. The Playdate SDK does not require you to write pause logic, but these are useful if you want a
custom menu image (see Playdate SDK for more details), want to obscure game elements to prevent players from
cheating in a time-sensitive game, want to count the number of times the player pauses the game, etc.
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> YourSceneName:<span class="function-name">pause</span>()
YourSceneName.super.<span class="function-name">pause</span>(self)
<span class="comment">--[Your code here]--
</span><span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "noblescene:resume"></a>
<span class="item-name">noblescene:resume()<span>
</dt>
<dd>
<span></span>
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> YourSceneName:<span class="function-name">resume</span>()
YourSceneName.super.<span class="function-name">resume</span>(self)
<span class="comment">--[Your code here]--
</span><span class="keyword">end</span></pre>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,290 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-module">
<h2>NobleSprite</h2>
<ul>
<h3>Fields</h3>
<ul>
<li><a href="#self.animation">self.animation</a></li>
</ul>
<h3>Methods</h3>
<ul>
<li><a href="#noblesprite:init">noblesprite:init</a></li>
<li><a href="#noblesprite:play">noblesprite:play</a></li>
<li><a href="#noblesprite:pause">noblesprite:pause</a></li>
<li><a href="#noblesprite:stop">noblesprite:stop</a></li>
<li><a href="#noblesprite:add">noblesprite:add</a></li>
<li><a href="#noblesprite:remove">noblesprite:remove</a></li>
</ul>
</ul>
</div>
<div class="nav-modules">
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><span class="selected">NobleSprite</span></li>
</ul>
</div>
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><a href="../modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>NobleSprite</h1>
<p>An extension of Playdate's sprite object, incorporating <a href="../modules/Noble.Animation.html#">Noble.Animation</a> and other Noble Engine features.</p>
<p> Use this in place of <code>playdate.graphics.sprite</code> in most cases.</p>
<p> <a href="../classes/NobleSprite.html#">NobleSprite</a> is a child class of <code>playdate.graphics.sprite</code>, so see the Playdate SDK documentation for additional methods and properties.</p>
<hr/>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<!-- -->
<dl class="function">
<dt>
<a name = "self.animation"></a>
<span class="item-name">self.animation<span>
</dt>
<dd>
The animation for this NobleSprite.
<h3>See</h3>
<ul>
<a href="../modules/Noble.Animation.html#Noble.Animation.new">Noble.Animation.new</a>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Methods"></a>Methods</h2>
<!-- -->
<dl class="function">
<dt>
<a name = "noblesprite:init"></a>
<span class="item-name">noblesprite:init([__view[, __viewIsSpritesheet=false[, __singleState=false[, __singleStateLoop=true]]]])<span>
</dt>
<dd>
Do not call an "init" method directly. Use <code>NobleSprite()</code> (see usage examples).
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__view</span>
<span class="types"><span class="type">string</span></span>
<span class="optional">(optional)</span>
<br/>
This can be: the path to an image or spritesheet image file, an image object (<code>Graphics.image</code>) or an animation object (<a href="../modules/Noble.Animation.html#">Noble.Animation</a>)
</li>
<li><span class="parameter">__viewIsSpritesheet</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
Set this to <code>true</code> to indicate that <code>__view</code> is a spritesheet. Will only be considered if <code>__view</code> is a string path to an image.
</li>
<li><span class="parameter">__singleState</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
If this sprite has just one animation, set this to true. It saves you from having to use Noble.Animation.addState()
</li>
<li><span class="parameter">__singleStateLoop</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
If using a single state animation, should it loop?
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.Animation.html#animation:addState">Noble.Animation:addState</a></li>
<li><a href="../modules/Noble.Animation.html#Noble.Animation.new">Noble.Animation.new</a></li>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="comment">-- Provide a spritesheet image file to create a new <a href="../modules/Noble.Animation.html#">Noble.Animation</a> for a NobleSprite's view.
</span>myNobleSprite = <span class="function-name">NobleSprite</span>(<span class="string">"path/to/spritesheet"</span>, <span class="keyword">true</span>)</pre>
<pre class="example"><span class="comment">-- Provide an image file to create a new <code>Graphics.image</code> for a NobleSprite's view.
</span>myNobleSprite = <span class="function-name">NobleSprite</span>(<span class="string">"path/to/image"</span>)</pre>
<pre class="example"><span class="comment">-- Use an existing <a href="../modules/Noble.Animation.html#">Noble.Animation</a> for a NobleSprite's view.
</span> <span class="keyword">local</span> myAnimation = Noble.Animation.<span class="function-name">new</span>(<span class="string">"path/to/spritesheet"</span>)
myAnimation:<span class="function-name">addState</span>(<span class="string">"default"</span>, <span class="number">1</span>, animation.imageTable:<span class="function-name">getLength</span>(), <span class="keyword">nil</span>, <span class="keyword">true</span>)
myNobleSprite = <span class="function-name">NobleSprite</span>(myAnimation)</pre>
<pre class="example"><span class="comment">-- Use an existing <code>Graphics.image</code> object for a NobleSprite's view.
</span> <span class="keyword">local</span> myImage = Graphics.image.<span class="function-name">new</span>(<span class="string">"path/to/image"</span>)
myNobleSprite = <span class="function-name">NobleSprite</span>(myImage)</pre>
<pre class="example"><span class="comment">-- Extending NobleSprite.
</span>
<span class="comment">-- MyCustomSprite.lua
</span>MyCustomSprite = {}
<span class="function-name">class</span>(<span class="string">"MyCustomSprite"</span>).<span class="function-name">extends</span>(NobleSprite)
<span class="keyword">function</span> MyCustomSprite:<span class="function-name">init</span>(__x, __y, __anotherFunArgument)
MyCustomSprite.super.<span class="function-name">init</span>(self, <span class="string">"path/to/spritesheet"</span>, <span class="keyword">true</span>)
<span class="comment">-- Etc. etc.
</span><span class="keyword">end</span>
<span class="comment">-- MyNobleScene.lua
</span>myNobleSprite = <span class="function-name">MyCustomSprite</span>(<span class="number">100</span>, <span class="number">100</span>, <span class="string">"Fun!"</span>)</pre>
</dd>
<dt>
<a name = "noblesprite:play"></a>
<span class="item-name">noblesprite:play()<span>
</dt>
<dd>
This will enable the update loop for this NobleSprite, which also causes its Noble.Animation to play.
</dd>
<dt>
<a name = "noblesprite:pause"></a>
<span class="item-name">noblesprite:pause()<span>
</dt>
<dd>
This will disable the update loop for this NobleSprite, which also causes its Noble.Animation to pause.
</dd>
<dt>
<a name = "noblesprite:stop"></a>
<span class="item-name">noblesprite:stop()<span>
</dt>
<dd>
This will disable the update loop for this NobleSprite, and also reset its Noble.Animation (if it exists) to the first frame of its current state.
</dd>
<dt>
<a name = "noblesprite:add"></a>
<span class="item-name">noblesprite:add(__x, __y)<span>
</dt>
<dd>
Use this to add this NobleSprite to your scene. This replaces <code>playdate.graphics.sprite:add()</code> to allow NobleSprites to be tracked by the current NobleScene.</p>
<p> To add a <code>playdate.graphics.sprite</code> to a scene, use <code>NobleScene:addSprite(__sprite)</code>.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__x</span>
<br/>
</li>
<li><span class="parameter">__y</span>
<br/>
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../classes/NobleScene.html#noblescene:addSprite">NobleScene:addSprite</a>
</ul>
</dd>
<dt>
<a name = "noblesprite:remove"></a>
<span class="item-name">noblesprite:remove()<span>
</dt>
<dd>
Use this to remove this NobleSprite from your scene. This replaces <code>playdate.graphics.sprite:remove()</code> to allow NobleSprites to be tracked by the current NobleScene.</p>
<p> To remove a <code>playdate.graphics.sprite</code> from a scene, use <code>NobleScene:removeSprite(__sprite)</code>.
<h3>See</h3>
<ul>
<a href="../classes/NobleScene.html#noblescene:removeSprite">NobleScene:removeSprite</a>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 KiB

View File

@@ -1,264 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-modules">
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><span class="selected">SceneTemplate.lua</span></li>
</ul>
</div>
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><a href="../modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h2>SceneTemplate.lua</h2>
<pre>
<span class="comment">--
</span><span class="comment">-- SceneTemplate.lua
</span><span class="comment">--
</span><span class="comment">-- Use this as a starting point for your game's scenes.
</span><span class="comment">-- Copy this file to your root "scenes" directory,
</span><span class="comment">-- and rename it.
</span><span class="comment">--
</span>
<span class="comment">-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
</span><span class="comment">-- !!! Rename "SceneTemplate" to your scene's name in these first three lines. !!!
</span><span class="comment">-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
</span>
SceneTemplate = {}
<span class="function-name">class</span>(<span class="string">"SceneTemplate"</span>).<span class="function-name">extends</span>(NobleScene)
<span class="keyword">local</span> scene = SceneTemplate
<span class="comment">-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
</span><span class="comment">-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
</span>
<span class="comment">-- It is recommended that you declare, but don't yet define,
</span><span class="comment">-- your scene-specific varibles and methods here. Use "local" where possible.
</span><span class="comment">--
</span><span class="comment">-- local variable1 = nil -- local variable
</span><span class="comment">-- scene.variable2 = nil -- Scene variable.
</span><span class="comment">-- When accessed outside this file use <code>SceneTemplate.variable2</code>.
</span><span class="comment">-- ...
</span><span class="comment">--
</span>
<span class="comment">-- This is the background color of this scene.
</span>scene.backgroundColor = Graphics.kColorWhite
<span class="comment">-- This runs when your scene's object is created, which is the
</span><span class="comment">-- first thing that happens when transitining away from another scene.
</span><span class="keyword">function</span> scene:<span class="function-name">init</span>()
scene.super.<span class="function-name">init</span>(self)
<span class="comment">-- variable1 = 100
</span> <span class="comment">-- SceneTemplate.variable2 = "string"
</span> <span class="comment">-- ...
</span>
<span class="comment">-- Your code here
</span><span class="keyword">end</span>
<span class="comment">-- When transitioning from another scene, this runs as soon as this
</span><span class="comment">-- scene needs to be visible (this moment depends on which transition type is used).
</span><span class="keyword">function</span> scene:<span class="function-name">enter</span>()
scene.super.<span class="function-name">enter</span>(self)
<span class="comment">-- Your code here
</span><span class="keyword">end</span>
<span class="comment">-- This runs once a transition from another scene is complete.
</span><span class="keyword">function</span> scene:<span class="function-name">start</span>()
scene.super.<span class="function-name">start</span>(self)
<span class="comment">-- Your code here
</span><span class="keyword">end</span>
<span class="comment">-- This runs once per frame.
</span><span class="keyword">function</span> scene:<span class="function-name">update</span>()
scene.super.<span class="function-name">update</span>(self)
<span class="comment">-- Your code here
</span><span class="keyword">end</span>
<span class="comment">-- This runs once per frame, and is meant for drawing code.
</span><span class="keyword">function</span> scene:<span class="function-name">drawBackground</span>()
scene.super.<span class="function-name">drawBackground</span>(self)
<span class="comment">-- Your code here
</span><span class="keyword">end</span>
<span class="comment">-- This runs as as soon as a transition to another scene begins.
</span><span class="keyword">function</span> scene:<span class="function-name">exit</span>()
scene.super.<span class="function-name">exit</span>(self)
<span class="comment">-- Your code here
</span><span class="keyword">end</span>
<span class="comment">-- This runs once a transition to another scene completes.
</span><span class="keyword">function</span> scene:<span class="function-name">finish</span>()
scene.super.<span class="function-name">finish</span>(self)
<span class="comment">-- Your code here
</span><span class="keyword">end</span>
<span class="keyword">function</span> scene:<span class="function-name">pause</span>()
scene.super.<span class="function-name">pause</span>(self)
<span class="comment">-- Your code here
</span><span class="keyword">end</span>
<span class="keyword">function</span> scene:<span class="function-name">resume</span>()
scene.super.<span class="function-name">resume</span>(self)
<span class="comment">-- Your code here
</span><span class="keyword">end</span>
<span class="comment">-- Define the inputHander for this scene here, or use a previously defined inputHandler.
</span>
<span class="comment">-- scene.inputHandler = someOtherInputHandler
</span><span class="comment">-- OR
</span>scene.inputHandler = {
<span class="comment">-- A button
</span> <span class="comment">--
</span> AButtonDown = <span class="keyword">function</span>() <span class="comment">-- Runs once when button is pressed.
</span> <span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
AButtonHold = <span class="keyword">function</span>() <span class="comment">-- Runs every frame while the player is holding button down.
</span> <span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
AButtonHeld = <span class="keyword">function</span>() <span class="comment">-- Runs after button is held for 1 second.
</span> <span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
AButtonUp = <span class="keyword">function</span>() <span class="comment">-- Runs once when button is released.
</span> <span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
<span class="comment">-- B button
</span> <span class="comment">--
</span> BButtonDown = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
BButtonHeld = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
BButtonHold = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
BButtonUp = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
<span class="comment">-- D-pad left
</span> <span class="comment">--
</span> leftButtonDown = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
leftButtonHold = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
leftButtonUp = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
<span class="comment">-- D-pad right
</span> <span class="comment">--
</span> rightButtonDown = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
rightButtonHold = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
rightButtonUp = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
<span class="comment">-- D-pad up
</span> <span class="comment">--
</span> upButtonDown = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
upButtonHold = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
upButtonUp = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
<span class="comment">-- D-pad down
</span> <span class="comment">--
</span> downButtonDown = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
downButtonHold = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
downButtonUp = <span class="keyword">function</span>()
<span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
<span class="comment">-- Crank
</span> <span class="comment">--
</span> cranked = <span class="keyword">function</span>(change, acceleratedChange) <span class="comment">-- Runs when the crank is rotated. See Playdate SDK documentation for details.
</span> <span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
crankDocked = <span class="keyword">function</span>() <span class="comment">-- Runs once when when crank is docked.
</span> <span class="comment">-- Your code here
</span> <span class="keyword">end</span>,
crankUndocked = <span class="keyword">function</span>() <span class="comment">-- Runs once when when crank is undocked.
</span> <span class="comment">-- Your code here
</span> <span class="keyword">end</span>
}</pre>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 KiB

View File

@@ -1,142 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-modules">
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="modules/Noble.html">Noble</a></li>
<li><a href="modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="modules/Noble.Transition.html">Noble.Transition</a></li>
<li><a href="modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="classes/NobleScene.html">NobleScene</a></li>
<li><a href="classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h2>A li'l game engine for Playdate.</h2>
<h2>Modules</h2>
<table class="module_list">
<tr>
<td class="name" ><a href="modules/Noble.html">Noble</a></td>
<td class="summary">A li'l game engine for Playdate.</td>
</tr>
<tr>
<td class="name" ><a href="modules/Noble.Animation.html">Noble.Animation</a></td>
<td class="summary">Animation states using a spritesheet/imagetable.</td>
</tr>
<tr>
<td class="name" ><a href="modules/Noble.Bonk.html">Noble.Bonk</a></td>
<td class="summary">Engine-specific error handling.</td>
</tr>
<tr>
<td class="name" ><a href="modules/Noble.GameData.html">Noble.GameData</a></td>
<td class="summary">Operations for game data / save slots.</td>
</tr>
<tr>
<td class="name" ><a href="modules/Noble.Input.html">Noble.Input</a></td>
<td class="summary">A complete encapsulation of the Playdate's input system.</td>
</tr>
<tr>
<td class="name" ><a href="modules/Noble.Menu.html">Noble.Menu</a></td>
<td class="summary">An extended implementation of <code>playdate.ui.gridview</code>, meant for 1-dimensional, single-screen text menus.</td>
</tr>
<tr>
<td class="name" ><a href="modules/Noble.Settings.html">Noble.Settings</a></td>
<td class="summary">Operations for game settings / stats.</td>
</tr>
<tr>
<td class="name" ><a href="modules/Noble.Text.html">Noble.Text</a></td>
<td class="summary">Text and font handling.</td>
</tr>
<tr>
<td class="name" ><a href="modules/Noble.Transition.html">Noble.Transition</a></td>
<td class="summary">An abstract class from which transition types are extended.</td>
</tr>
<tr>
<td class="name" ><a href="modules/Ease.html">Ease</a></td>
<td class="summary">Extensions to <code>playdate.easingFunctions</code>, aliased as <a href="modules/Ease.html#">Ease</a> in Noble Engine.</td>
</tr>
</table>
<h2>Classes</h2>
<table class="module_list">
<tr>
<td class="name" ><a href="classes/NobleScene.html">NobleScene</a></td>
<td class="summary">An abstract scene class.</td>
</tr>
<tr>
<td class="name" ><a href="classes/NobleSprite.html">NobleSprite</a></td>
<td class="summary">An extension of Playdate's sprite object, incorporating <a href="modules/Noble.Animation.html#">Noble.Animation</a> and other Noble Engine features.</td>
</tr>
</table>
<h2>Examples</h2>
<table class="module_list">
<tr>
<td class="name" ><a href="examples/SceneTemplate.lua.html">SceneTemplate.lua</a></td>
<td class="summary"></td>
</tr>
</table>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
Last updated 2024-04-28 21:37:43
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,524 +0,0 @@
@import url(https://fonts.googleapis.com/css?family=Quicksand:300,700);
@import url(https://fonts.googleapis.com/css?family=Lato);
@import url(https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@200;300;400;600;700;900&display=swap);
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body {
margin: 2em;
font-family: "Lato", arial, helvetica, geneva, sans-serif;
background-color: #ffcb1f;
color: #31302f;
}
code,
tt {
font-family: "Source Code Pro", monospace;
font-size: 1.1em;
letter-spacing: -1px;
font-weight: 600;
color: #056d8d;
}
span.types:before {
content: ": ";
}
span.types:after {
content: "";
}
.type,
.default,
.optional {
color: #74726e;
}
.default .value {
font-weight: bold;
}
.parameters {
list-style-type: none;
}
.parameters li {
margin-bottom: 10px;
line-height: 1.5em;
}
.parameter {
font-weight: 600;
color: #045771;
}
body, td, th {
font-size: .95em;
line-height: 1.2em;
}
p, ul {
margin: 10px 0 0 0px;
}
ul {
padding-left: 25px;
}
strong {
font-weight: bold;
}
em {
font-style: italic;
}
.logo {
width: 100%;
background-image: url("logo.png");
background-repeat: no-repeat;
background-position: center;
height: 150px;
}
.logo h1 {
display: none;
}
h1 {
font-family: 'Quicksand', sans-serif;
font-weight: bold;
color: #cf5a5a;
font-size: 2.5em;
margin: 20px 0 30px 0;
}
h2, h3, h4 {
font-family: 'Quicksand', sans-serif;
font-weight: 700;
margin: 15px 0 10px 0;
}
h2 {
font-size: 1.25em;
color: #cf5a5a;
}
h3 {
font-size: 1.15em;
}
h4 {
font-size: 1em;
}
.section-header {
margin-top: 50px;
padding: 10px;
padding-left: 15px;
margin-left: -25px;
border-radius: 50px;
border-left: 20px solid #cf5a5a;
background-color: #e9cfc8;
color: #31302f;
}
a:link {
font-weight: bold;
color: #cf5a5a;
text-decoration: none;
}
a:visited {
font-weight: bold;
color: #cf5a5a;
text-decoration: none;
}
a:link:hover {
text-decoration: underline;
}
hr {
background: #cf5a5a;
border-radius: 100px;
height: 6px;
margin: 60px 20%;
border: none;
}
blockquote {
margin-left: 3em;
}
ul {
list-style-type: none;
}
p.name {
font-family: "Andale Mono", monospace;
padding-top: 1em;
}
span.item-name {
background-color: #fbd350;
display: inline-block;
color: #31302f;
padding: 10px 20px;
border-radius: 25px;
border: 2px solid #bf9817;
font-size: 1em;
font-family: "Source Code Pro", monospace;
font-weight: 700;
letter-spacing: -1px;
}
pre {
background-color: #056d8d;
border: 2px solid #03475c;
-webkit-box-shadow: 0 0 10px 0 rgba(49, 48, 47, 0.5);
box-shadow: 0 0 10px 0 rgba(49, 48, 47, 0.5);
border-radius: 15px;
color: #f0ece3;
padding: 15px 20px;
margin: 10px 0 10px 0;
font-family: "Source Code Pro", monospace;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
overflow-x: auto;
width: 100%;
font-weight: 400;
}
pre .keyword {
color: #ffcb1f;
}
pre .string, pre .number {
color: #eb6e6e;
font-weight: bold;
}
pre .comment {
color: #b4b1aa;
}
pre.example {
font-size: .85em;
}
table.index td {
text-align: left;
vertical-align: top;
}
#container {
margin-left: auto;
margin-right: auto;
border-radius: 25px;
-webkit-box-shadow: 0 0 25px 0 rgba(49, 48, 47, 0.3);
box-shadow: 0 0 25px 0 rgba(49, 48, 47, 0.3);
overflow: hidden;
max-width: 1600px;
}
#product {
text-align: center;
height: 500px;
background-color: #31302f;
color: #f0ece3;
}
#product > :before {
content: 'Noble Engine';
}
#product big {
font-size: 2em;
}
#main {
background-color: #31302f;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
}
#navigation {
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
-ms-flex-negative: 0;
flex-shrink: 0;
-ms-flex-preferred-size: auto;
flex-basis: auto;
width: 275px;
padding: 0 10px;
overflow: hidden;
color: #f0ece3;
}
#navigation a:link, #navigation a:visited {
font-weight: normal;
}
#navigation .nav-module,
#navigation .nav-modules {
color: #31302f;
padding: 15px;
border-radius: 20px;
}
#navigation .nav-module a:link, #navigation .nav-module a:visited,
#navigation .nav-modules a:link,
#navigation .nav-modules a:visited {
color: #31302f;
}
#navigation .nav-module ul a:active, #navigation .nav-module ul a:hover, #navigation .nav-module ul .selected,
#navigation .nav-modules ul a:active,
#navigation .nav-modules ul a:hover,
#navigation .nav-modules ul .selected {
color: #f0ece3;
background-color: #cf5a5a;
padding: 5px 10px;
margin-left: -10px;
border-radius: 30px;
text-decoration: none;
}
#navigation .nav-module ul .selected,
#navigation .nav-modules ul .selected {
line-height: 2em;
margin-left: -28px;
padding-left: 28px;
border-radius: 0 30px 30px 0;
font-weight: bold;
}
#navigation .nav-module {
background-color: #eb6e6e;
margin: 0 -10px 20px 10px;
border-radius: 20px 0 0 20px;
}
#navigation .nav-module h2 {
background-color: #cf5a5a;
color: #f0ece3;
margin: 0;
}
#navigation .nav-module ul a:active, #navigation .nav-module ul a:hover {
color: #31302f;
background-color: #ffcb1f;
}
#navigation .nav-modules {
background-color: #f3e5bc;
margin: 0 10px 30px 10px;
padding-top: 5px;
}
#navigation h1 {
color: #eb6e6e;
line-height: 80%;
font-family: 'Quicksand', sans-serif;
font-weight: 900;
font-size: 32px;
padding-left: 20px;
padding-bottom: 20px;
}
#navigation h2 {
color: #31302f;
font-size: 1.1em;
background-color: #f0ece3;
padding: 5px 10px;
margin-right: 20px;
border-radius: 30px;
text-decoration: none;
}
#navigation ul {
font-size: 1em;
list-style-type: none;
margin: 1px 1px 10px 1px;
padding-left: 0px;
}
#navigation li {
display: block;
margin: 0px 0px 6px 12px;
padding-left: 0px;
}
#navigation li li a {
margin: 0px 3px 0px -1em;
}
#content {
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
-ms-flex-negative: 1;
flex-shrink: 1;
-ms-flex-preferred-size: auto;
flex-basis: auto;
min-width: 0;
padding: 2em;
padding-left: 3.5em;
border-left: 4px solid #cf5a5a;
-webkit-box-shadow: inset 0 0 50px 0 rgba(207, 90, 90, 0.25);
box-shadow: inset 0 0 50px 0 rgba(207, 90, 90, 0.25);
background-color: #f0ece3;
}
#about {
clear: both;
padding: 20px;
border-top: 2px solid #31302f;
background-color: #cf5a5a;
color: #f0ece3;
}
#about a:link, #about a:visited, #about a:hover, #about a:active {
color: #ffcb1f;
}
@media print {
body {
font: 12pt "Times New Roman", "TimeNR", Times, serif;
}
a {
font-weight: bold;
color: #1c4e68;
text-decoration: underline;
}
#main {
background-color: #ffffff;
border-left: 0px;
}
#container {
margin-left: 2%;
margin-right: 2%;
background-color: #ffffff;
}
#content {
padding: 1em;
background-color: #ffffff;
}
#navigation {
display: none;
}
pre.example {
font-family: "Andale Mono", monospace;
font-size: 10pt;
page-break-inside: avoid;
}
}
table.module_list {
border-width: 1px;
border-style: solid;
border-color: #b1e3fa;
border-collapse: collapse;
}
table.module_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #b1e3fa;
}
table.module_list td.name {
background-color: #e0f4fc;
min-width: 200px;
}
table.module_list td.summary {
width: 100%;
}
table.function_list {
border-width: 1px;
border-style: solid;
border-color: #b1e3fa;
border-collapse: collapse;
}
table.function_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #b1e3fa;
}
table.function_list td.name {
background-color: #e0f4fc;
min-width: 200px;
}
table.function_list td.summary {
width: 100%;
}
ul.nowrap {
overflow: auto;
white-space: nowrap;
}
dl.table dt,
dl.function dt {
padding-top: 1em;
}
dl.table dd dd,
dl.function dd {
padding-bottom: 30px;
margin: 10px 0 10px 20px;
border-bottom: 2px dotted #056d8d;
}
dl.table dd > :last-child,
dl.function > :last-child {
border-bottom: none;
}
dl.table h3,
dl.function h3 {
font-size: .95em;
}
/* stop sublists from having initial vertical space */
ul ul {
margin-top: 0px;
}
ol ul {
margin-top: 0px;
}
ol ol {
margin-top: 0px;
}
ul ol {
margin-top: 0px;
}
/* make the target distinct; helps when we're navigating to a function */
a:target + * {
border: 2px solid #31302f;
border-bottom: 6px solid #31302f;
background-color: #cf5a5a;
color: #f0ece3;
}
/*# sourceMappingURL=ldoc.css.map */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,176 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-module">
<h2>Ease</h2>
<ul>
<h3>Functions</h3>
<ul>
<li><a href="#enter">enter</a></li>
<li><a href="#exit">exit</a></li>
<li><a href="#reverse">reverse</a></li>
</ul>
</ul>
</div>
<div class="nav-modules">
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><span class="selected">Ease</span></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>Ease</h1>
<p>Extensions to <code>playdate.easingFunctions</code>, aliased as <a href="../modules/Ease.html#">Ease</a> in Noble Engine.</p>
<p> See the Playdate SDK for a list of easing functions.</p>
<hr/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<!-- -->
<dl class="function">
<dt>
<a name = "enter"></a>
<span class="item-name">enter(__easingFunction)<span>
</dt>
<dd>
Returns the first half of an "inOut" or "outIn" easing function.
Returns <code>nil</code> for any easing function that isn't in the form of <code>Ease.inOutXxxx</code> or <code>Ease.outInXxxx</code>. <code>Ease.linear</code> returns itself.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__easingFunction</span>
<br/>
</li>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="keyword">local</span> ease = Ease.outInQuad
<span class="keyword">local</span> easeEnter = Ease.<span class="function-name">enter</span>(ease) <span class="comment">-- Returns "Ease.outQuad"</span></pre>
</dd>
<dt>
<a name = "exit"></a>
<span class="item-name">exit(__easingFunction)<span>
</dt>
<dd>
Returns the second half of an "inOut" or "outIn" easing function.
Returns <code>nil</code> for any easing function that isn't in the form of <code>Ease.inOutXxxx</code> or <code>Ease.outInXxxx</code>. <code>Ease.linear</code> returns itself.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__easingFunction</span>
<br/>
</li>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="keyword">local</span> ease = Ease.outInQuad
<span class="keyword">local</span> easeExit = Ease.<span class="function-name">exit</span>(ease) <span class="comment">-- Returns "Ease.inQuad"</span></pre>
</dd>
<dt>
<a name = "reverse"></a>
<span class="item-name">reverse(__easingFunction)<span>
</dt>
<dd>
Returns the reverse function of the provided function.
Returns <code>nil</code> for any easing function that isn't in the form of <code>Ease.inXxxx</code> or <code>Ease.outXxxx</code>. <code>Ease.linear</code> returns itself.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__easingFunction</span>
<br/>
</li>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="keyword">local</span> ease = Ease.inQuad
<span class="keyword">local</span> reverseEase = Ease.<span class="function-name">reverse</span>(ease) <span class="comment">-- Returns "Ease.outQuad"</span></pre>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,507 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-module">
<h2>Noble.Animation</h2>
<ul>
<h3>Setup </h3>
<ul>
<li><a href="#Noble.Animation.new">.new</a></li>
<li><a href="#animation:addState">animation:addState</a></li>
</ul>
<h3>Properties </h3>
<ul>
<li><a href="#animation.current">animation.current</a></li>
<li><a href="#animation.currentName">animation.currentName</a></li>
<li><a href="#animation.currentFrame">animation.currentFrame</a></li>
<li><a href="#animation.direction">animation.direction</a></li>
</ul>
<h3>Methods </h3>
<ul>
<li><a href="#animation:setState">animation:setState</a></li>
<li><a href="#animation:draw">animation:draw</a></li>
<li><a href="#animation:drawFrame">animation:drawFrame</a></li>
</ul>
<h3>Constants </h3>
<ul>
<li><a href="#Noble.Animation.DIRECTION_RIGHT">.DIRECTION_RIGHT</a></li>
<li><a href="#Noble.Animation.DIRECTION_LEFT">.DIRECTION_LEFT</a></li>
</ul>
</ul>
</div>
<div class="nav-modules">
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><span class="selected">Noble.Animation</span></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><a href="../modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>Noble.Animation</h1>
<p>Animation states using a spritesheet/imagetable.</p>
<p> Ideal for use with <a href="../classes/NobleSprite.html#">NobleSprite</a> objects. Suitable for other uses as well.</p>
<hr/>
<h2 class="section-header "><a name="Setup"></a>Setup </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "Noble.Animation.new"></a>
<span class="item-name">Noble.Animation.new(__view)<span>
</dt>
<dd>
Create a new animation "state machine". This function is called automatically when creating a new <a href="../classes/NobleSprite.html#">NobleSprite</a>.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__view</span>
<span class="types"><span class="type">string</span></span>
<br/>
This can be: the path to a spritesheet image file or an image table object (<code>Graphics.imagetable</code>). See Playdate SDK docs for imagetable file naming conventions.
</li>
</ul>
<h3>Returns</h3>
<ol>
<code>animation</code>, a new animation object.
</ol>
<h3>See</h3>
<ul>
<a href="../classes/NobleSprite.html#noblesprite:init">NobleSprite:init</a>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="keyword">local</span> myHero = <span class="function-name">MyHero</span>(<span class="string">"path/to/spritesheet"</span>)</pre>
<pre class="example"><span class="comment">-- When extending NobleSprite (recommended), you don't call Noble.Animation.new(),
</span><span class="comment">-- but you do feed its __view argument into MySprite.super.init()...
</span>MyHero = {}
<span class="function-name">class</span>(<span class="string">"MyHero"</span>).<span class="function-name">extends</span>(NobleSprite)
<span class="keyword">function</span> MyHero:<span class="function-name">init</span>()
MyHero.super.<span class="function-name">init</span>(self, <span class="string">"assets/images/Hero"</span>)
<span class="comment">-- ...
</span> <span class="comment">-- A new NobleSprite creates a Noble.Animation object named "self.animation"
</span> self.animation:<span class="function-name">addState</span>(<span class="string">"idle"</span>, <span class="number">1</span>, <span class="number">30</span>)
self.animation:<span class="function-name">addState</span>(<span class="string">"jump"</span>, <span class="number">31</span>, <span class="number">34</span>, <span class="string">"float"</span>)
self.animation:<span class="function-name">addState</span>(<span class="string">"float"</span>, <span class="number">35</span>, <span class="number">45</span>)
self.animation:<span class="function-name">addState</span>(<span class="string">"turn"</span>, <span class="number">46</span>, <span class="number">55</span>, <span class="string">"idle"</span>)
self.animation:<span class="function-name">addState</span>(<span class="string">"walk"</span>, <span class="number">56</span>, <span class="number">65</span>)
<span class="comment">-- ...
</span><span class="keyword">end</span></pre>
<pre class="example"><span class="keyword">local</span> myAnimation = Noble.Animation.<span class="function-name">new</span>(<span class="string">"path/to/spritesheet"</span>)</pre>
<pre class="example"><span class="comment">-- When extending playdate.graphics.Sprite, Noble.Animation.new() must be called manually...
</span>MyHero = {}
<span class="function-name">class</span>(<span class="string">"MyHero"</span>).<span class="function-name">extends</span>(Graphics.sprite)
<span class="keyword">function</span> MyHero:<span class="function-name">init</span>()
MyHero.super.<span class="function-name">init</span>(self)
<span class="comment">-- ...
</span> self.animation = Noble.Animation.<span class="function-name">new</span>(<span class="string">"assets/images/Hero"</span>)
self.animation:<span class="function-name">addState</span>(<span class="string">"idle"</span>, <span class="number">1</span>, <span class="number">30</span>)
self.animation:<span class="function-name">addState</span>(<span class="string">"jump"</span>, <span class="number">31</span>, <span class="number">34</span>, <span class="string">"float"</span>)
self.animation:<span class="function-name">addState</span>(<span class="string">"float"</span>, <span class="number">35</span>, <span class="number">45</span>)
self.animation:<span class="function-name">addState</span>(<span class="string">"turn"</span>, <span class="number">46</span>, <span class="number">55</span>, <span class="string">"idle"</span>)
self.animation:<span class="function-name">addState</span>(<span class="string">"walk"</span>, <span class="number">56</span>, <span class="number">65</span>)
<span class="comment">-- ...
</span><span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "animation:addState"></a>
<span class="item-name">animation:addState(__name, __startFrame, __endFrame, __next[, __loop=true], __onComplete[, __frameDuration=1])<span>
</dt>
<dd>
Add an animation state. The first state added will be the default set for this animation.</p>
<p> <strong>NOTE:</strong> Added states are first-degree member objects of your Noble.Animation object, so do not use names of already existing methods/properties ("current", "draw", etc.).
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__name</span>
<span class="types"><span class="type">string</span></span>
<br/>
The name of the animation, this is also used as the key for the animation.
</li>
<li><span class="parameter">__startFrame</span>
<span class="types"><span class="type">integer</span></span>
<br/>
This is the first frame of this animation in the imagetable/spritesheet
</li>
<li><span class="parameter">__endFrame</span>
<span class="types"><span class="type">integer</span></span>
<br/>
This is the final frame of this animation in the imagetable/spritesheet
</li>
<li><span class="parameter">__next</span>
<span class="types"><span class="type">string</span></span>
<br/>
By default, animation states will loop, but if you want to sequence an animation, enter the name of the next state here.
</li>
<li><span class="parameter">__loop</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
If you want a state to "freeze" on its final frame, instead of looping, enter <code>false</code> here.
</li>
<li><span class="parameter">__onComplete</span>
<br/>
This function will run when this animation is complete. Be careful when using this on a looping animation!
</li>
<li><span class="parameter">__frameDuration</span>
<span class="types"><span class="type">integer</span></span>
<span class="default">= <span class="value">1</span> (default)</span>
<br/>
This is the number of ticks between each frame in this animation. If not specified, it will be set to 1.
</li>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="comment">-- You can reference an animation's state's properties using bog-standard lua syntax:
</span>
animation.idle.startFrame <span class="comment">-- 30
</span>animation.walk.endFrame <span class="comment">-- 65
</span>animation.[<span class="string">"walk"</span>].endFrame <span class="comment">-- 65
</span>animation.jump.name <span class="comment">-- "jump"
</span>animation.[<span class="string">"jump"</span>].<span class="global">next</span> <span class="comment">-- "float"
</span>animation.idle.<span class="global">next</span> <span class="comment">-- nil</span></pre>
</dd>
</dl>
<h2 class="section-header "><a name="Properties"></a>Properties </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "animation.current"></a>
<span class="item-name">animation.current<span>
</dt>
<dd>
The currently set animation state. </p>
<p> This is intended as <code>read-only</code>. You should not modify this property directly.
<h3>See</h3>
<ul>
<a href="../modules/Noble.Animation.html#animation:setState">setState</a>
</ul>
</dd>
<dt>
<a name = "animation.currentName"></a>
<span class="item-name">animation.currentName<span>
</dt>
<dd>
The name of the current animation state. Calling this instead of <code>animation.current.name</code> is <em>just</em> a little faster.</p>
<p> This is intended as <code>read-only</code>. You should not modify this property directly.
</dd>
<dt>
<a name = "animation.currentFrame"></a>
<span class="item-name">animation.currentFrame<span>
</dt>
<dd>
The current frame of the animation. This is the index of the imagetable, not the frame of the current state.</p>
<p> Most of the time, you should not modify this directly, although you can if you're feeling saucy and are prepared for unpredictable results.
<h3>See</h3>
<ul>
<a href="../modules/Noble.Animation.html#animation:draw">draw</a>
</ul>
</dd>
<dt>
<a name = "animation.direction"></a>
<span class="item-name">animation.direction<span>
</dt>
<dd>
This controls the flipping of the image when drawing. DIRECTION<em>RIGHT is unflipped, DIRECTION</em>LEFT is flipped on the X axis.
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> MyHero:<span class="function-name">goLeft</span>()
self.animation.direction = Noble.Animation.DIRECTION_LEFT
<span class="comment">-- ...
</span><span class="keyword">end</span></pre>
</dd>
</dl>
<h2 class="section-header "><a name="Methods"></a>Methods </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "animation:setState"></a>
<span class="item-name">animation:setState(__animationState[, __continuous=false], __unlessThisState)<span>
</dt>
<dd>
Sets the current animation state. This can be run in a object's <code>update</code> method because it only changes the animation state if the new state is different from the current one.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__animationState</span>
<span class="types"><span class="type">string</span> or <span class="type">Noble.Animation</span></span>
<br/>
The name of the animation to set. You can pass the name of the state, or the object itself.
</li>
<li><span class="parameter">__continuous</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
Set to true if your new state's frames line up with the previous one's, i.e.: two walk cycles but one is wearing a cute hat!
</li>
<li><span class="parameter">__unlessThisState</span>
<span class="types"><span class="type">string</span> or <span class="type">Noble.Animation</span></span>
<br/>
If this state is the current state, do not set the new one.
</li>
</ul>
<h3>Usage</h3>
<pre class="example">animation:<span class="function-name">setState</span>(<span class="string">"walk"</span>)</pre>
<pre class="example">animation:<span class="function-name">setState</span>(animation.walk)</pre>
<pre class="example">animation:<span class="function-name">setState</span>(animation.walkNoHat)
<span class="comment">--
</span>animation:<span class="function-name">setState</span>(animation.walkYesHat, <span class="keyword">true</span>)</pre>
<pre class="example"><span class="keyword">function</span> MyHero:<span class="function-name">update</span>()
<span class="comment">-- Input
</span> <span class="comment">-- ...
</span>
<span class="comment">-- Physics/collisions
</span> <span class="comment">-- ...
</span>
<span class="comment">-- Animation states
</span> <span class="keyword">if</span> (grounded) <span class="keyword">then</span>
<span class="keyword">if</span> (turning) <span class="keyword">then</span>
self.animation:<span class="function-name">setState</span>(self.animation.turn)
<span class="keyword">elseif</span> (<span class="global">math</span>.<span class="function-name">abs</span>(self.velocity.x) &gt; <span class="number">15</span>) <span class="keyword">then</span>
self.animation:<span class="function-name">setState</span>(self.animation.walk, <span class="keyword">false</span>, self.animation.turn)
<span class="keyword">else</span>
self.animation:<span class="function-name">setState</span>(self.animation.idle, <span class="keyword">false</span>, self.animation.turn)
<span class="keyword">end</span>
<span class="keyword">else</span>
self.animation:<span class="function-name">setState</span>(self.animation.jump, <span class="keyword">false</span>, self.animation.float)
<span class="keyword">end</span>
groundedLastFrame = grounded
<span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "animation:draw"></a>
<span class="item-name">animation:draw([__x=0[, __y=0[, __advance=true]]])<span>
</dt>
<dd>
Draw the current frame. </p>
<p> When attached to a NobleSprite, this is called by <code>NobleSprite:draw()</code> when added to a scene. For non-NobleSprite sprites, put this method inside your sprite's <code>draw()</code> method, or inside <a href="../classes/NobleScene.html#noblescene:update">NobleScene:update</a>.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__x</span>
<span class="types"><span class="type">number</span></span>
<span class="default">= <span class="value">0</span> (default)</span>
<br/>
</li>
<li><span class="parameter">__y</span>
<span class="types"><span class="type">number</span></span>
<span class="default">= <span class="value">0</span> (default)</span>
<br/>
</li>
<li><span class="parameter">__advance</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Advances to the next frame after drawing this one. Noble.Animation is frame-based, not "delta time"-based, so its speed is dependent on your game's framerate.
</li>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> MySprite:<span class="function-name">draw</span>()
animation:<span class="function-name">draw</span>()
<span class="keyword">end</span></pre>
<pre class="example"><span class="keyword">function</span> MyScene:<span class="function-name">update</span>()
animation:<span class="function-name">draw</span>(<span class="number">100</span>,<span class="number">100</span>)
<span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "animation:drawFrame"></a>
<span class="item-name">animation:drawFrame(__frameNumber[, __stateName=self.currentName[, __x=0[, __y=0[, __direction=self.direction]]]])<span>
</dt>
<dd>
Sometimes, you just want to draw a specific frame.
Use this for objects or sprites that you want to control outside of update loops, such as score counters, flipbook-style objects that respond to player input, etc.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__frameNumber</span>
<span class="types"><span class="type">integer</span></span>
<br/>
The frame to draw from the current state. This is not an imagetable index. Entering <code>1</code> will draw the selected state's <code>startFrame</code>.
</li>
<li><span class="parameter">__stateName</span>
<span class="types"><span class="type">string</span></span>
<span class="default">= <span class="value">self.currentName</span> (default)</span>
<br/>
The specific state to pull the __frameNumber from.
</li>
<li><span class="parameter">__x</span>
<span class="types"><span class="type">number</span></span>
<span class="default">= <span class="value">0</span> (default)</span>
<br/>
</li>
<li><span class="parameter">__y</span>
<span class="types"><span class="type">number</span></span>
<span class="default">= <span class="value">0</span> (default)</span>
<br/>
</li>
<li><span class="parameter">__direction</span>
<span class="default">= <span class="value">self.direction</span> (default)</span>
<br/>
Override the current direction.
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Constants"></a>Constants </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "Noble.Animation.DIRECTION_RIGHT"></a>
<span class="item-name">Noble.Animation.DIRECTION_RIGHT<span>
</dt>
<dd>
A re-contextualized instance of <code>playdate.graphics.kImageUnflipped</code>
</dd>
<dt>
<a name = "Noble.Animation.DIRECTION_LEFT"></a>
<span class="item-name">Noble.Animation.DIRECTION_LEFT<span>
</dt>
<dd>
A re-contextualized instance of <code>playdate.graphics.kImageFlippedX</code>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,188 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-module">
<h2>Noble.Bonk</h2>
<ul>
<h3>Functions</h3>
<ul>
<li><a href="#Noble.Bonk.startCheckingDebugBonks">.startCheckingDebugBonks</a></li>
<li><a href="#Noble.Bonk.stopCheckingDebugBonks">.stopCheckingDebugBonks</a></li>
<li><a href="#Noble.Bonk.disableDebugBonkChecking">.disableDebugBonkChecking</a></li>
<li><a href="#Noble.Bonk.checkingDebugBonks">.checkingDebugBonks</a></li>
<li><a href="#Noble.Bonk.checkDebugBonks">.checkDebugBonks</a></li>
</ul>
</ul>
</div>
<div class="nav-modules">
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><span class="selected">Noble.Bonk</span></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><a href="../modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>Noble.Bonk</h1>
<p>Engine-specific error handling.</p>
<p> Noble Engine overrides/supersedes some Playdate SDK behavior. A "bonk" is what happens when your game breaks the engine.</p>
<p> Most bonks will throw during normal operation, but others ("debug bonks") introduce some execution overhead so are not
checked by default.</p>
<hr/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<!-- -->
<dl class="function">
<dt>
<a name = "Noble.Bonk.startCheckingDebugBonks"></a>
<span class="item-name">Noble.Bonk.startCheckingDebugBonks()<span>
</dt>
<dd>
Begin checking for debug bonks, <strong>on every frame</strong>. This introduces needless overhead, so don't do it in a release build.
You can only run this if you ran previously <code>Noble.new()</code> with <code>__enableDebugBonkChecking</code> as true, which you should also not do in a release build.
<h3>See</h3>
<ul>
<a href="../modules/Noble.html#new">Noble.new</a>
</ul>
</dd>
<dt>
<a name = "Noble.Bonk.stopCheckingDebugBonks"></a>
<span class="item-name">Noble.Bonk.stopCheckingDebugBonks()<span>
</dt>
<dd>
Stop checking for debug bonks on every frame. </p>
<p> <strong>NOTE: You can only run this if debug bonk checking is enabled.</strong>
</dd>
<dt>
<a name = "Noble.Bonk.disableDebugBonkChecking"></a>
<span class="item-name">Noble.Bonk.disableDebugBonkChecking()<span>
</dt>
<dd>
Disable the ability to check for debug bonks. It frees up some memory. Once you disable debug bonk checking, you cannot re-enable it.</p>
<p> <strong>NOTE: You can only run this if debug bonk checking is enabled.</strong>
</dd>
<dt>
<a name = "Noble.Bonk.checkingDebugBonks"></a>
<span class="item-name">Noble.Bonk.checkingDebugBonks()<span>
</dt>
<dd>
Are we debug bonk checking for debug bonks?
<h3>Returns</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
</dd>
<dt>
<a name = "Noble.Bonk.checkDebugBonks"></a>
<span class="item-name">Noble.Bonk.checkDebugBonks()<span>
</dt>
<dd>
Manually check for debug bonks.
This method runs every frame when <a href="../modules/Noble.Bonk.html#Noble.Bonk.checkingDebugBonks">checkingDebugBonks</a> is true, but you may call it manually instead.</p>
<p> <strong>NOTE: You can only run this if debug bonk checking is enabled.</strong>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,550 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-module">
<h2>Noble.GameData</h2>
<ul>
<h3>Functions</h3>
<ul>
<li><a href="#Noble.GameData.setup">.setup</a></li>
<li><a href="#Noble.GameData.get">.get</a></li>
<li><a href="#Noble.GameData.set">.set</a></li>
<li><a href="#Noble.GameData.reset">.reset</a></li>
<li><a href="#Noble.GameData.resetAll">.resetAll</a></li>
<li><a href="#Noble.GameData.addSlot">.addSlot</a></li>
<li><a href="#Noble.GameData.deleteSlot">.deleteSlot</a></li>
<li><a href="#Noble.GameData.deleteAllSlots">.deleteAllSlots</a></li>
<li><a href="#Noble.GameData.getTimestamp">.getTimestamp</a></li>
<li><a href="#Noble.GameData.getNumberOfSlots">.getNumberOfSlots</a></li>
<li><a href="#Noble.GameData.getCurrentSlot">.getCurrentSlot</a></li>
<li><a href="#Noble.GameData.save">.save</a></li>
<li><a href="#Noble.GameData.saveAll">.saveAll</a></li>
</ul>
</ul>
</div>
<div class="nav-modules">
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><span class="selected">Noble.GameData</span></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><a href="../modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>Noble.GameData</h1>
<p>Operations for game data / save slots.</p>
<p>
</p>
<hr/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<!-- -->
<dl class="function">
<dt>
<a name = "Noble.GameData.setup"></a>
<span class="item-name">Noble.GameData.setup(__keyValuePairs[, __numberOfSlots=1[, __saveToDisk=true[, __modifyExistingOnKeyChange=true]]])<span>
</dt>
<dd>
Sets up the GameDatas (save slots) for your game, and/or loads any existing GameDatas from disk.
You can only run this once, ideally in your main.lua before you load your first scene.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__keyValuePairs</span>
<span class="types"><span class="type">table</span></span>
<br/>
All the data items for a saved game, and their default values, as key/value pairs. <strong>NOTE:</strong> Do not use "nil" as a value.
</li>
<li><span class="parameter">__numberOfSlots</span>
<span class="types"><span class="type">integer</span></span>
<span class="default">= <span class="value">1</span> (default)</span>
<br/>
If you want multiple save slots, enter an integer here. You can add additional slots later.
</li>
<li><span class="parameter">__saveToDisk</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Saves your default values immediately to disk.
</li>
<li><span class="parameter">__modifyExistingOnKeyChange</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Updates the existing gameData objects on disk if you make changes to your keys (not values) during development or when updating your game.
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.GameData.html#Noble.GameData.addSlot">Noble.GameData.addSlot</a></li>
<li><a href="../modules/Noble.GameData.html#Noble.GameData.deleteSlot">Noble.GameData.deleteSlot</a></li>
</ul>
<h3>Usage</h3>
<pre class="example">Noble.GameData.<span class="function-name">setup</span>(
{
name = <span class="string">""</span>,
checkpointReached = <span class="number">0</span>,
score = <span class="number">0</span>
},
<span class="number">3</span>,
<span class="keyword">true</span>,
<span class="keyword">true</span>
)
Noble.GameData.<span class="function-name">set</span>(<span class="string">"name"</span>, <span class="string">"Game A"</span>, <span class="number">1</span>)
Noble.GameData.<span class="function-name">set</span>(<span class="string">"name"</span>, <span class="string">"Game B"</span>, <span class="number">2</span>)
Noble.GameData.<span class="function-name">set</span>(<span class="string">"name"</span>, <span class="string">"Game C"</span>, <span class="number">3</span>)</pre>
</dd>
<dt>
<a name = "Noble.GameData.get"></a>
<span class="item-name">Noble.GameData.get(__dataItemName[, __gameDataSlot])<span>
</dt>
<dd>
Returns the value of the requested data item.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__dataItemName</span>
<span class="types"><span class="type">string</span></span>
<br/>
The name of the data item.
</li>
<li><span class="parameter">__gameDataSlot</span>
<span class="types"><span class="type">integer</span></span>
<span class="optional">(optional)</span>
<br/>
If set, uses a specific GameData slot. If not, uses the most recently touched GameData slot.
</li>
</ul>
<h3>Returns</h3>
<ol>
<span class="types"><span class="type">any</span></span>
</ol>
<h3>Usage</h3>
<pre class="example">Noble.GameData.<span class="function-name">get</span>(<span class="string">"equippedItem"</span>)</pre>
<pre class="example">Noble.GameData.<span class="function-name">get</span>(<span class="string">"equippedItem"</span>, <span class="number">2</span>)</pre>
</dd>
<dt>
<a name = "Noble.GameData.set"></a>
<span class="item-name">Noble.GameData.set(__dataItemName, __value[, __gameDataSlot[, __saveToDisk=true[, __updateTimestamp=true]]])<span>
</dt>
<dd>
Set the value of a GameData item.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__dataItemName</span>
<span class="types"><span class="type">string</span></span>
<br/>
The name of the data item.
</li>
<li><span class="parameter">__value</span>
<span class="types"><span class="type">any</span></span>
<br/>
The data item's new value
</li>
<li><span class="parameter">__gameDataSlot</span>
<span class="types"><span class="type">integer</span></span>
<span class="optional">(optional)</span>
<br/>
If set, uses a specific GameData slot. If not, uses the most recently touched GameData slot.
</li>
<li><span class="parameter">__saveToDisk</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Saves to disk immediately. Set to false if you prefer to manually save (via a checkpoint or menu).
</li>
<li><span class="parameter">__updateTimestamp</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Sets the timestamp of this GameData to the current time. Leave false to retain existing timestamp.
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../modules/Noble.GameData.html#Noble.GameData.save">Noble.GameData.save</a>
</ul>
<h3>Usage</h3>
<pre class="example">Noble.GameData.<span class="function-name">set</span>(<span class="string">"score"</span>, <span class="number">74205</span>)</pre>
<pre class="example">Noble.GameData.<span class="function-name">set</span>(<span class="string">"score"</span>, Noble.GameData.<span class="function-name">get</span>(<span class="string">"score"</span>) + <span class="number">100</span>)</pre>
</dd>
<dt>
<a name = "Noble.GameData.reset"></a>
<span class="item-name">Noble.GameData.reset(__dataItemName[, __gameDataSlot[, __saveToDisk=true[, __updateTimestamp=true]]])<span>
</dt>
<dd>
Reset a GameData item to its default value, defined in <a href="../modules/Noble.GameData.html#Noble.GameData.setup">setup</a>.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__dataItemName</span>
<span class="types"><span class="type">string</span></span>
<br/>
The name of the data item.
</li>
<li><span class="parameter">__gameDataSlot</span>
<span class="types"><span class="type">integer</span></span>
<span class="optional">(optional)</span>
<br/>
If set, uses a specific GameData slot. If not, uses the most recently touched GameData slot.
</li>
<li><span class="parameter">__saveToDisk</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Saves to disk immediately. Set to false if you prefer to manually save (via a checkpoint or menu).
</li>
<li><span class="parameter">__updateTimestamp</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Resets the timestamp of this GameData to the current time. Leave false to retain existing timestamp.
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../modules/Noble.GameData.html#Noble.GameData.save">Noble.GameData.save</a>
</ul>
</dd>
<dt>
<a name = "Noble.GameData.resetAll"></a>
<span class="item-name">Noble.GameData.resetAll([__gameDataSlot[, __saveToDisk=true[, __updateTimestamp=true]]])<span>
</dt>
<dd>
Reset all values in a GameData slot to the default values, defined in <a href="../modules/Noble.GameData.html#Noble.GameData.setup">setup</a>.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__gameDataSlot</span>
<span class="types"><span class="type">integer</span></span>
<span class="optional">(optional)</span>
<br/>
If set, uses a specific GameData slot. If not, uses the most recently touched GameData slot.
</li>
<li><span class="parameter">__saveToDisk</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Saves to disk immediately. Set to false if you prefer to manually save (via a checkpoint or menu).
</li>
<li><span class="parameter">__updateTimestamp</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Resets the timestamp of this GameData to the current time. Leave false to retain existing timestamp.
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../modules/Noble.GameData.html#Noble.GameData.save">Noble.GameData.save</a>
</ul>
</dd>
<dt>
<a name = "Noble.GameData.addSlot"></a>
<span class="item-name">Noble.GameData.addSlot([__numberToAdd=1[, __saveToDisk=true]])<span>
</dt>
<dd>
Add a save slot to your game. This is useful for games which have arbitrary save slots, or encourage save scumming.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__numberToAdd</span>
<span class="types"><span class="type">integer</span></span>
<span class="default">= <span class="value">1</span> (default)</span>
<br/>
What it says on the tin.
</li>
<li><span class="parameter">__saveToDisk</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Saves to disk immediately. Set to false if you prefer to manually save (via a checkpoint or menu).
</li>
</ul>
<h3>Usage</h3>
<pre class="example">Noble.GameData.<span class="function-name">addSlot</span>()</pre>
<pre class="example">Noble.GameData.<span class="function-name">addSlot</span>(<span class="number">10</span>)</pre>
</dd>
<dt>
<a name = "Noble.GameData.deleteSlot"></a>
<span class="item-name">Noble.GameData.deleteSlot(__gameDataSlot[, __collapseGameDatas=true])<span>
</dt>
<dd>
Deletes a GameData from disk if its save slot is greater than the default number established in <a href="../modules/Noble.GameData.html#Noble.GameData.setup">setup</a>.
Otherwise, resets all data items to default values using <a href="../modules/Noble.GameData.html#Noble.GameData.resetAll">resetAll</a>.</p>
<p> Generally, you won't need this unless you've added save slots using <a href="../modules/Noble.GameData.html#Noble.GameData.addSlot">addSlot</a>. In other cases, use <a href="../modules/Noble.GameData.html#Noble.GameData.resetAll">resetAll</a>.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__gameDataSlot</span>
<span class="types"><span class="type">integer</span></span>
<br/>
The slot holding the GameData to delete. Unlike other methods that take this argument, this is not optional.
</li>
<li><span class="parameter">__collapseGameDatas</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Re-sorts the gameDatas table (and renames existing JSON files on disk) to fill the gap left by the deleted GameData.
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.GameData.html#Noble.GameData.deleteAllSlots">Noble.GameData.deleteAllSlots</a></li>
<li><a href="../modules/Noble.GameData.html#Noble.GameData.addSlot">Noble.GameData.addSlot</a></li>
<li><a href="../modules/Noble.GameData.html#Noble.GameData.resetAll">Noble.GameData.resetAll</a></li>
</ul>
<h3>Usage</h3>
<pre class="example">Noble.GameData.<span class="function-name">deleteSlot</span>(<span class="number">6</span>)</pre>
<pre class="example">Noble.GameData.<span class="function-name">deleteSlot</span>(<span class="number">15</span>, <span class="keyword">false</span>)</pre>
</dd>
<dt>
<a name = "Noble.GameData.deleteAllSlots"></a>
<span class="item-name">Noble.GameData.deleteAllSlots()<span>
</dt>
<dd>
Deletes all GameDatas from disk, except for the number specified in setup, which are reset to default values.
Use this to clear all data as if you were running setup again.
Generally, you don't need this unless you've added save slots using <a href="../modules/Noble.GameData.html#Noble.GameData.addSlot">addSlot</a>. In other cases, use <a href="../modules/Noble.GameData.html#Noble.GameData.resetAll">resetAll</a> on each slot.
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.GameData.html#Noble.GameData.deleteSlot">Noble.GameData.deleteSlot</a></li>
<li><a href="../modules/Noble.GameData.html#Noble.GameData.addSlot">Noble.GameData.addSlot</a></li>
</ul>
</dd>
<dt>
<a name = "Noble.GameData.getTimestamp"></a>
<span class="item-name">Noble.GameData.getTimestamp(__gameDataSlot)<span>
</dt>
<dd>
Returns the timestamp of the requested GameData, as a tuple (local time, GMT time). The timestamp is updated
See Playdate SDK for details on how a time object is formatted. <strong>NOTE: Timestamps are stored internally in GMT.</strong>
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__gameDataSlot</span>
<span class="types"><span class="type">integer</span></span>
<br/>
The GameData slot to get the timestamp of. Unlike other methods that take this argument, this is not optional.
</li>
</ul>
<h3>Returns</h3>
<ol>
<li>
<span class="types"><span class="type">table</span></span>
Local time</li>
<li>
<span class="types"><span class="type">table</span></span>
GMT time</li>
</ol>
<h3>Usage</h3>
<pre class="example">Noble.GameData.<span class="function-name">getTimestamp</span>(<span class="number">1</span>)</pre>
</dd>
<dt>
<a name = "Noble.GameData.getNumberOfSlots"></a>
<span class="item-name">Noble.GameData.getNumberOfSlots()<span>
</dt>
<dd>
Returns the current number of GameData slots.
<h3>Returns</h3>
<ol>
<span class="types"><span class="type">int</span></span>
</ol>
</dd>
<dt>
<a name = "Noble.GameData.getCurrentSlot"></a>
<span class="item-name">Noble.GameData.getCurrentSlot()<span>
</dt>
<dd>
Returns the number of the current GameData slot.
<h3>Returns</h3>
<ol>
<span class="types"><span class="type">int</span></span>
</ol>
</dd>
<dt>
<a name = "Noble.GameData.save"></a>
<span class="item-name">Noble.GameData.save([__gameDataSlot])<span>
</dt>
<dd>
Saves a single GameData to disk. If you want to save all GameDatas, use <a href="../modules/Noble.GameData.html#Noble.GameData.saveAll">saveAll</a> instead.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__gameDataSlot</span>
<span class="types"><span class="type">integer</span></span>
<span class="optional">(optional)</span>
<br/>
If set, uses a specific GameData slot. If not, uses the most recently touched GameData slot.
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../modules/Noble.GameData.html#Noble.GameData.saveAll">Noble.GameData.saveAll</a>
</ul>
<h3>Usage</h3>
<pre class="example">Noble.GameData.<span class="function-name">save</span>()</pre>
<pre class="example">Noble.GameData.<span class="function-name">save</span>(<span class="number">3</span>)</pre>
</dd>
<dt>
<a name = "Noble.GameData.saveAll"></a>
<span class="item-name">Noble.GameData.saveAll()<span>
</dt>
<dd>
Save all GameDatas to disk. If you only have one, or want to save a specific one, use <a href="../modules/Noble.GameData.html#Noble.GameData.save">save</a> instead.
<h3>See</h3>
<ul>
<a href="../modules/Noble.GameData.html#Noble.GameData.save">Noble.GameData.save</a>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,617 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-module">
<h2>Noble.Input</h2>
<ul>
<h3>Functions</h3>
<ul>
<li><a href="#Noble.Input.getHandler">.getHandler</a></li>
<li><a href="#Noble.Input.setHandler">.setHandler</a></li>
<li><a href="#Noble.Input.clearHandler">.clearHandler</a></li>
<li><a href="#Noble.Input.setEnabled">.setEnabled</a></li>
<li><a href="#Noble.Input.getEnabled">.getEnabled</a></li>
<li><a href="#Noble.Input.setCrankIndicatorStatus">.setCrankIndicatorStatus</a></li>
<li><a href="#Noble.Input.getCrankIndicatorStatus">.getCrankIndicatorStatus</a></li>
<li><a href="#Noble.Input.getOrientation">.getOrientation</a></li>
</ul>
<h3>Constants
</h3>
<ul>
<li><a href="#Noble.Input.BUTTON_A">.BUTTON_A</a></li>
<li><a href="#Noble.Input.BUTTON_B">.BUTTON_B</a></li>
<li><a href="#Noble.Input.BUTTON_MENU">.BUTTON_MENU</a></li>
<li><a href="#Noble.Input.DPAD">.DPAD</a></li>
<li><a href="#Noble.Input.DPAD_HORIZONTAL">.DPAD_HORIZONTAL</a></li>
<li><a href="#Noble.Input.DPAD_VERTICAL">.DPAD_VERTICAL</a></li>
<li><a href="#Noble.Input.DPAD_UP">.DPAD_UP</a></li>
<li><a href="#Noble.Input.DPAD_DOWN">.DPAD_DOWN</a></li>
<li><a href="#Noble.Input.DPAD_LEFT">.DPAD_LEFT</a></li>
<li><a href="#Noble.Input.DPAD_RIGHT">.DPAD_RIGHT</a></li>
<li><a href="#Noble.Input.CRANK">.CRANK</a></li>
<li><a href="#Noble.Input.CRANK_FORWARD">.CRANK_FORWARD</a></li>
<li><a href="#Noble.Input.CRANK_REVERSE">.CRANK_REVERSE</a></li>
<li><a href="#Noble.Input.CRANK_DOCK">.CRANK_DOCK</a></li>
<li><a href="#Noble.Input.CRANK_UNDOCK">.CRANK_UNDOCK</a></li>
<li><a href="#Noble.Input.ORIENTATION_UP">.ORIENTATION_UP</a></li>
</ul>
</ul>
</div>
<div class="nav-modules">
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><span class="selected">Noble.Input</span></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><a href="../modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>Noble.Input</h1>
<p>A complete encapsulation of the Playdate's input system.</p>
<p> The Playdate SDK gives developers multiple ways to manage input. Noble Engine's approach revolves around the SDK's "inputHandlers," extending them to include additional input methods, and pull in other hardware functions that the SDK puts elsewhere. See usage below for the full list of supported methods.
<br><br>By default, Noble Engine assumes each scene will have an inputManager assigned to it. So, for example, you can define one inputManager for menu screens and another for gameplay scenes in your <code>main.lua</code>, and then in each scene, set which one that scene uses. You can instead define a unique inputHandler in each scene.
<br><br>You may also create and manage inputManagers within and outside of scenes. When a NobleScene is loaded, its inputHandler will become active, thus, inputHandlers do not carry across scenes, and all input is suspended during scene transitions. An advanced use-case is to leave a scene's inputHandler as nil, and manage it separately.
<br><br><strong>NOTE:</strong> While the Playdate SDK allows you to stack as many inputHandlers as you want, Noble Engine assumes only one <em>active</em> inputHandler at a time. You may still manually call <code>playdate.inputHandlers.push()</code> and <code>playdate.inputHandlers.pop()</code> yourself, but Noble Engine will not know about it and it may cause unexpected behavior.
<br><br>In addition, you may directly query button status using the SDK's methods for that, but it is not advised to use that as the primary way to manage input for Noble Engine projects, because much of Noble.Input's functionality will not apply.</p>
<h3>See</h3>
<ul>
<a href="../classes/NobleScene.html#noblescene.inputHandler">NobleScene.inputHandler</a>
</ul>
<h3>Usage</h3>
<pre class="example">local myInputHandler = {
AButtonDown = function() end, -- Fires once when button is pressed down.
AButtonHold = function() end, -- Fires each frame while a button is held (Noble Engine implementation).
AButtonHeld = function() end, -- Fires once after button is held for 1 second (available for A and B).
AButtonUp = function() end, -- Fires once when button is released.
BButtonDown = function() end,
BButtonHold = function() end,
BButtonHeld = function() end,
BButtonUp = function() end,
downButtonDown = function() end,
downButtonHold = function() end,
downButtonUp = function() end,
leftButtonDown = function() end,
leftButtonHold = function() end,
leftButtonUp = function() end,
rightButtonDown = function() end,
rightButtonHold = function() end,
rightButtonUp = function() end,
upButtonDown = function() end,
upButtonHold = function() end
upButtonUp = function() end,
cranked = function(change, acceleratedChange) end, -- See Playdate SDK.
crankDocked = function() end, -- Noble Engine implementation.
crankUndocked = function() end, -- Noble Engine implementation.
orientationChanged = function() end -- Noble Engine implementation.
}
</pre>
<hr/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<!-- -->
<dl class="function">
<dt>
<a name = "Noble.Input.getHandler"></a>
<span class="item-name">Noble.Input.getHandler()<span>
</dt>
<dd>
Get the currently active input handler. Returns nil if none are active.
<h3>Returns</h3>
<ol>
<span class="types"><span class="type">table</span></span>
A table of callbacks which handle input events.
</ol>
<h3>See</h3>
<ul>
<a href="../classes/NobleScene.html#noblescene.inputHandler">NobleScene.inputHandler</a>
</ul>
</dd>
<dt>
<a name = "Noble.Input.setHandler"></a>
<span class="item-name">Noble.Input.setHandler([__inputHandler=nil])<span>
</dt>
<dd>
Use this to change the active inputHandler.
<br><br>Enter <code>nil</code> to disable input. Use <a href="../modules/Noble.Input.html#Noble.Input.setEnabled">Noble.Input.setEnabled</a> to disable/enable input without losing track of the current inputHandler.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__inputHandler</span>
<span class="types"><span class="type">table</span></span>
<span class="default">= <span class="value">nil</span> (default)</span>
<br/>
A table of callbacks which handle input events.
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../classes/NobleScene.html#noblescene.inputHandler">NobleScene.inputHandler</a></li>
<li><a href="../modules/Noble.Input.html#Noble.Input.clearHandler">Noble.Input.clearHandler</a></li>
<li><a href="../modules/Noble.Input.html#Noble.Input.setEnabled">Noble.Input.setEnabled</a></li>
</ul>
</dd>
<dt>
<a name = "Noble.Input.clearHandler"></a>
<span class="item-name">Noble.Input.clearHandler()<span>
</dt>
<dd>
A helper function that calls Noble.Input.setHandler() with no argument.
<h3>See</h3>
<ul>
<a href="../modules/Noble.Input.html#Noble.Input.setHandler">Noble.Input.setHandler</a>
</ul>
</dd>
<dt>
<a name = "Noble.Input.setEnabled"></a>
<span class="item-name">Noble.Input.setEnabled(__value)<span>
</dt>
<dd>
Enable and disable user input without dealing with inputHanders.
The Playdate SDK requires removing all inputHanders to halt user input, so while the currentHandler is cleared when <code>false</code> is passed to this method,
it is cached so it can be later re-enabled by passing <code>true</code> it.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__value</span>
<span class="types"><span class="type">boolean</span></span>
<br/>
Set to false to halt input. Set to true to resume accepting input.
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.Input.html#Noble.Input.getHandler">Noble.Input.getHandler</a></li>
<li><a href="../modules/Noble.Input.html#Noble.Input.clearHandler">Noble.Input.clearHandler</a></li>
</ul>
</dd>
<dt>
<a name = "Noble.Input.getEnabled"></a>
<span class="item-name">Noble.Input.getEnabled()<span>
</dt>
<dd>
Checks to see that there is an active inputHandler
<h3>Returns</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
Returns true if the input system is enabled. Returns false if <code>setEnabled(false)</code> was used, or if currentHandler is <code>nil</code>.
</ol>
</dd>
<dt>
<a name = "Noble.Input.setCrankIndicatorStatus"></a>
<span class="item-name">Noble.Input.setCrankIndicatorStatus(__active[, __evenWhenUndocked=false])<span>
</dt>
<dd>
Enable/disable on-screen system crank indicator. </p>
<p> <strong>NOTE: The indicator will only ever show if the crank is docked, unless <code>__evenWhenUndocked</code> is true.</strong>
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__active</span>
<span class="types"><span class="type">boolean</span></span>
<br/>
Set true to start showing the on-screen crank indicator. Set false to stop showing it.
</li>
<li><span class="parameter">__evenWhenUndocked</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
Set true to show the crank indicator even if the crank is already undocked (<code>__active</code> must also be true).
</li>
</ul>
</dd>
<dt>
<a name = "Noble.Input.getCrankIndicatorStatus"></a>
<span class="item-name">Noble.Input.getCrankIndicatorStatus()<span>
</dt>
<dd>
Checks whether the system crank indicator status. Returns a tuple.
<h3>Returns</h3>
<ol>
<li>
<span class="types"><span class="type">bool</span></span>
Is the crank indicator active?</li>
<li>
<span class="types"><span class="type">bool</span></span>
Is the crank indicator being forced when active, even when the crank is undocked?</li>
</ol>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Input.html#Noble.Input.setCrankIndicatorStatus">Noble.Input.setCrankIndicatorStatus</a>
</ul>
</dd>
<dt>
<a name = "Noble.Input.getOrientation"></a>
<span class="item-name">Noble.Input.getOrientation([__getStoredValues=false])<span>
</dt>
<dd>
Checks the current display orientation of the device. Returns a tuple.
If the accelerometer is not currently enabled, this method will turn it on, return current values, and then turn it off.
If you are trying to get raw accelerometer values rather than the display orientation, you may want to use <code>playdate.readAccelerometer()</code> instead.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__getStoredValues</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
If true, this method will simply return the most recently stored values, rather than use the accelerometer to check for new ones.
</li>
</ul>
<h3>Returns</h3>
<ol>
<li>
<span class="types"><span class="type">str</span></span>
The named orientation of the device (a pseudo enum Noble.Input.ORIENTATION_XX)</li>
<li>
<span class="types"><span class="type">list</span></span>
Accelerometer values, where list[1] is x, list[2] is y and list[3] is z</li>
</ol>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Input.html#Noble.Input.ORIENTATION_UP">Noble.Input.ORIENTATION_UP</a>
</ul>
</dd>
</dl>
<h2 class="section-header has-description"><a name="Constants"></a>Constants
</h2>
<!-- -->
<div class="section-description">
A set of constants referencing device inputs, stored as strings. Can be used for querying button input,
but are mainly for on-screen prompts or other elements where a string literal is useful, such as a filename, GameData value, or localization key.
For faster performance, use the ones that exist in the Playdate SDK (i.e.: <code>playdate.kButtonA</code>), which are stored as binary numbers.
</div>
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> <span class="function-name">newPrompt</span>(__input, __promptString)
<span class="comment">-- ...
</span> <span class="keyword">local</span> icon = Graphics.image.<span class="function-name">new</span>(<span class="string">"assets/images/UI/Icon_"</span> .. __input)
<span class="comment">-- ...
</span><span class="keyword">end</span>
promptMove = <span class="function-name">newPrompt</span>(Noble.Input.DPAD_HORIZONTAL, <span class="string">"Move!"</span>) <span class="comment">-- assets/images/UI/Icon_dPadHorizontal.png"
</span>promptJump = <span class="function-name">newPrompt</span>(Noble.Input.BUTTON_A, <span class="string">"Jump!"</span>) <span class="comment">-- assets/images/UI/Icon_buttonA.png"
</span>promptCharge = <span class="function-name">newPrompt</span>(Noble.Input.CRANK_FORWARD, <span class="string">"Charge the battery!"</span>) <span class="comment">-- assets/images/UI/Icon_crankForward.png"</span></pre>
<dl class="function">
<dt>
<a name = "Noble.Input.BUTTON_A"></a>
<span class="item-name">Noble.Input.BUTTON_A<span>
</dt>
<dd>
<code>&quot;buttonA&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.BUTTON_B"></a>
<span class="item-name">Noble.Input.BUTTON_B<span>
</dt>
<dd>
<code>&quot;buttonB&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.BUTTON_MENU"></a>
<span class="item-name">Noble.Input.BUTTON_MENU<span>
</dt>
<dd>
The system menu button. </p>
<p> <code>&quot;buttonMenu&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.DPAD"></a>
<span class="item-name">Noble.Input.DPAD<span>
</dt>
<dd>
Referencing the D-pad component itself, rather than an input. </p>
<p> <code>&quot;dPad&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.DPAD_HORIZONTAL"></a>
<span class="item-name">Noble.Input.DPAD_HORIZONTAL<span>
</dt>
<dd>
Referencing the left and right input D-pad inputs. </p>
<p> <code>&quot;dPadHorizontal&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.DPAD_VERTICAL"></a>
<span class="item-name">Noble.Input.DPAD_VERTICAL<span>
</dt>
<dd>
Referencing the up and down input D-pad inputs. </p>
<p> <code>&quot;dPadVertical&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.DPAD_UP"></a>
<span class="item-name">Noble.Input.DPAD_UP<span>
</dt>
<dd>
<code>&quot;dPadUp&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.DPAD_DOWN"></a>
<span class="item-name">Noble.Input.DPAD_DOWN<span>
</dt>
<dd>
<code>&quot;dPadDown&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.DPAD_LEFT"></a>
<span class="item-name">Noble.Input.DPAD_LEFT<span>
</dt>
<dd>
<code>&quot;dPadLeft&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.DPAD_RIGHT"></a>
<span class="item-name">Noble.Input.DPAD_RIGHT<span>
</dt>
<dd>
<code>&quot;dPadRight&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.CRANK"></a>
<span class="item-name">Noble.Input.CRANK<span>
</dt>
<dd>
Referencing the crank component itself, rather than an input. </p>
<p> <code>&quot;crank&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.CRANK_FORWARD"></a>
<span class="item-name">Noble.Input.CRANK_FORWARD<span>
</dt>
<dd>
AKA: Clockwise. See Playdate SDK.</p>
<p> <code>&quot;crankForward&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.CRANK_REVERSE"></a>
<span class="item-name">Noble.Input.CRANK_REVERSE<span>
</dt>
<dd>
AKA: Anticlockwise. See Playdate SDK.</p>
<p> <code>&quot;crankReverse&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.CRANK_DOCK"></a>
<span class="item-name">Noble.Input.CRANK_DOCK<span>
</dt>
<dd>
Referencing the action of docking the crank. </p>
<p> <code>&quot;crankDock&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.CRANK_UNDOCK"></a>
<span class="item-name">Noble.Input.CRANK_UNDOCK<span>
</dt>
<dd>
Referencing the action of undocking the crank. </p>
<p> <code>&quot;crankUndock&quot;</code>
</dd>
<dt>
<a name = "Noble.Input.ORIENTATION_UP"></a>
<span class="item-name">Noble.Input.ORIENTATION_UP<span>
</dt>
<dd>
Referencing the display orientations. </p>
<p> <code>&quot;orientationUp&quot;</code>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,928 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-module">
<h2>Noble.Menu</h2>
<ul>
<h3>Setup </h3>
<ul>
<li><a href="#Noble.Menu.new">.new</a></li>
<li><a href="#menu:addItem">menu:addItem</a></li>
<li><a href="#menu:removeItem">menu:removeItem</a></li>
</ul>
<h3>Properties </h3>
<ul>
<li><a href="#menu.localized">menu.localized</a></li>
<li><a href="#menu.currentItemNumber">menu.currentItemNumber</a></li>
<li><a href="#menu.currentItemName">menu.currentItemName</a></li>
<li><a href="#menu.width">menu.width</a></li>
</ul>
<h3>Methods </h3>
<ul>
<li><a href="#menu:activate">menu:activate</a></li>
<li><a href="#menu:deactivate">menu:deactivate</a></li>
<li><a href="#menu:isActive">menu:isActive</a></li>
<li><a href="#menu:selectPrevious">menu:selectPrevious</a></li>
<li><a href="#menu:selectNext">menu:selectNext</a></li>
<li><a href="#menu:select">menu:select</a></li>
<li><a href="#menu:click">menu:click</a></li>
<li><a href="#menu:getItemDisplayName">menu:getItemDisplayName</a></li>
<li><a href="#menu:setItemDisplayName">menu:setItemDisplayName</a></li>
</ul>
<h3>Tables </h3>
<ul>
<li><a href="#menu.itemNames">menu.itemNames</a></li>
<li><a href="#menu.clickHandlers">menu.clickHandlers</a></li>
<li><a href="#menu.itemPositions">menu.itemPositions</a></li>
<li><a href="#menu.itemWidths">menu.itemWidths</a></li>
</ul>
<h3>Drawing </h3>
<ul>
<li><a href="#menu:draw">menu:draw</a></li>
<li><a href="#menu:drawItem">menu:drawItem</a></li>
<li><a href="#menu:drawSelectedItem">menu:drawSelectedItem</a></li>
</ul>
</ul>
</div>
<div class="nav-modules">
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><span class="selected">Noble.Menu</span></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><a href="../modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>Noble.Menu</h1>
<p>An extended implementation of <code>playdate.ui.gridview</code>, meant for 1-dimensional, single-screen text menus.</p>
<p>
</p>
<hr/>
<h2 class="section-header "><a name="Setup"></a>Setup </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "Noble.Menu.new"></a>
<span class="item-name">Noble.Menu.new([__activate=true[, __alignment=Noble.Text.ALIGN_LEFT[, __localized=false[, __color=Graphics.kColorBlack[, __padding=2[, __horizontalPadding[, __margin=2[, __font=Noble.Text.getCurrentFont()[, __selectedCornerRadius=__font:getHeight()/4[, __selectedOutlineThickness=1]]]]]]]]]])<span>
</dt>
<dd>
Create a new menu object.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__activate</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
<a href="../modules/Noble.Menu.html#menu:activate">Activate</a> this menu upon creation.
</li>
<li><span class="parameter">__alignment</span>
<span class="default">= <span class="value">Noble.Text.ALIGN_LEFT</span> (default)</span>
<br/>
The text alignment of menu items.
</li>
<li><span class="parameter">__localized</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
If true, menu item names are localization keys rather than display names.
</li>
<li><span class="parameter">__color</span>
<span class="default">= <span class="value">Graphics.kColorBlack</span> (default)</span>
<br/>
The color of menu item text. The selected highlight will be the inverse color.
</li>
<li><span class="parameter">__padding</span>
<span class="types"><span class="type">integer</span></span>
<span class="default">= <span class="value">2</span> (default)</span>
<br/>
Cell padding for menu items.
</li>
<li><span class="parameter">__horizontalPadding</span>
<span class="types"><span class="type">integer</span></span>
<span class="optional">(optional)</span>
<br/>
Use this to override horizontal padding, useful for certain fonts. If nil, uses __padding.
</li>
<li><span class="parameter">__margin</span>
<span class="types"><span class="type">integer</span></span>
<span class="default">= <span class="value">2</span> (default)</span>
<br/>
Spacing between menu items.
</li>
<li><span class="parameter">__font</span>
<span class="default">= <span class="value">Noble.Text.getCurrentFont()</span> (default)</span>
<br/>
If nil, uses current set font.
</li>
<li><span class="parameter">__selectedCornerRadius</span>
<span class="types"><span class="type">integer</span></span>
<span class="default">= <span class="value">__font:getHeight()/4</span> (default)</span>
<br/>
Sets rounded corners for a selected menu item.
</li>
<li><span class="parameter">__selectedOutlineThickness</span>
<span class="types"><span class="type">integer</span></span>
<span class="default">= <span class="value">1</span> (default)</span>
<br/>
Sets the outline thickness for selected items.
</li>
</ul>
<h3>Returns</h3>
<ol>
<code>menu</code>, a new menu item.
</ol>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Menu.html#menu:addItem">addItem</a>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="keyword">local</span> menu = Noble.Menu.<span class="function-name">new</span>(
<span class="keyword">true</span>,
Noble.Text.ALIGN_CENTER,
<span class="keyword">false</span>,
Graphics.kColorWhite,
<span class="number">4</span>, <span class="number">6</span>,
Noble.Text.large,
<span class="keyword">nil</span>, <span class="number">3</span>
)
menu:<span class="function-name">addItem</span>(<span class="string">"Play Game"</span>, <span class="keyword">function</span>() TitleScreen:<span class="function-name">playGame</span>() <span class="keyword">end</span>)
menu:<span class="function-name">addItem</span>(<span class="string">"Options"</span>, <span class="keyword">function</span>() Noble.<span class="function-name">transition</span>(OptionsScreen) <span class="keyword">end</span>)
menu:<span class="function-name">addItem</span>(<span class="string">"Credits"</span>, <span class="keyword">function</span>() Noble.<span class="function-name">transition</span>(CreditsScreen) <span class="keyword">end</span>)</pre>
</dd>
<dt>
<a name = "menu:addItem"></a>
<span class="item-name">menu:addItem(__nameOrKey[, __clickHandler[, __position[, __displayName[, __displayNameIsALocalizationKey=false]]]])<span>
</dt>
<dd>
Adds a item to this menu.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__nameOrKey</span>
<span class="types"><span class="type">string</span></span>
<br/>
The name of this menu item. It can be a display name or a localization key. <strong>Must be unique.</strong>
</li>
<li><span class="parameter">__clickHandler</span>
<span class="types"><span class="type">function</span></span>
<span class="optional">(optional)</span>
<br/>
The function that runs when this menu item is "clicked."
</li>
<li><span class="parameter">__position</span>
<span class="types"><span class="type">integer</span></span>
<span class="optional">(optional)</span>
<br/>
Insert the item at a specific position. If not set, adds to the end of the list.
</li>
<li><span class="parameter">__displayName</span>
<span class="types"><span class="type">string</span></span>
<span class="optional">(optional)</span>
<br/>
You can create an optional, separate display name for this item. You can add or change this at runtime via <a href="../modules/Noble.Menu.html#menu:setItemDisplayName">setItemDisplayName</a>.
</li>
<li><span class="parameter">__displayNameIsALocalizationKey</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
If true, will treat the <code>__displayName</code> as a localization key. This is separate from this menu's <a href="../modules/Noble.Menu.html#menu.localized">localized</a> value.
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.Menu.html#Noble.Menu.new">Noble.Menu.new</a></li>
<li><a href="../modules/Noble.Menu.html#menu:removeItem">removeItem</a></li>
<li><a href="../modules/Noble.Menu.html#menu:setItemDisplayName">setItemDisplayName</a></li>
</ul>
</dd>
<dt>
<a name = "menu:removeItem"></a>
<span class="item-name">menu:removeItem([__menuItem=#menu.itemNames])<span>
</dt>
<dd>
Removes a item from this menu.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__menuItem</span>
<span class="types"><span class="type">int</span> or <span class="type">string</span></span>
<span class="default">= <span class="value">#menu.itemNames</span> (default)</span>
<br/>
The menu item to remove. You can enter either the item's name/key or it's position. If left blank, removes the last item.
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Menu.html#menu:addItem">addItem</a>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Properties"></a>Properties </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "menu.localized"></a>
<span class="item-name">menu.localized<span>
</dt>
<dd>
<ul class="parameters">
<li><span class="parameter">_</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
Indicates whether this menu's item names are treated as localization keys.
</li>
</ul>
</dd>
<dt>
<a name = "menu.currentItemNumber"></a>
<span class="item-name">menu.currentItemNumber<span>
</dt>
<dd>
<ul class="parameters">
<li><span class="parameter">_</span>
<span class="types"><span class="type">integer</span></span>
<br/>
The current menu item's index.</p>
<p> This is meant as a <strong>read-only</strong> value. Do not modify it directly.
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Menu.html#menu:select">select</a>
</ul>
</dd>
<dt>
<a name = "menu.currentItemName"></a>
<span class="item-name">menu.currentItemName<span>
</dt>
<dd>
<ul class="parameters">
<li><span class="parameter">_</span>
<span class="types"><span class="type">string</span></span>
<br/>
The current menu item's name.</p>
<p> This is meant as a <strong>read-only</strong> value. Do not modify it directly.
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Menu.html#menu:select">select</a>
</ul>
</dd>
<dt>
<a name = "menu.width"></a>
<span class="item-name">menu.width<span>
</dt>
<dd>
<ul class="parameters">
<li><span class="parameter">_</span>
<span class="types"><span class="type">integer</span></span>
<br/>
The width of the widest menu item plus the menu's horizontal padding.</p>
<p> This is meant as a <strong>read-only</strong> value. Do not modify it directly.
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Methods"></a>Methods </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "menu:activate"></a>
<span class="item-name">menu:activate()<span>
</dt>
<dd>
Activate this menu.
This selects the most recently selected menu item (or the first item if none have been previously selected), and enables this menu's <a href="../modules/Noble.Menu.html#menu:selectPrevious">selectPrevious</a>, <a href="../modules/Noble.Menu.html#menu:selectNext">selectNext</a>, and <a href="../modules/Noble.Menu.html#menu:click">click</a> methods.
<h3>Usage</h3>
<pre class="example"><span class="keyword">local</span> menu = Noble.Menu.<span class="function-name">new</span>(<span class="keyword">false</span>)
menu:<span class="function-name">activate</span>()</pre>
</dd>
<dt>
<a name = "menu:deactivate"></a>
<span class="item-name">menu:deactivate()<span>
</dt>
<dd>
Deactivate this menu.
This deselects all menu items, and disables this menu's <a href="../modules/Noble.Menu.html#menu:selectPrevious">selectPrevious</a>, <a href="../modules/Noble.Menu.html#menu:selectNext">selectNext</a>, and <a href="../modules/Noble.Menu.html#menu:click">click</a> methods.
<h3>Usage</h3>
<pre class="example"><span class="keyword">local</span> menu = Noble.Menu.<span class="function-name">new</span>(<span class="keyword">true</span>)
menu:<span class="function-name">deactivate</span>()</pre>
</dd>
<dt>
<a name = "menu:isActive"></a>
<span class="item-name">menu:isActive()<span>
</dt>
<dd>
Check to see if this menu is currently active.
<h3>Returns</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
</dd>
<dt>
<a name = "menu:selectPrevious"></a>
<span class="item-name">menu:selectPrevious([__force=false[, __wrapSelection=true]])<span>
</dt>
<dd>
Selects the previous item in this menu. <strong>This menu must be active.</strong>
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__force</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
Force this method to run, even if this menu is not active.
</li>
<li><span class="parameter">__wrapSelection</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Selects the final menu item if the first menu item is currently selected.
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Menu.html#menu:activate">activate</a>
</ul>
<h3>Usage</h3>
<pre class="example">TitleScreen.inputHandler.upButtonDown = <span class="keyword">function</span>()
menu:<span class="function-name">selectPrevious</span>()
<span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "menu:selectNext"></a>
<span class="item-name">menu:selectNext([__force=false[, __wrapSelection=true]])<span>
</dt>
<dd>
Selects the next previous item in this menu. <strong>This menu must be active.</strong>
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__force</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
Force this method to run, even if this menu is not active.
</li>
<li><span class="parameter">__wrapSelection</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Selects the first menu item if the final menu item is currently selected.
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Menu.html#menu:activate">activate</a>
</ul>
<h3>Usage</h3>
<pre class="example">TitleScreen.inputHandler.downButtonDown = <span class="keyword">function</span>()
menu:<span class="function-name">selectNext</span>()
<span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "menu:select"></a>
<span class="item-name">menu:select(__menuItem[, __force=false])<span>
</dt>
<dd>
Selects a specific item in this menu, either by it's index, or it's name. <strong>This menu must be active.</strong>
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__menuItem</span>
<span class="types"><span class="type">int</span> or <span class="type">string</span></span>
<br/>
The menu item to select. You can enter the item's number or it's name/key.
</li>
<li><span class="parameter">__force</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
Force this method to run, even if this menu is not active.
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Menu.html#menu:activate">activate</a>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> <span class="function-name">resetMenu</span>()
menu:<span class="global">select</span>(<span class="number">1</span>, <span class="keyword">true</span>)
menu:<span class="function-name">deactivate</span>()
<span class="keyword">end</span></pre>
<pre class="example"><span class="keyword">function</span> <span class="function-name">resetMenu</span>()
menu:<span class="global">select</span>(<span class="string">"Play Game"</span>, <span class="keyword">true</span>)
menu:<span class="function-name">deactivate</span>()
<span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "menu:click"></a>
<span class="item-name">menu:click([__force=false])<span>
</dt>
<dd>
Runs the function associated with the currently selected menu item. <strong>This menu must be active.</strong>
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__force</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
Force this method to run, even if this menu is not active.
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Menu.html#menu:activate">activate</a>
</ul>
<h3>Usage</h3>
<pre class="example">TitleScreen.inputHandler.AButtonDown = <span class="keyword">function</span>()
menu:<span class="function-name">click</span>()
<span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "menu:getItemDisplayName"></a>
<span class="item-name">menu:getItemDisplayName(__itemName)<span>
</dt>
<dd>
Gets the display name of a menu item. </p>
<p> If a menu item does not have a display name, then the <code>__nameOrKey</code> (or its localized string) will be returned instead. This method is used internally when <a href="../modules/Noble.Menu.html#menu:draw">draw</a> is called.</p>
<p> If this menu's <a href="../modules/Noble.Menu.html#menu.localized">localized</a> value is true, a returned <code>__nameOrKey</code> will always be localized, but a returned display name is only localized if the <code>__displayNameIsALocalizationKey</code> argument was set to <code>true</code> when the display name was added.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__itemName</span>
<span class="types"><span class="type">string</span></span>
<br/>
The menu item you want the display name of.
</li>
</ul>
<h3>Returns</h3>
<ol>
<span class="types"><span class="type">string</span></span>
</ol>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.Menu.html#menu:addItem">addItem</a></li>
<li><a href="../modules/Noble.Menu.html#menu:setItemDisplayName">setItemDisplayName</a></li>
</ul>
</dd>
<dt>
<a name = "menu:setItemDisplayName"></a>
<span class="item-name">menu:setItemDisplayName(__itemName, __displayName[, __displayNameIsALocalizationKey=false])<span>
</dt>
<dd>
When you add a menu item, you can give it a display name that's different from it's actual name. This method adds or changes the display name of a menu item.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__itemName</span>
<span class="types"><span class="type">string</span></span>
<br/>
The menu item name (or key if this menu uses localization keys).
</li>
<li><span class="parameter">__displayName</span>
<span class="types"><span class="type">string</span></span>
<br/>
The display name.
</li>
<li><span class="parameter">__displayNameIsALocalizationKey</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
Set to use to indicate that this display name is a localization key. This setting is separate from <a href="../modules/Noble.Menu.html#menu.localized">localized</a>
</li>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> <span class="function-name">changeDifficultyLevel</span>(__level)
menu:<span class="function-name">setItemDisplayName</span>(<span class="string">"Difficulty"</span>, <span class="string">"Difficulty: "</span> .. __level)
<span class="keyword">end</span></pre>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "menu.itemNames"></a>
<span class="item-name">menu.itemNames<span>
</dt>
<dd>
A string "array" of menu item strings/keys.
<strong>You cannot add or remove menu items by modifying this table</strong>.
It is meant as a <strong>read-only</strong> table, provided for convenience when iterating, etc. Modifying its values may break other methods.
<h3>See</h3>
<ul>
<a href="../modules/Noble.Menu.html#menu:addItem">addItem</a>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="keyword">for</span> i = <span class="number">1</span>, #menu.itemNames, <span class="number">1</span> <span class="keyword">do</span>
menu.clickHandlers[menu.itemNames[i]] = <span class="keyword">nil</span> <span class="comment">-- Clears all click handlers, for some reason.
</span><span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "menu.clickHandlers"></a>
<span class="item-name">menu.clickHandlers<span>
</dt>
<dd>
A table of functions associated with menu items. Items are a defined when calling <a href="../modules/Noble.Menu.html#menu:addItem">addItem</a>, but their associated functions may be modified afterward.</p>
<p> <strong>You cannot add or remove menu items by modifying this table</strong>.
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.Menu.html#menu:addItem">addItem</a></li>
<li><a href="../modules/Noble.Menu.html#menu:removeItem">removeItem</a></li>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="keyword">local</span> menu = Noble.Menu.<span class="function-name">new</span>(<span class="keyword">true</span>)
menu.<span class="function-name">addItem</span>(<span class="string">"Play Game"</span>)
menu.<span class="function-name">addItem</span>(<span class="string">"Options"</span>)
menu.clickHandlers[<span class="string">"Play Game"</span>] = <span class="keyword">function</span>() TitleScreen:<span class="function-name">playGame</span>() <span class="keyword">end</span>
menu.clickHandlers[<span class="string">"Options"</span>] = <span class="keyword">function</span>() Noble.<span class="function-name">transition</span>(OptionsScreen) <span class="keyword">end</span></pre>
<pre class="example"><span class="keyword">local</span> menu = Noble.Menu.<span class="function-name">new</span>(<span class="keyword">true</span>)
menu.<span class="function-name">addItem</span>(<span class="string">"Play Game"</span>)
menu.<span class="function-name">addItem</span>(<span class="string">"Options"</span>)
menu.clickHandlers = {
[<span class="string">"Play Game"</span>] = <span class="keyword">function</span> TitleScreen:<span class="function-name">playGame</span>() <span class="keyword">end</span>,
[<span class="string">"Options"</span>] = <span class="keyword">function</span>() Noble.<span class="function-name">transition</span>(OptionsScreen) <span class="keyword">end</span>
}</pre>
</dd>
<dt>
<a name = "menu.itemPositions"></a>
<span class="item-name">menu.itemPositions<span>
</dt>
<dd>
A key/value table of menu item indices. </p>
<p> This is meant as a <strong>read-only</strong> table, provided for convenience. Modifying its values will break other methods.
<h3>Usage</h3>
<pre class="example">menu.itemPositions[<span class="string">"Play Game"</span>] <span class="comment">-- 1
</span>menu.itemPositions[<span class="string">"Options"</span>] <span class="comment">-- 2</span></pre>
</dd>
<dt>
<a name = "menu.itemWidths"></a>
<span class="item-name">menu.itemWidths<span>
</dt>
<dd>
A key/value table of pixel widths for each menu item, based on its text. Useful for animation, layout, etc.</p>
<p> This is meant as a <strong>read-only</strong> table, provided for convenience. Modifying its values will break other methods.
<h3>Usage</h3>
<pre class="example"><span class="keyword">local</span> playGameMenuItemWidth = menu.itemWidths[<span class="string">"Play Game"</span>]</pre>
</dd>
</dl>
<h2 class="section-header "><a name="Drawing"></a>Drawing </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "menu:draw"></a>
<span class="item-name">menu:draw(__x, __y)<span>
</dt>
<dd>
Draw's this menu to the screen. You may call this manually, but ideally, you will put it in in your scene's <a href="../classes/NobleScene.html#noblescene:update">update</a> or <a href="../classes/NobleScene.html#noblescene:drawBackground">drawBackground</a> method.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__x</span>
<br/>
</li>
<li><span class="parameter">__y</span>
<br/>
</li>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="keyword">function</span> YourScene:<span class="function-name">update</span>()
YourScene.super.<span class="function-name">update</span>(self)
menu:<span class="function-name">draw</span>(<span class="number">50</span>, <span class="number">100</span>)
<span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "menu:drawItem"></a>
<span class="item-name">menu:drawItem(__x, __y, __itemIndex)<span>
</dt>
<dd>
This method is called for every <strong>non-selected</strong> item when <a href="../modules/Noble.Menu.html#menu:draw">draw</a> is called. You shouldn't call this directly, but you may re-implement it if you wish.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__x</span>
<br/>
</li>
<li><span class="parameter">__y</span>
<br/>
</li>
<li><span class="parameter">__itemIndex</span>
<br/>
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Text.html#Noble.Text.draw">Noble.Text.draw</a>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="comment">-- This is the default implementation for this method.
</span><span class="keyword">function</span> menu:<span class="function-name">drawItem</span>(__x, __y, __itemIndex)
Graphics.<span class="function-name">setImageDrawMode</span>(self.fillMode)
<span class="keyword">local</span> xAdjustment = <span class="number">0</span>
<span class="keyword">if</span> (self.alignment == Noble.Text.ALIGN_CENTER) <span class="keyword">then</span>
xAdjustment = self.width/<span class="number">2</span> - self.horizontalPadding/<span class="number">2</span>
<span class="keyword">elseif</span> (self.alignment == Noble.Text.ALIGN_RIGHT) <span class="keyword">then</span>
xAdjustment = self.width - self.horizontalPadding
<span class="keyword">end</span>
Noble.Text.<span class="function-name">draw</span>(self.itemNames[__itemIndex], __x + self.horizontalPadding/<span class="number">2</span> + xAdjustment, __y + self.padding/<span class="number">2</span>, self.alignment, self.localized, self.font)
<span class="keyword">end</span></pre>
</dd>
<dt>
<a name = "menu:drawSelectedItem"></a>
<span class="item-name">menu:drawSelectedItem(__x, __y, __itemIndex)<span>
</dt>
<dd>
This method is called for every <strong>selected</strong> item when <a href="../modules/Noble.Menu.html#menu:draw">draw</a> is called. You shouldn't call this directly, but you may re-implement it if you wish.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__x</span>
<br/>
</li>
<li><span class="parameter">__y</span>
<br/>
</li>
<li><span class="parameter">__itemIndex</span>
<br/>
</li>
</ul>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Text.html#Noble.Text.draw">Noble.Text.draw</a>
</ul>
<h3>Usage</h3>
<pre class="example"><span class="comment">-- This is the default implementation for this method.
</span><span class="keyword">function</span> menu:<span class="function-name">drawSelectedItem</span>(__x, __y, __itemIndex)
<span class="keyword">local</span> xAdjustmentText = <span class="number">0</span>
<span class="keyword">local</span> xAdjustmentRect = <span class="number">0</span>
<span class="keyword">if</span> (self.alignment == Noble.Text.ALIGN_CENTER) <span class="keyword">then</span>
xAdjustmentText = self.width/<span class="number">2</span> - self.horizontalPadding/<span class="number">2</span>
xAdjustmentRect = self.width/<span class="number">2</span> - self.itemWidths[self.itemNames[__itemIndex]]/<span class="number">2</span> - self.horizontalPadding/<span class="number">2</span>
<span class="keyword">elseif</span> (self.alignment == Noble.Text.ALIGN_RIGHT) <span class="keyword">then</span>
xAdjustmentText = self.width - self.horizontalPadding
xAdjustmentRect = self.width - self.itemWidths[self.itemNames[__itemIndex]] - self.horizontalPadding
<span class="keyword">end</span>
Graphics.<span class="function-name">setColor</span>(self.color)
Graphics.<span class="function-name">fillRoundRect</span>(__x + xAdjustmentRect, __y, self.itemWidths[self.itemNames[__itemIndex]]+self.horizontalPadding, self.textHeight+self.padding, self.selectedCornerRadius)
Graphics.<span class="function-name">setColor</span>(self.otherColor)
Graphics.<span class="function-name">setLineWidth</span>(self.selectedOutlineThickness)
Graphics.<span class="function-name">drawRoundRect</span>(__x + xAdjustmentRect, __y, self.itemWidths[self.itemNames[__itemIndex]]+self.horizontalPadding, self.textHeight+self.padding, self.selectedCornerRadius)
Graphics.<span class="function-name">setImageDrawMode</span>(self.otherFillMode)
Noble.Text.<span class="function-name">draw</span>(self.itemNames[__itemIndex], __x + self.horizontalPadding/<span class="number">2</span> + xAdjustmentText, __y+self.padding/<span class="number">2</span>, self.alignment, self.localized, self.font)
<span class="keyword">end</span></pre>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,331 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-module">
<h2>Noble.Settings</h2>
<ul>
<h3>Functions</h3>
<ul>
<li><a href="#Noble.Settings.setup">.setup</a></li>
<li><a href="#Noble.Settings.get">.get</a></li>
<li><a href="#Noble.Settings.set">.set</a></li>
<li><a href="#Noble.Settings.reset">.reset</a></li>
<li><a href="#Noble.Settings.resetSome">.resetSome</a></li>
<li><a href="#Noble.Settings.resetAll">.resetAll</a></li>
<li><a href="#Noble.Settings.save">.save</a></li>
</ul>
</ul>
</div>
<div class="nav-modules">
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><span class="selected">Noble.Settings</span></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><a href="../modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>Noble.Settings</h1>
<p>Operations for game settings / stats.</p>
<p>
</p>
<hr/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<!-- -->
<dl class="function">
<dt>
<a name = "Noble.Settings.setup"></a>
<span class="item-name">Noble.Settings.setup(__keyValuePairs[, __saveToDisk=true[, __modifyExistingOnKeyChange=true]])<span>
</dt>
<dd>
Sets up the settings for your game. You can only run this once, and you must run it before using other <a href="../modules/Noble.Settings.html#">Noble.Settings</a> functions. It is recommended to place it in your main.lua, before <code>Noble.new()</code>.</p>
<p> <strong>NOTE:</strong> You will <em>not</em> be able to add new keys via the <a href="../modules/Noble.Settings.html#Noble.Settings.set">Noble.Settings.set</a> method. This means you need to specify the keys and default values of all of the settings in your game at setup.
If you need to add keys that are not known during setup, it is probably not a setting and you should consider using <a href="../modules/Noble.GameData.html#">Noble.GameData</a> instead.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__keyValuePairs</span>
<span class="types"><span class="type">table</span></span>
<br/>
table. Your game's settings, and thier default values, as key/value pairs. <strong>NOTE:</strong> Do not use "nil" as a value.
</li>
<li><span class="parameter">__saveToDisk</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Saves your default values immediatly to disk.
</li>
<li><span class="parameter">__modifyExistingOnKeyChange</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Updates the existing settings object on disk if you make changes to your settings keys (not values) during development or when updating your game.
</li>
</ul>
<h3>Usage</h3>
<pre class="example">Noble.Settings.<span class="function-name">setup</span>({
difficulty = <span class="string">"normal"</span>,
music = <span class="keyword">true</span>,
sfx = <span class="keyword">true</span>,
players = <span class="number">2</span>,
highScore = <span class="number">0</span> <span class="comment">-- You can store persistant stats here, too!
</span>})</pre>
</dd>
<dt>
<a name = "Noble.Settings.get"></a>
<span class="item-name">Noble.Settings.get(__settingName)<span>
</dt>
<dd>
Get the value of a setting.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__settingName</span>
<span class="types"><span class="type">string</span></span>
<br/>
The name of the setting.
</li>
</ul>
<h3>Returns</h3>
<ol>
<span class="types"><span class="type">any</span></span>
The value of the requested setting.
</ol>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Settings.html#Noble.Settings.set">Noble.Settings.set</a>
</ul>
</dd>
<dt>
<a name = "Noble.Settings.set"></a>
<span class="item-name">Noble.Settings.set(__settingName, __value[, __saveToDisk=true])<span>
</dt>
<dd>
Set the value of a setting. </p>
<p> <strong>NOTE:</strong> If __settingName is not a key in the __keyValuePairs dictionary given to the <a href="../modules/Noble.Settings.html#Noble.Settings.setup">setup</a> method it will not be added to the Settings.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__settingName</span>
<span class="types"><span class="type">string</span></span>
<br/>
The name of the setting.
</li>
<li><span class="parameter">__value</span>
<span class="types"><span class="type">any</span></span>
<br/>
The setting's new value
</li>
<li><span class="parameter">__saveToDisk</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Saves to disk immediately. Set to false if you prefer to manually save (via a confirm button, etc).
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.Settings.html#Noble.Settings.setup">Noble.Settings.setup</a></li>
<li><a href="../modules/Noble.Settings.html#Noble.Settings.get">Noble.Settings.get</a></li>
<li><a href="../modules/Noble.Settings.html#Noble.Settings.save">Noble.Settings.save</a></li>
</ul>
</dd>
<dt>
<a name = "Noble.Settings.reset"></a>
<span class="item-name">Noble.Settings.reset(__settingName[, __saveToDisk=true])<span>
</dt>
<dd>
Resets the value of a setting to its default value defined in <code>setup()</code>.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__settingName</span>
<span class="types"><span class="type">string</span></span>
<br/>
The name of the setting.
</li>
<li><span class="parameter">__saveToDisk</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Saves to disk immediately. Set to false if you prefer to manually save (via a confirm button, etc).
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.Settings.html#Noble.Settings.resetSome">Noble.Settings.resetSome</a></li>
<li><a href="../modules/Noble.Settings.html#Noble.Settings.resetAll">Noble.Settings.resetAll</a></li>
<li><a href="../modules/Noble.Settings.html#Noble.Settings.save">Noble.Settings.save</a></li>
</ul>
</dd>
<dt>
<a name = "Noble.Settings.resetSome"></a>
<span class="item-name">Noble.Settings.resetSome(__settingNames[, __saveToDisk=true])<span>
</dt>
<dd>
Resets the value of multiple settings to thier default value defined in <code>setup()</code>. This is useful if you are storing persistant stats like high scores in <a href="../modules/Noble.Settings.html">Settings</a> and want the player to be able to reset them seperately.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__settingNames</span>
<span class="types"><span class="type">table</span></span>
<br/>
The names of the settings, in an array-style table.
</li>
<li><span class="parameter">__saveToDisk</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Saves to disk immediately. Set to false if you prefer to manually save (via a confirm button, etc).
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.Settings.html#Noble.Settings.resetAll">Noble.Settings.resetAll</a></li>
<li><a href="../modules/Noble.Settings.html#Noble.Settings.save">Noble.Settings.save</a></li>
</ul>
</dd>
<dt>
<a name = "Noble.Settings.resetAll"></a>
<span class="item-name">Noble.Settings.resetAll([__saveToDisk=true])<span>
</dt>
<dd>
Resets all settings to thier default values defined in <code>setup()</code>.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__saveToDisk</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
Saves to disk immediately. Set to false if you prefer to manually save (via a confirm button, etc).
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.Settings.html#Noble.Settings.resetSome">Noble.Settings.resetSome</a></li>
<li><a href="../modules/Noble.Settings.html#Noble.Settings.save">Noble.Settings.save</a></li>
</ul>
</dd>
<dt>
<a name = "Noble.Settings.save"></a>
<span class="item-name">Noble.Settings.save()<span>
</dt>
<dd>
Saves settings to disk.
You don't need to call this unless you set <code>__saveToDisk</code> as false when setting or resetting a setting (say that five times fast!).
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.Settings.html#Noble.Settings.set">Noble.Settings.set</a></li>
<li><a href="../modules/Noble.Settings.html#Noble.Settings.reset">Noble.Settings.reset</a></li>
<li><a href="../modules/Noble.Settings.html#Noble.Settings.resetAll">Noble.Settings.resetAll</a></li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,313 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-module">
<h2>Noble.Text</h2>
<ul>
<h3>Constants </h3>
<ul>
<li><a href="#Noble.Text.ALIGN_LEFT">.ALIGN_LEFT</a></li>
<li><a href="#Noble.Text.ALIGN_RIGHT">.ALIGN_RIGHT</a></li>
<li><a href="#Noble.Text.ALIGN_CENTER">.ALIGN_CENTER</a></li>
</ul>
<h3>Fonts </h3>
<ul>
<li><a href="#Noble.Text.FONT_SYSTEM">.FONT_SYSTEM</a></li>
<li><a href="#Noble.Text.FONT_SMALL">.FONT_SMALL</a></li>
<li><a href="#Noble.Text.FONT_MEDIUM">.FONT_MEDIUM</a></li>
<li><a href="#Noble.Text.FONT_LARGE">.FONT_LARGE</a></li>
</ul>
<h3>Functions </h3>
<ul>
<li><a href="#Noble.Text.getCurrentFont">.getCurrentFont</a></li>
<li><a href="#Noble.Text.setFont">.setFont</a></li>
<li><a href="#Noble.Text.draw">.draw</a></li>
</ul>
</ul>
</div>
<div class="nav-modules">
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><span class="selected">Noble.Text</span></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><a href="../modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>Noble.Text</h1>
<p>Text and font handling.</p>
<p>
</p>
<hr/>
<h2 class="section-header "><a name="Constants"></a>Constants </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "Noble.Text.ALIGN_LEFT"></a>
<span class="item-name">Noble.Text.ALIGN_LEFT<span>
</dt>
<dd>
An alternate way to call Playdate SDK's <code>kTextAlignment.left</code>
</dd>
<dt>
<a name = "Noble.Text.ALIGN_RIGHT"></a>
<span class="item-name">Noble.Text.ALIGN_RIGHT<span>
</dt>
<dd>
An alternate way to call Playdate SDK's <code>kTextAlignment.right</code>
</dd>
<dt>
<a name = "Noble.Text.ALIGN_CENTER"></a>
<span class="item-name">Noble.Text.ALIGN_CENTER<span>
</dt>
<dd>
An alternate way to call Playdate SDK's <code>kTextAlignment.center</code>
</dd>
</dl>
<h2 class="section-header has-description"><a name="Fonts"></a>Fonts </h2>
<!-- -->
<div class="section-description">
You can use these fonts in your project, or override them with your own if you wish.
</div>
<h3>Usage</h3>
<pre class="example">Noble.Text.FONT_SMALL = Graphics.font.<span class="function-name">new</span>(<span class="string">"assets/fonts/MySmallFont"</span>)
Noble.Text.<span class="function-name">setFont</span>(Noble.Text.FONT_SMALL)</pre>
<dl class="function">
<dt>
<a name = "Noble.Text.FONT_SYSTEM"></a>
<span class="item-name">Noble.Text.FONT_SYSTEM<span>
</dt>
<dd>
The Playdate system font.
</dd>
<dt>
<a name = "Noble.Text.FONT_SMALL"></a>
<span class="item-name">Noble.Text.FONT_SMALL<span>
</dt>
<dd>
<strong>Noble Sans</strong>: A sans-serif 8×9 font, with English and Japanese-Kana character sets.
</dd>
<dt>
<a name = "Noble.Text.FONT_MEDIUM"></a>
<span class="item-name">Noble.Text.FONT_MEDIUM<span>
</dt>
<dd>
<strong>Noble Slab</strong>: (This font is not ready yet!)
</dd>
<dt>
<a name = "Noble.Text.FONT_LARGE"></a>
<span class="item-name">Noble.Text.FONT_LARGE<span>
</dt>
<dd>
<strong>Satchel Roughed</strong>: A sans-serif 17×14 rounded font, with an English character set.
</dd>
</dl>
<h2 class="section-header "><a name="Functions"></a>Functions </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "Noble.Text.getCurrentFont"></a>
<span class="item-name">Noble.Text.getCurrentFont()<span>
</dt>
<dd>
<h3>Returns</h3>
<ol>
The currently set font.
</ol>
</dd>
<dt>
<a name = "Noble.Text.setFont"></a>
<span class="item-name">Noble.Text.setFont(__font, __variant)<span>
</dt>
<dd>
Set the current font
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__font</span>
<br/>
any
</li>
<li><span class="parameter">__variant</span>
<br/>
any
</li>
</ul>
</dd>
<dt>
<a name = "Noble.Text.draw"></a>
<span class="item-name">Noble.Text.draw(__string, __x, __y[, __alignment=Noble.Text.ALIGN_LEFT[, __localized=false[, __font=Noble.Text.getCurrentFont()]]])<span>
</dt>
<dd>
Abstracts multiple <code>playdate.text</code> drawing functions into one.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__string</span>
<span class="types"><span class="type">string</span></span>
<br/>
Display text or localization key.
</li>
<li><span class="parameter">__x</span>
<span class="types"><span class="type">number</span></span>
<br/>
</li>
<li><span class="parameter">__y</span>
<span class="types"><span class="type">number</span></span>
<br/>
</li>
<li><span class="parameter">__alignment</span>
<span class="default">= <span class="value">Noble.Text.ALIGN_LEFT</span> (default)</span>
<br/>
Left, right, or center!
</li>
<li><span class="parameter">__localized</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
If true, <code>__string</code> is a localization key rather than display text.
</li>
<li><span class="parameter">__font</span>
<span class="default">= <span class="value">Noble.Text.getCurrentFont()</span> (default)</span>
<br/>
A font to use. If not set, the <code>currentFont</code> is used. If set, the <code>currentFont</code> is not updated.
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,240 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-module">
<h2>Noble.TransitionType</h2>
<ul>
<h3>Constants </h3>
<ul>
<li><a href="#Noble.TransitionType.CUT">.CUT</a></li>
<li><a href="#Noble.TransitionType.CROSS_DISSOLVE">.CROSS_DISSOLVE</a></li>
<li><a href="#Noble.TransitionType.DIP_TO_BLACK">.DIP_TO_BLACK</a></li>
<li><a href="#Noble.TransitionType.DIP_TO_WHITE">.DIP_TO_WHITE</a></li>
<li><a href="#Noble.TransitionType.DIP_WIDGET_SATCHEL">.DIP_WIDGET_SATCHEL</a></li>
<li><a href="#Noble.TransitionType.DIP_METRO_NEXUS">.DIP_METRO_NEXUS</a></li>
<li><a href="#Noble.TransitionType.SLIDE_OFF_LEFT">.SLIDE_OFF_LEFT</a></li>
<li><a href="#Noble.TransitionType.SLIDE_OFF_RIGHT">.SLIDE_OFF_RIGHT</a></li>
<li><a href="#Noble.TransitionType.SLIDE_OFF_UP">.SLIDE_OFF_UP</a></li>
<li><a href="#Noble.TransitionType.SLIDE_OFF_DOWN">.SLIDE_OFF_DOWN</a></li>
</ul>
</ul>
</div>
<div class="nav-modules">
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><span class="selected">Noble.TransitionType</span></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>Noble.TransitionType</h1>
<p>A set of constants for scene transition animations.</p>
<p>
</p>
<h3>See</h3>
<ul>
<a href="../modules/Noble.html#transition">Noble.transition</a>
</ul>
<hr/>
<h2 class="section-header "><a name="Constants"></a>Constants </h2>
<!-- -->
<dl class="function">
<dt>
<a name = "Noble.TransitionType.CUT"></a>
<span class="item-name">Noble.TransitionType.CUT<span>
</dt>
<dd>
An all-time classic.
</dd>
<dt>
<a name = "Noble.TransitionType.CROSS_DISSOLVE"></a>
<span class="item-name">Noble.TransitionType.CROSS_DISSOLVE<span>
</dt>
<dd>
A simple cross-fade.
</dd>
<dt>
<a name = "Noble.TransitionType.DIP_TO_BLACK"></a>
<span class="item-name">Noble.TransitionType.DIP_TO_BLACK<span>
</dt>
<dd>
Fade to black, then to the next scene.
</dd>
<dt>
<a name = "Noble.TransitionType.DIP_TO_WHITE"></a>
<span class="item-name">Noble.TransitionType.DIP_TO_WHITE<span>
</dt>
<dd>
Fade to white, then to the next scene.
</dd>
<dt>
<a name = "Noble.TransitionType.DIP_WIDGET_SATCHEL"></a>
<span class="item-name">Noble.TransitionType.DIP_WIDGET_SATCHEL<span>
</dt>
<dd>
An "accordion" transition, from "Widget Satchel" by Noble Robot.
</dd>
<dt>
<a name = "Noble.TransitionType.DIP_METRO_NEXUS"></a>
<span class="item-name">Noble.TransitionType.DIP_METRO_NEXUS<span>
</dt>
<dd>
A "cascade" transition, from "Metro Nexus" by Noble Robot.
</dd>
<dt>
<a name = "Noble.TransitionType.SLIDE_OFF_LEFT"></a>
<span class="item-name">Noble.TransitionType.SLIDE_OFF_LEFT<span>
</dt>
<dd>
The existing scene slides off the left side of the screen, revealing the next scene.
</dd>
<dt>
<a name = "Noble.TransitionType.SLIDE_OFF_RIGHT"></a>
<span class="item-name">Noble.TransitionType.SLIDE_OFF_RIGHT<span>
</dt>
<dd>
The existing scene slides off the right side of the screen, revealing the next scene.
</dd>
<dt>
<a name = "Noble.TransitionType.SLIDE_OFF_UP"></a>
<span class="item-name">Noble.TransitionType.SLIDE_OFF_UP<span>
</dt>
<dd>
The existing scene slides off the top of the screen.
</dd>
<dt>
<a name = "Noble.TransitionType.SLIDE_OFF_DOWN"></a>
<span class="item-name">Noble.TransitionType.SLIDE_OFF_DOWN<span>
</dt>
<dd>
The existing scene slides off the bottom of the screen, revealing the next scene.
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,476 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-module">
<h2>Noble</h2>
<ul>
<h3>Functions</h3>
<ul>
<li><a href="#new">.new</a></li>
<li><a href="#engineInitialized">.engineInitialized</a></li>
<li><a href="#getConfig">.getConfig</a></li>
<li><a href="#setConfig">.setConfig</a></li>
<li><a href="#resetConfig">.resetConfig</a></li>
<li><a href="#transition">.transition</a></li>
<li><a href="#currentScene">.currentScene</a></li>
<li><a href="#currentSceneName">.currentSceneName</a></li>
<li><a href="#isTransitioning">.isTransitioning</a></li>
</ul>
<h3>Tables</h3>
<ul>
<li><a href="#configuration">.configuration</a></li>
</ul>
<h3>Fields</h3>
<ul>
<li><a href="#showFPS">.showFPS</a></li>
</ul>
</ul>
</div>
<div class="nav-modules">
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><span class="selected">Noble</span></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><a href="../modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>Noble</h1>
<p>A li'l game engine for Playdate.</p>
<p>
</p>
<hr/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<!-- -->
<dl class="function">
<dt>
<a name = "new"></a>
<span class="item-name">new(StartingScene[, __launcherTransitionDuration=0[, __launcherTransition=Noble.Transition.DipToBlack[, __launcherTransitionProperties={}[, __configuration={}]]]])<span>
</dt>
<dd>
Engine initialization. Run this once in your main.lua file to begin your game.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">StartingScene</span>
<span class="types"><a class="type" href="../classes/NobleScene.html#">NobleScene</a></span>
<br/>
This is the scene your game begins with, such as a title screen, loading screen, splash screen, etc. <strong>NOTE: Pass the scene's class name, not an instance of the scene.</strong>
</li>
<li><span class="parameter">__launcherTransitionDuration</span>
<span class="types"><span class="type">number</span></span>
<span class="default">= <span class="value">0</span> (default)</span>
<br/>
If you want to transition from the final frame of your launch image sequence, enter a duration in seconds here.
</li>
<li><span class="parameter">__launcherTransition</span>
<span class="types"><span class="type">Noble.Transition</span></span>
<span class="default">= <span class="value">Noble.Transition.DipToBlack</span> (default)</span>
<br/>
If a transition duration is set, use this transition type.
</li>
<li><span class="parameter">__launcherTransitionProperties</span>
<span class="types"><span class="type">table</span></span>
<span class="default">= <span class="value">{}</span> (default)</span>
<br/>
Provide a table of properties to apply to the launcher transition. See the documentation for the transition you're using for a list of available properties.
</li>
<li><span class="parameter">__configuration</span>
<span class="types"><span class="type">table</span></span>
<span class="default">= <span class="value">{}</span> (default)</span>
<br/>
Provide a table of Noble Engine configuration values. This will run <a href="../modules/Noble.html#setConfig">Noble.setConfig</a> for you at launch.
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../classes/NobleScene.html#">NobleScene</a></li>
<li><a href="../modules/Noble.Transition.html#">Noble.Transition</a></li>
<li><a href="../modules/Noble.html#setConfig">setConfig</a></li>
</ul>
<h3>Usage</h3>
<pre class="example">Noble.<span class="function-name">new</span>(
TitleScreen,
<span class="number">2</span>,
Noble.Transition.DipToWhite,
{
holdTime = <span class="number">0</span>,
ease = Ease.outInQuad
},
{
defaultTransition = Noble.Transition.Imagetable,
defaultTransitionDuration = <span class="number">1.75</span>,
enableDebugBonkChecking = <span class="keyword">true</span>,
}
)</pre>
</dd>
<dt>
<a name = "engineInitialized"></a>
<span class="item-name">engineInitialized()<span>
</dt>
<dd>
This checks to see if <a href="../modules/Noble.html#new">Noble.new</a> has been run. It is used internally to ward off bonks.
<h3>Returns</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
<h3>See</h3>
<ul>
<a href="../modules/Noble.Bonk.html#">Noble.Bonk</a>
</ul>
</dd>
<dt>
<a name = "getConfig"></a>
<span class="item-name">getConfig()<span>
</dt>
<dd>
Retrieve miscellaneous Noble Engine configuration options / default values
<h3>Returns</h3>
<ol>
A table of all configuration values
</ol>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.html#configuration">configuration</a></li>
<li><a href="../modules/Noble.html#setConfig">setConfig</a></li>
</ul>
</dd>
<dt>
<a name = "setConfig"></a>
<span class="item-name">setConfig(__configuration)<span>
</dt>
<dd>
Optionally customize miscellaneous Noble Engine configuration options / default values. You may run this method to change these values during runtime.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">__configuration</span>
<span class="types"><span class="type">table</span></span>
<br/>
This is a table with your configuration values in it.
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.html#configuration">configuration</a></li>
<li><a href="../modules/Noble.html#getConfig">getConfig</a></li>
</ul>
</dd>
<dt>
<a name = "resetConfig"></a>
<span class="item-name">resetConfig()<span>
</dt>
<dd>
Reset miscellaneous Noble Engine configuration values to their defaults.
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.html#getConfig">getConfig</a></li>
<li><a href="../modules/Noble.html#setConfig">setConfig</a></li>
</ul>
</dd>
<dt>
<a name = "transition"></a>
<span class="item-name">transition(NewScene[, __duration=1.5[, __transition=Noble.TransitionType.DIP_TO_BLACK[, __transitionProperties={}]]])<span>
</dt>
<dd>
Transition to a new scene (at the end of this frame).
This method will create a new scene, mark the previous one for garbage collection, and animate between them.
Additional calls to this method within the same frame (before the already-called transition begins), will override previous calls. Any calls to this method once a transition begins will be ignored until the transition completes.
<h3>Parameters</h3>
<ul class="parameters">
<li><span class="parameter">NewScene</span>
<span class="types"><a class="type" href="../classes/NobleScene.html#">NobleScene</a></span>
<br/>
The scene to transition to. Pass the scene's class, not an instance of the scene. You always transition from <a href="../modules/Noble.html#currentScene">Noble.currentScene</a>
</li>
<li><span class="parameter">__duration</span>
<span class="types"><span class="type">number</span></span>
<span class="default">= <span class="value">1.5</span> (default)</span>
<br/>
The length of the transition, in seconds.
</li>
<li><span class="parameter">__transition</span>
<span class="types"><span class="type">Noble.Transition</span></span>
<span class="default">= <span class="value">Noble.TransitionType.DIP_TO_BLACK</span> (default)</span>
<br/>
If a transition duration is set, use this transition type. If not set, it will use the value of <code>configuration.defaultTransition</code>.
</li>
<li><span class="parameter">__transitionProperties</span>
<span class="types"><span class="type">table</span></span>
<span class="default">= <span class="value">{}</span> (default)</span>
<br/>
A table consisting of properties for this transition. Properties not set here will use values that transition's <code>defaultProperties</code> table.
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.html#isTransitioning">Noble.isTransitioning</a></li>
<li><a href="../classes/NobleScene.html#">NobleScene</a></li>
<li><a href="../modules/Noble.Transition.html#">Noble.Transition</a></li>
<li><a href="../modules/Noble.Transition.html#Noble.Transition.SpotlightMask.defaultProperties">Noble.Transition.defaultProperties</a></li>
</ul>
<h3>Usage</h3>
<pre class="example">Noble.<span class="function-name">transition</span>(Level2, <span class="number">1</span>, Noble.Transition.CrossDissolve, {
dither = Graphics.image.kDitherTypeDiagonalLine
ease = Ease.outQuint
})
<span class="comment">--
</span>Noble.<span class="function-name">transition</span>(Level2, <span class="number">1</span>, Noble.Transition.DipToBlack, {
holdTime = <span class="number">0.5</span>,
ease = Ease.outInElastic
})
<span class="comment">--
</span>Noble.<span class="function-name">transition</span>(Level2, <span class="number">1</span>, Noble.Transition.SlideOff, {
x = <span class="number">400</span>,
y = <span class="number">150</span>
rotation = <span class="number">45</span>
})</pre>
</dd>
<dt>
<a name = "currentScene"></a>
<span class="item-name">currentScene()<span>
</dt>
<dd>
Get the current scene object
<h3>Returns</h3>
<ol>
<span class="types"><a class="type" href="../classes/NobleScene.html#">NobleScene</a></span>
</ol>
</dd>
<dt>
<a name = "currentSceneName"></a>
<span class="item-name">currentSceneName()<span>
</dt>
<dd>
Get the name of the current scene
<h3>Returns</h3>
<ol>
<span class="types"><span class="type">string</span></span>
</ol>
</dd>
<dt>
<a name = "isTransitioning"></a>
<span class="item-name">isTransitioning()<span>
</dt>
<dd>
Check to see if the game is transitioning between scenes.
Useful to control game logic that lives outside of a scene's <code>update()</code> method.
<h3>Returns</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<!-- -->
<dl class="function">
<dt>
<a name = "configuration"></a>
<span class="item-name">configuration<span>
</dt>
<dd>
Miscellaneous Noble Engine configuration options / default values.
This table cannot be edited directly. Use <a href="../modules/Noble.html#getConfig">Noble.getConfig</a> and <a href="../modules/Noble.html#setConfig">Noble.setConfig</a>.
<h3>Fields</h3>
<ul class="parameters">
<li><span class="parameter">defaultTransition</span>
<span class="types"><span class="type">Noble.Transition</span></span>
<span class="default">= <span class="value">Noble.Transition.DipToBlack</span> (default)</span>
<br/>
When running <a href="../modules/Noble.html#transition">Noble.transition</a> if the transition is unspecified, it will use this one.
</li>
<li><span class="parameter">defaultTransitionDuration</span>
<span class="types"><span class="type">number</span></span>
<span class="default">= <span class="value">1.5</span> (default)</span>
<br/>
When running <a href="../modules/Noble.html#transition">Noble.transition</a> if the scene transition duration is unspecified, it will take this long in seconds.
</li>
<li><span class="parameter">enableDebugBonkChecking</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">false</span> (default)</span>
<br/>
Noble Engine-specific errors are called "Bonks." You can set this to true during development in order to check for more of them. However, it uses resources, so you will probably want to turn it off before release.
</li>
<li><span class="parameter">alwaysRedraw</span>
<span class="types"><span class="type">boolean</span></span>
<span class="default">= <span class="value">true</span> (default)</span>
<br/>
This sets the Playdate SDK method <code>playdate.graphics.sprite.setAlwaysRedraw</code>. See the Playdate SDK for details on how this function works, and the reasons you might want to set it as true or false for your project.
</li>
</ul>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.html#getConfig">Noble.getConfig</a></li>
<li><a href="../modules/Noble.html#setConfig">Noble.setConfig</a></li>
<li><a href="../modules/Noble.Bonk.html#Noble.Bonk.startCheckingDebugBonks">Noble.Bonk.startCheckingDebugBonks</a></li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<!-- -->
<dl class="function">
<dt>
<a name = "showFPS"></a>
<span class="item-name">showFPS<span>
</dt>
<dd>
Show/hide the Playdate SDK's FPS counter.
<ul class="parameters">
<li><span class="parameter">bool</span>
<br/>
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 KiB

View File

@@ -1,92 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-modules">
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><span class="selected">modules.Noble.Transition.Imagetable</span></li>
<li><a href="../modules/modules.Noble.Transition.ImagetableMask.html">modules.Noble.Transition.ImagetableMask</a></li>
<li><a href="../modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>modules.Noble.Transition.Imagetable</h1>
<p>Transition properties.</p>
<p>
</p>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.html#transition">Noble.transition</a></li>
<li><a href="../modules/Noble.Transition.html#Noble.Transition.setDefaultProperties">Noble.Transition.setDefaultProperties</a></li>
</ul>
<hr/>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,92 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Noble Engine API reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
<link rel="icon" href="favicon.ico">
</head>
<body>
<div id="container">
<div id="main">
<!-- Menu -->
<div id="navigation">
<a href="../index.html"><div class="logo">
<h1>Noble Engine</h1>
</div></a>
<div class="nav-modules">
<div class="nav-kind">
<h3>Modules</h3>
<ul>
<li><a href="../modules/Noble.html">Noble</a></li>
<li><a href="../modules/Noble.Animation.html">Noble.Animation</a></li>
<li><a href="../modules/Noble.Bonk.html">Noble.Bonk</a></li>
<li><a href="../modules/Noble.GameData.html">Noble.GameData</a></li>
<li><a href="../modules/Noble.Input.html">Noble.Input</a></li>
<li><a href="../modules/Noble.Menu.html">Noble.Menu</a></li>
<li><a href="../modules/Noble.Settings.html">Noble.Settings</a></li>
<li><a href="../modules/Noble.Text.html">Noble.Text</a></li>
<li><a href="../modules/Noble.Transition.html">Noble.Transition</a></li>
<li><a href="../modules/modules.Noble.Transition.Imagetable.html">modules.Noble.Transition.Imagetable</a></li>
<li><span class="selected">modules.Noble.Transition.ImagetableMask</span></li>
<li><a href="../modules/Ease.html">Ease</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Classes</h3>
<ul>
<li><a href="../classes/NobleScene.html">NobleScene</a></li>
<li><a href="../classes/NobleSprite.html">NobleSprite</a></li>
</ul>
</div>
<div class="nav-kind">
<h3>Examples</h3>
<ul>
<li><a href="../examples/SceneTemplate.lua.html">SceneTemplate.lua</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<h1>modules.Noble.Transition.ImagetableMask</h1>
<p>Transition properties.</p>
<p>
</p>
<h3>See</h3>
<ul>
<li><a href="../modules/Noble.html#transition">Noble.transition</a></li>
<li><a href="../modules/Noble.Transition.html#Noble.Transition.setDefaultProperties">Noble.Transition.setDefaultProperties</a></li>
</ul>
<hr/>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<span><a href="https://github.com/NobleRobot/NobleEngine">Noble Engine</a> by Mark LaCroix, <a href="https://noblerobot.com">Noble Robot</a></span>
<span style="float:right;">
Documentation created using <a href="https://github.com/stevedonovan/LDoc">LDoc 1.5.0</a>.
</span>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1 +0,0 @@
.docs/** linguist-documentation

View File

@@ -1,13 +0,0 @@
# These are supported funding model platforms
github: NobleRobot
#patreon: # Replace with a single Patreon username
#open_collective: # Replace with a single Open Collective username
ko_fi: NobleRobot
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
#liberapay: # Replace with a single Liberapay username
#issuehunt: # Replace with a single IssueHunt username
#otechie: # Replace with a single Otechie username
#lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -1,23 +0,0 @@
---
name: Bug report
about: Help track problems in the project
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
(A clear and concise description of what the bug is.)
**To reproduce**
(Steps to reproduce the behavior:)
**Expected behavior**
(A clear and concise description of what you expected to happen.)
**Screenshots/Code snippets**
(If applicable, add screenshots or code snippets to help explain your problem.)
**Additional context**
(Add any other context about the problem here.)

View File

@@ -1,23 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Describe the feature**
(A clear and concise description of your proposal.)
**Describe alternatives you've considered**
(A clear and concise description of any alternative solutions or features you've considered.)
**What problems would this solve or help prevent, if any**
(OPTIONAL: If this feature is related to a bug or other problem, describe it here.)
**Additional context**
(Add any other context or screenshots about the feature request here.)

View File

@@ -1,60 +0,0 @@
name: Update documentation
on:
push:
branches:
- 'main'
jobs:
generate-docs:
runs-on: ubuntu-latest
steps:
- name: Check out main branch
uses: actions/checkout@v3
- name: Install Lua
uses: leafo/gh-actions-lua@v10.0.0
with:
luaVersion: "5.4"
- name: Install Luarocks package manager
uses: leafo/gh-actions-luarocks@v4.3.0
- name: Install LDoc (with dependencies)
run: |
luarocks install ldoc
- name: Generate HTML documentation using LDoc
run: |
ldoc -c .docs/.ldoc/config.ldoc .
- name: Commit any changes made inside the .docs folder
uses: EndBug/add-and-commit@v9.1.1
with:
add: '.docs'
remove: '.lua'
default_author: github_actions
author_name: Noble Robot
author_email: contact@noblerobot.com
message: '(Documentation updates)'
push: true
- name: Remove .lua
uses: JesseTG/rm@v1.0.3
with:
path: .lua
- name: Remove .luarocks
uses: JesseTG/rm@v1.0.3
with:
path: .luarocks
- uses: numtide/clean-git-action@v1
- name: GitHub Pages Overwriter
uses: rayluo/github-pages-overwriter@v1.3
with:
source-directory: .docs
target-branch: gh_pages

View File

@@ -1,46 +0,0 @@
# Compiled Lua sources
luac.out
# luarocks build files
*.src.rock
*.zip
*.tar.gz
# Object files
*.o
*.os
*.ko
*.obj
*.elf
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
*.def
*.exp
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
.vscode
# LDoc config files
config.ld
.docs_templates/

View File

@@ -1,43 +0,0 @@
# Contributor Code of Conduct
## Pledge
This project pledges to make participation a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
The project's leaders pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Standards
Examples of behavior that contributes to a positive environment include:
* Demonstrating empathy and kindness toward other people.
* Being respectful of differing opinions, viewpoints, and experiences.
* Giving and gracefully accepting constructive feedback.
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience.
* Valuing the contributions of others, in effort but also time.
* Focusing on what is best not just for us as individuals, but for others as well.
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of any kind.
* Trolling, insulting, or derogatory comments.
* Personal or political attacks.
* Public or private harassment.
* Publishing others' private information, such as a physical or email address, without their explicit permission.
* Other conduct which could reasonably be considered inappropriate in a professional setting.
## Enforcement
Project leaders are responsible for clarifying and enforcing standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Project leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at contact@noblerobot.com. All complaints will be reviewed and investigated promptly and fairly.
All project leaders are obligated to respect the privacy and security of the reporter of any incident.
## Attribution
This Code of Conduct is adapted and simplified from Contributor Covenant version 2.0, which is available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
For answers to common questions about the originating document, see the FAQ at https://www.contributor-covenant.org/faq.

View File

@@ -1,51 +0,0 @@
Licenses
--
"assets/images/NobleRobotLogo.png"
© 2021 Mark LaCroix, Noble Robot
You are granted a non-exclusive license to this version of the Noble Robot
logo, solely for the purposes of providing credit, if you choose, in a
resulting product which uses this software. You may not sell or create
commercial derivative works from this asset, or use it in any other context.
Where appropriate, and at your discretion, include the logo unmodified against
a black background, or inverted against a white background, with a version of
the following message:
"Created with Noble Engine, by Noble Robot. https://noblerobot.com"
--
"libraries/"
Sequence library by Nic Magnier
Signal library by Dustin Mierau
--
All other assets
MIT License
© 2021 Mark LaCroix, Noble Robot
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,375 +0,0 @@
--- A li'l game engine for Playdate.
-- @module Noble
--
-- https://noblerobot.com/
--
-- Playdate libraries
import "CoreLibs/graphics"
import "CoreLibs/sprites"
import "CoreLibs/animation"
import "CoreLibs/animator"
import "CoreLibs/object"
import "CoreLibs/ui"
import "CoreLibs/math"
import "CoreLibs/timer"
import "CoreLibs/frameTimer"
import "CoreLibs/crank"
-- We create aliases for both fun and performance reasons.
Graphics = playdate.graphics
Display = playdate.display
Geometry = playdate.geometry
Ease = playdate.easingFunctions
UI = playdate.ui
File = playdate.file
Datastore = playdate.datastore
Timer = playdate.timer
FrameTimer = playdate.frameTimer
-- In lua, variables are global by default, but having a "Global" object to put
-- variables into is useful for maintaining sanity if you're coming from an OOP language.
-- It's included here for basically no reason at all. Noble Engine doesn't use it. (◔◡◔)
Global = {}
-- It all fits inside this table, oooo!
Noble = {}
-- Third-party libraries
import 'libraries/noble/libraries/Signal'
import 'libraries/noble/libraries/Sequence'
-- Noble libraries, modules, and classes.
import 'libraries/noble/utilities/Utilities.lua'
import 'libraries/noble/utilities/Ease.lua' -- Extensions to the Ease library
import 'libraries/noble/modules/Noble.Animation.lua'
import 'libraries/noble/modules/Noble.Bonk.lua'
import 'libraries/noble/modules/Noble.GameData.lua'
import 'libraries/noble/modules/Noble.Input.lua'
import 'libraries/noble/modules/Noble.Settings.lua'
import 'libraries/noble/modules/Noble.Transition.lua'
import 'libraries/noble/modules/Noble.Text.lua'
import 'libraries/noble/modules/Noble.Menu.lua'
import 'libraries/noble/modules/NobleScene.lua'
import 'libraries/noble/modules/NobleSprite.lua'
local isTransitioning = false
local currentScene = nil
local engineInitialized = false
-- configuration
--
local defaultConfiguration = {
defaultTransition = Noble.Transition.DipToBlack,
defaultTransitionDuration = 1.5,
defaultTransitionHoldTime = 0.25,
transitionDurationIncludesHoldTime = true,
enableDebugBonkChecking = false,
alwaysRedraw = true,
}
local configuration = Utilities.copy(defaultConfiguration)
--- Engine initialization. Run this once in your main.lua file to begin your game.
-- @tparam NobleScene StartingScene This is the scene your game begins with, such as a title screen, loading screen, splash screen, etc. **NOTE: Pass the scene's class name, not an instance of the scene.**
-- @number[opt=0] __launcherTransitionDuration If you want to transition from the final frame of your launch image sequence, enter a duration in seconds here.
-- @tparam[opt=Noble.Transition.DipToBlack] Noble.Transition __launcherTransition If a transition duration is set, use this transition type.
-- @tparam[opt={}] table __launcherTransitionProperties Provide a table of properties to apply to the launcher transition. See the documentation for the transition you're using for a list of available properties.
-- @tparam[opt={}] table __configuration Provide a table of Noble Engine configuration values. This will run `Noble.setConfig` for you at launch.
-- @usage
-- Noble.new(
-- TitleScreen,
-- 2,
-- Noble.Transition.DipToWhite,
-- {
-- holdTime = 0,
-- ease = Ease.outInQuad
-- },
-- {
-- defaultTransition = Noble.Transition.Imagetable,
-- defaultTransitionDuration = 1.75,
-- enableDebugBonkChecking = true,
-- }
-- )
-- @see NobleScene
-- @see Noble.Transition
-- @see setConfig
function Noble.new(StartingScene, __launcherTransitionDuration, __launcherTransition, __launcherTransitionProperties, __configuration)
math.randomseed(playdate.getSecondsSinceEpoch()) -- Set a new random seed at runtime.
if (engineInitialized) then
error("BONK: You can only run Noble.new() once.")
return
end
-- If the user supplies a config object, we use it, otherwise, we set default values.
if (__configuration ~= nil) then
Noble.setConfig(__configuration)
else
Noble.resetConfig()
end
-- Screen drawing: see the Playdate SDK for details on these methods.
Graphics.sprite.setBackgroundDrawingCallback(
function (x, y, width, height)
if (currentScene ~= nil) then
-- Each scene has its own method for this. We only want to run one at a time.
currentScene:drawBackground(x, y, width, height)
else
Graphics.clear(Graphics.kColorBlack)
end
end
)
-- Override this Playdate method that we've used already and don't want to be used again!
Graphics.sprite.setBackgroundDrawingCallback = function(callback)
error("BONK: Don't call Graphics.sprite.setBackgroundDrawingCallback() directly. Put background drawing code in your scenes' drawBackground() methods instead.")
end
-- These values are used if not set.
local launcherTransition = __launcherTransition or defaultConfiguration.defaultTransition
local launcherTransitionDuration = __launcherTransitionDuration or 1.5
local launcherTransitionProperties =__launcherTransitionProperties or {}
-- Now that everything is set, let's-a go!
engineInitialized = true
Noble.transition(StartingScene, launcherTransitionDuration, launcherTransition, launcherTransitionProperties)
end
--- This checks to see if `Noble.new` has been run. It is used internally to ward off bonks.
-- @treturn bool
-- @see Noble.Bonk
function Noble.engineInitialized()
return engineInitialized
end
--- Miscellaneous Noble Engine configuration options / default values.
-- This table cannot be edited directly. Use `Noble.getConfig` and `Noble.setConfig`.
-- @table configuration
-- @tparam[opt=Noble.Transition.DipToBlack] Noble.Transition defaultTransition When running `Noble.transition` if the transition is unspecified, it will use this one.
-- @number[opt=1.5] defaultTransitionDuration When running `Noble.transition` if the scene transition duration is unspecified, it will take this long in seconds.
-- @bool[opt=false] enableDebugBonkChecking Noble Engine-specific errors are called "Bonks." You can set this to true during development in order to check for more of them. However, it uses resources, so you will probably want to turn it off before release.
-- @bool[opt=true] alwaysRedraw This sets the Playdate SDK method `playdate.graphics.sprite.setAlwaysRedraw`. See the Playdate SDK for details on how this function works, and the reasons you might want to set it as true or false for your project.
-- @see Noble.getConfig
-- @see Noble.setConfig
-- @see Noble.Bonk.startCheckingDebugBonks
--- Retrieve miscellaneous Noble Engine configuration options / default values
-- @return A table of all configuration values
-- @see configuration
-- @see setConfig
function Noble.getConfig()
return configuration
end
--- Optionally customize miscellaneous Noble Engine configuration options / default values. You may run this method to change these values during runtime.
-- @tparam table __configuration This is a table with your configuration values in it.
-- @see configuration
-- @see getConfig
function Noble.setConfig(__configuration)
if (__configuration == nil) then
error("BONK: You cannot pass a nil value to Noble.setConfig(). If you want to reset to default values, use Noble.resetConfig().")
end
if (__configuration.defaultTransition ~= nil) then configuration.defaultTransition = __configuration.defaultTransition end
if (__configuration.defaultTransitionDuration ~= nil) then configuration.defaultTransitionDuration = __configuration.defaultTransitionDuration end
if (__configuration.defaultTransitionHoldTime ~= nil) then configuration.defaultTransitionHoldTime = __configuration.defaultTransitionHoldTime end
if (__transitionDurationIncludesHoldTime ~= nil) then configuration.transitionDurationIncludesHoldTime = __configuration.transitionDurationIncludesHoldTime end
if (__configuration.enableDebugBonkChecking ~= nil) then
configuration.enableDebugBonkChecking = __configuration.enableDebugBonkChecking
if (configuration.enableDebugBonkChecking == true) then Noble.Bonk.enableDebugBonkChecking() end
end
if (__configuration.alwaysRedraw ~= nil) then
configuration.alwaysRedraw = __configuration.alwaysRedraw
Graphics.sprite.setAlwaysRedraw(configuration.alwaysRedraw)
end
end
--- Reset miscellaneous Noble Engine configuration values to their defaults.
-- @see getConfig
-- @see setConfig
function Noble.resetConfig()
Noble.setConfig(Utilities.copy(defaultConfiguration))
end
-- Transition stuff
--
local currentTransition = nil
local queuedScene = nil
--- Transition to a new scene (at the end of this frame).
--- This method will create a new scene, mark the previous one for garbage collection, and animate between them.
--- Additional calls to this method within the same frame (before the already-called transition begins), will override previous calls. Any calls to this method once a transition begins will be ignored until the transition completes.
-- @tparam NobleScene NewScene The scene to transition to. Pass the scene's class, not an instance of the scene. You always transition from `Noble.currentScene`
-- @number[opt=1.5] __duration The length of the transition, in seconds.
-- @tparam[opt=Noble.TransitionType.DIP_TO_BLACK] Noble.Transition __transition If a transition duration is set, use this transition type. If not set, it will use the value of `configuration.defaultTransition`.
-- @tparam[opt={}] table __transitionProperties A table consisting of properties for this transition. Properties not set here will use values that transition's `defaultProperties` table.
-- @usage
-- Noble.transition(Level2, 1, Noble.Transition.CrossDissolve, {
-- dither = Graphics.image.kDitherTypeDiagonalLine
-- ease = Ease.outQuint
-- })
-- --
-- Noble.transition(Level2, 1, Noble.Transition.DipToBlack, {
-- holdTime = 0.5,
-- ease = Ease.outInElastic
-- })
-- --
-- Noble.transition(Level2, 1, Noble.Transition.SlideOff, {
-- x = 400,
-- y = 150
-- rotation = 45
-- })
-- @see Noble.isTransitioning
-- @see NobleScene
-- @see Noble.Transition
-- @see Noble.Transition.defaultProperties
function Noble.transition(NewScene, __duration, __transition, __transitionProperties)
if (isTransitioning) then
-- This bonk no longer throws an error (compared to previous versions of Noble Engine), but maybe it still should?
warn("BONK: You can't start a transition in the middle of another transition, silly!")
return -- Let's get otta here!
elseif (queuedScene ~= nil) then
-- Calling this method multiple times between Noble.update() calls is probably not intentional behavior.
warn("Soft-BONK: You are calling Noble.transition() multiple times within the same frame. Did you mean to do that?")
-- We don't return here because maybe the developer *did* intend to override a previous call to Noble.transition().
end
queuedScene = NewScene() -- Creates new scene object. Its init() function runs now.
currentTransition = (__transition or configuration.defaultTransition)(
__duration or configuration.defaultTransitionDuration,
__transitionProperties or {}
)
end
-- These methods are triggered during an transition
function Noble.transitionStartHandler()
isTransitioning = true
if (currentScene ~= nil) then
currentScene:exit() -- The current scene runs its "goodbye" code. Sprites are taken out of the simulation.
end
Noble.Input.setHandler(nil) -- Disable user input.
end
function Noble.transitionMidpointHandler()
if (currentScene ~= nil) then
currentScene:finish()
currentScene = nil -- Allows current scene to be garbage collected.
end
currentScene = queuedScene -- New scene's update loop begins.
queuedScene = nil
currentScene:enter() -- The new scene runs its "hello" code.
end
function Noble.transitionCompleteHandler()
isTransitioning = false -- Reset
currentTransition = nil -- Clear the transition variable.
currentScene:start() -- The new scene is now active.
end
--- Get the current scene object
-- @treturn NobleScene
function Noble.currentScene()
return currentScene
end
--- Get the name of the current scene
-- @treturn string
function Noble.currentSceneName()
return currentScene.name
end
--- Check to see if the game is transitioning between scenes.
-- Useful to control game logic that lives outside of a scene's `update()` method.
-- @treturn bool
function Noble.isTransitioning()
return isTransitioning
end
--- Show/hide the Playdate SDK's FPS counter.
-- @field bool
Noble.showFPS = false;
local crankIndicatorActive = false
local crankIndicatorForced = false
local transitionCanvas = Graphics.image.new(400, 240)
-- Game loop
--
function playdate.update()
Noble.Input.update() -- Check for Noble Engine-specific input methods.
Sequence.update() -- Update all animations that use the Sequence library.
-- Here we check to see if a transition currently in progress needs screenshots of the new scene.
-- If so, we route drawing for this frame into a new context.
if (isTransitioning and currentTransition._captureScreenshotsDuringTransition) then
currentTransition.newSceneScreenshot = Graphics.image.new(400, 240)
Graphics.pushContext(currentTransition.newSceneScreenshot)
end
Graphics.sprite.update() -- Let's draw our sprites (and backgrounds).
if (currentScene ~= nil) then
currentScene:update() -- Scene-specific update code.
end
if (isTransitioning) then
if (currentTransition._captureScreenshotsDuringTransition) then
Graphics.popContext()
end
transitionCanvas:clear(Graphics.kColorClear)
Graphics.pushContext(transitionCanvas)
currentTransition:draw()
Graphics.popContext()
Graphics.setImageDrawMode(currentTransition.drawMode)
transitionCanvas:drawIgnoringOffset(0, 0)
Graphics.setImageDrawMode(Graphics.kDrawModeCopy)
end
-- We want to draw the crank indicator and FPS display last
crankIndicatorActive, crankIndicatorForced = Noble.Input.getCrankIndicatorStatus()
if (crankIndicatorActive) then
if (playdate.isCrankDocked() or crankIndicatorForced) then
UI.crankIndicator:update() -- Draw crank indicator (if requested).
end
end
if (Noble.showFPS) then
playdate.drawFPS(4, 4)
end
Timer.updateTimers() -- Finally, update all SDK timers.
FrameTimer.updateTimers() -- Update all frame timers
if (Noble.Bonk.checkingDebugBonks()) then -- Checks for code that breaks the engine.
Noble.Bonk.checkDebugBonks()
end
-- Once this frame is complete, we can check to see if it's time to start transitioning to a new scene.
if (not isTransitioning and currentTransition ~= nil) then
currentTransition:execute()
end
end
function playdate.gameWillPause()
if (currentScene ~= nil) then
currentScene:pause()
end
end
function playdate.gameWillResume()
if (currentScene ~= nil) then
currentScene:resume()
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 KiB

View File

@@ -1,66 +0,0 @@
Noble Engine
============
### A li'l game engine for Playdate.
![](README.gif)
The Playdate SDK is probably the most user-friendly console SDK ever made, but if you're familiar with state/scene-based game engine frameworks like Unity, Flixel, Citrus, or others, you may be looking for a library that can get your game "on its feet,” extend existing APIs, offer new features, or provide more intuative ways to leverage the SDK in your game.
If so, you're looking for Noble Engine!
Features
--------
- Complete scene lifecycle management. Handle update loops, sprites, input, and initialization steps on a per scene basis.
- Scene transition API and animation library with over a dozen transition types (cross dissolve, dip-to-black, and more).
- Settings/SaveGame API, supporting up to 1000 save slots and automatic updating of on disk files when you inevitably muck around with your data structure in development.
- Boilerplate menu object, with simple way to add/remove items and manage “click” handlers.
- Additional input methods, and per-scene \`inputHandler\` logic.
- Full state manager for sprite animations.
- New fonts! Including full Japanese katakana character set.
- Fully documented code, explaining methods and architecture, and LDoc-generated [documentation pages](https://noblerobot.github.io/NobleEngine).
- Full project template, with example scenes and launcher assets, to help beginners get started with Playdate development.
- Random goodies, like a unified text drawing method for normal/aligned/localized text, one-line methods for showing/hiding the crank indicator and the FPS counter, and more.
Setup
-----
### Via Template
The recommended setup procedure is to clone the [Noble Engine Project Template repository](https://github.com/NobleRobot/NobleEngine-ProjectTemplate) instead of this one. That project is available as a [GitHub Template](https://github.blog/2019-06-06-generate-new-repositories-with-repository-templates/), which you can use to start your own project if you're hosting it on GitHub, or you can clone or download it manually.
The template repository includes this one as a [git submodule](https://www.atlassian.com/git/tutorials/git-submodule). This way, you can mange your use of Noble Engine independently from your own code.
The project template also includes some usage examples to help you get up to speed on how Noble Engine works.
### Manual setup
If, instead, you want to download or clone this repository directly in to a new or existing project, simply place it into `libraries/noble/` relative to your `main.lua` file.
Once youve done that, using Noble Engine can be quickly wired up in your `main.lua` file:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import libraries/noble/Noble
import scenes/MyStartingScene -- Or whatever your game's first scene is.
Noble.new(MyStartingScene)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**Note:** If you are adding Noble Engine to an existing project, it is still recommended to either start with the project template and bring your existing code in, or reorganize your project to mimic the structure of the template. The project template defines a folder layout and has some additional flotsam that reflects the “opinion” of Noble Engine, which is useful if you want to have the best experience using it.
Documentation
-------------
Noble Engine is fully documented in code, and has a full set of html pages generated with [LDoc](https://github.com/lunarmodules/LDoc) and styled for legibility, ease-of-use, and playful charm if I do say so myself.
These pages are included in the repository at `docs/index.html` and on [GitHub Pages](https://noblerobot.github.io/NobleEngine).
Notes on Style
--------------
Noble Engine was originally developed for _Widget Satchel II: Return of Sprocket_, by Mark LaCroix, who never wrote a line of Lua in his life before starting this project.
In general, Lua best-practices are followed, but in some cases code style and naming conventions are more likely to follow those found in “C-like” languages such as Haxe, C\#, Java, ActionScript, etc.
- Methods and variables are **camelCase**.
- “Class” names are **TitleCase**, and Lua “modules” are treated as nested classes, thus `Noble.Text` instead of `noble.text`.
- Constants, such as `Noble.TransitionType.DIP_TO_BLACK`, are **ALL_CAPS_SNAKE_CASE**
- Argument names are prefixed with a **double-underscore**, as in `__displayName`. This mostly impacts documentation legibility. Im very sorry but it couldnt be helped. 😆
- Names are verbose by default; no abbreviations. This includes aliases for Playdate packages, so `playdate.graphics` is aliased as `Graphics`, instead of `gfx`.
Some of these conventions run counter to those seen in the Playdate SDK. In places where theres a potential conflict, either an alias is created for Noble Engines version to match the engines code style, or the Playdate SDK item is given preference and Noble Engine stays out of its way.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

View File

@@ -1,296 +0,0 @@
tracking=1
space 2
A 7
B 6
C 6
D 6
E 5
F 5
G 6
H 6
I 3
J 6
K 6
L 5
M 7
N 7
O 7
P 6
Q 7
R 6
S 6
T 5
U 6
V 6
W 8
X 7
Y 7
Z 7
. 3
: 4
0 6
1 6
2 6
3 6
4 6
5 6
6 6
7 6
8 6
9 6
- 6
! 4
" 5
% 7
' 2
( 5
) 5
+ 8
, 3
? 4
/ 5
< 5
> 5
[ 3
\ 5
] 3
{ 5
} 5
_ 6
~ 7
= 7
* 8
ラ 6
リ 6
ル 8
レ 5
ロ 7
ヮ 6
ワ 6
ョ 6
ヨ 6
6
ァ 7
ア 7
ィ 6
イ 6
ニ 7
ユ 7
ゥ 6
ウ 6
ェ 6
エ 6
ォ 6
オ 6
カ 6
ガ 7
キ 6
ギ 6
ク 6
グ 6
ケ 7
ゲ 6
コ 6
ゴ 6
サ 6
ザ 6
シ 7
ジ 7
ス 6
ズ 6
セ 7
ゼ 7
ソ 6
ゾ 6
ツ 6
ヅ 6
ッ 6
タ 6
ダ 6
チ 6
ヂ 6
テ 6
デ 6
ナ 6
ト 6
ド 6
・ 6
ー 7
5
ヌ 6
ネ 6
マ 6
ハ 7
バ 7
パ 7
ヒ 6
ビ 6
ピ 6
フ 6
ブ 6
プ 6
ヘ 7
ベ 7
ペ 7
ホ 7
ボ 7
ポ 7
ミ 6
ム 6
メ 6
モ 6
ャ 7
ヤ 7
ュ 7
ヱ 7
ヲ 6
ン 7
ヰ 7
ヴ 6
ヵ 6
ヶ 6
ヷ 6
ヸ 7
ヹ 7
ヺ 6
ヽ 5
ヾ 5
ヿ 5
「 6
」 6
。 7
、 7
ぁ 6
あ 7
ぃ 6
い 7
ぅ 5
う 6
え 6
ぇ 5
お 7
ぉ 7
か 7
が 7
き 6
ぎ 7
く 6
ぐ 6
げ 7
け 7
こ 7
ご 7
さ 6
ざ 7
じ 6
し 6
す 7
ず 7
せ 7
ぜ 7
そ 5
ぞ 6
た 7
だ 7
ち 6
ぢ 7
つ 7
づ 7
っ 7
て 7
で 7
と 7
ど 7
に 7
な 7
ぬ 7
ね 7
の 7
は 8
ば 8
ぱ 8
ひ 8
び 8
ぴ 8
ふ 8
ぶ 8
ぷ 8
へ 7
べ 7
ぺ 7
ほ 8
ぼ 8
ぽ 8
ま 6
み 7
む 8
め 7
も 6
ゃ 6
や 7
ゅ 7
ゆ 8
ょ 6
よ 6
ら 6
り 6
る 7
ろ 7
円 8
れ 8
ゎ 7
わ 8
ゐ 7
ゑ 7
を 7
ん 7
ゔ 7
ゕ 7
ゖ 6
ゝ 5
ゞ 5
゛ 6
゜ 6
ゟ 6
a 6
b 6
c 6
d 6
e 6
f 5
g 6
h 6
i 3
j 5
k 6
l 3
m 7
n 6
o 6
p 6
q 6
r 5
s 6
t 5
u 6
v 6
w 8
| 4
x 6
y 6
` 3
z 6
# 7
$ 6
& 8
™ 8
© 6
® 6
‼ 6
<EFBFBD> 8
… 8
@ 8
; 4
^ 7
¥ 8

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -1,97 +0,0 @@
tracking=1
space 6
! 9
" 8
# 14
$ 11
% 17
& 13
' 4
( 8
) 8
* 9
+ 11
, 5
- 9
. 5
/ 11
0 11
1 9
2 11
3 11
4 12
5 11
6 11
7 12
8 11
9 11
: 5
; 5
< 10
= 11
> 10
? 10
@ 14
A 13
B 11
C 13
D 13
E 11
F 11
G 13
H 11
I 5
J 11
K 13
L 10
M 16
N 13
O 14
P 11
Q 14
R 12
S 11
T 11
U 12
V 13
W 17
X 12
Y 11
Z 12
[ 9
\ 12
] 9
^ 10
_ 15
` 8
a 13
b 11
c 13
d 13
e 11
f 11
g 13
h 11
i 5
j 11
k 13
l 10
m 16
n 13
o 14
p 11
q 14
r 12
s 11
t 11
u 12
v 13
w 17
x 12
y 11
z 12
{ 9
| 6
} 8
¥ 12

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

View File

@@ -1,489 +0,0 @@
--
-- Sequence library by Nic Magnier
--
--[[
class to create simple animations using easing as building blocks
To create a simple sequence:
animation = sequence.new():from(0):to(1,2.0,"outQuad"):mirror()
In your game loop
sequence.update()
currentValue = animation:get()
Add hooks or callback
animation = sequence.new():from(0):to(1,2.0,"outQuad"):callback(function() print("end animation") end):mirror()
]]--
import 'CoreLibs/easing'
Sequence = {}
Sequence.__index = Sequence
-- private member
local _easings = playdate.easingFunctions
if not _easings then
print("Sequence warning: easing function not found. Don't forget to call import 'CoreLibs/easing'")
return
end
local _runningSequences = table.create(32,0)
local _previousUpdateTime = playdate.getCurrentTimeMilliseconds()
-- This can be useful when you want your Sequence to continue in realtime
-- when using playdate.stop() / .wait(milliseconds) / .start().
--
-- If you don't set __currentTime, it defaults to playdate.getCurrentTimeMilliseconds()
-- Examples:
-- Use Sequence.setPreviousUpdateTime() before you call playdate.start().
-- Use Sequence.setPreviousUpdateTime(playdate.getCurrentTimeMilliseconds() + milliseconds)
-- before using playdate.wait(milliseconds).
function Sequence.setPreviousUpdateTime(currentTime)
if (currentTime == nil) then
currentTime = playdate.getCurrentTimeMilliseconds()
end
_previousUpdateTime = currentTime
end
-- create a new sequence
function Sequence.new()
local new_sequence = {
-- runtime values
time = 0,
cachedResultTimestamp = nil,
cachedResult = 0,
previousUpdateEasingIndex = nil,
isRunning = false,
duration = 0,
loopType = false,
easings = table.create(4, 0),
easingCount = 0,
callbacks = nil,
}
return setmetatable(new_sequence, Sequence)
end
-- put a low pacing to slow down all animations, great for tweaking
function Sequence.update( pacing )
pacing = pacing or 1
local currentTime = playdate.getCurrentTimeMilliseconds()
local deltaTime = ((currentTime-_previousUpdateTime) / 1000) * pacing
_previousUpdateTime = currentTime
for index = #_runningSequences, 1, -1 do
local seq = _runningSequences[index]
seq:updateCallbacks( deltaTime )
seq.time = seq.time + deltaTime
seq.cachedResultTimestamp = nil
if seq:isDone() then
table.remove(_runningSequences, index)
seq.isRunning = false
end
end
end
function Sequence.print()
print("Sequences running:", #_runningSequences)
for index, seq in pairs(_runningSequences) do
print(" Sequence", index, seq)
end
end
function Sequence:clear()
self:stop()
self.time = 0
self.duration = 0
self.loopType = false
self.easingCount = 0
self.cachedResultTimestamp = nil
self.cachedResult = 0
self.previousUpdateEasingIndex = nil
self.callbacks = {}
end
-- Reinitialize the sequence
function Sequence:from( from )
from = from or 0
-- release all easings
self:clear()
-- setup first empty easing at the beginning of the sequence
local newEasing = self:newEasing()
newEasing.timestamp = 0
newEasing.from = from
newEasing.to = from
newEasing.duration = 0
newEasing.fn = _easings.flat
return self
end
function Sequence:to( to, duration, easingFunction, ... )
if not self then return end
-- default parameters
to = to or 0
duration = duration or 0.3
easingFunction = easingFunction or _easings.inOutQuad
if type(easingFunction)=="string" then
easingFunction = _easings[easingFunction] or _easings.inOutQuad
end
local lastEasing = self.easings[self.easingCount]
local newEasing = self:newEasing()
-- setup first empty easing at the beginning of the sequence
newEasing.timestamp = lastEasing.timestamp + lastEasing.duration
newEasing.from = lastEasing.to
newEasing.to = to
newEasing.duration = duration
newEasing.fn = easingFunction
newEasing.params = {...}
-- update overall sequence infos
self.duration = self.duration + duration
return self
end
function Sequence:set( value )
if not self then return end
local lastEasing = self.easings[self.easingCount]
local newEasing = self:newEasing()
-- setup first empty easing at the beginning of the sequence
newEasing.timestamp = lastEasing.timestamp + lastEasing.duration
newEasing.from = value
newEasing.to = value
newEasing.duration = 0
newEasing.fn = _easings.flat
return self
end
-- @repeatCount: number of times the last easing as to be duplicated
-- @mirror: bool, does the repeating easings have to be mirrored (yoyo effect)
function Sequence:again( repeatCount, mirror )
if not self then return end
repeatCount = repeatCount or 1
local previousEasing = self.easings[self.easingCount]
for i = 1, repeatCount do
local newEasing = self:newEasing()
-- setup first empty easing at the beginning of the sequence
newEasing.timestamp = previousEasing.timestamp + previousEasing.duration
newEasing.duration = previousEasing.duration
newEasing.fn = previousEasing.fn
newEasing.params = previousEasing.params
if mirror then
newEasing.from = previousEasing.to
newEasing.to = previousEasing.from
else
newEasing.from = previousEasing.from
newEasing.to = previousEasing.to
end
-- update overall sequence infos
self.duration = self.duration + newEasing.duration
previousEasing = newEasing
end
return self
end
function Sequence:sleep( duration )
if not self then return end
duration = duration or 0.5
if duration==0 then
return self
end
local lastEasing = self.easings[self.easingCount]
local new_easing = self:newEasing()
-- setup first empty easing at the beginning of the sequence
new_easing.timestamp = lastEasing.timestamp + lastEasing.duration
new_easing.from = lastEasing.to
new_easing.to = lastEasing.to
new_easing.duration = duration
new_easing.fn = _easings.flat
-- update overall sequence infos
self.duration = self.duration + duration
return self
end
function Sequence:callback( fn, timeOffset )
if not self then return end
timeOffset = timeOffset or 0
local lastEasing = self.easings[self.easingCount]
local cb = self:newCallback()
cb.timestamp = lastEasing.timestamp + lastEasing.duration + timeOffset
cb.fn = fn
return self
end
function Sequence:loop()
self.loopType = "loop"
return self
end
function Sequence:mirror()
self.loopType = "mirror"
return self
end
function Sequence:newEasing()
self.easingCount = self.easingCount + 1
return self:getEasingByIndex(self.easingCount)
end
function Sequence:newCallback()
local newCallback = {
fn = nil,
timestamp = nil,
}
table.insert( self.callbacks, newCallback)
return newCallback
end
function Sequence:getEasingByIndex( index )
local easing = self.easings[index]
if type(easing)=="table" then
easing.params = nil
easing.callback = nil
return easing
end
local new_easing = {
timestamp = 0,
from = 0,
to = 0,
duration = 0,
params = nil,
fn = _easings.flat
}
self.easings[index] = new_easing
return new_easing
end
function Sequence:getEasingByTime( clampedTime )
if self:isEmpty() then
print("Sequence warning: empty animation")
return nil
end
local easingIndex = self.previousUpdateEasingIndex or 1
while easingIndex>=1 and easingIndex<=self.easingCount do
local easing = self.easings[easingIndex]
if clampedTime < easing.timestamp then
easingIndex = easingIndex - 1
elseif clampedTime > (easing.timestamp+easing.duration) then
easingIndex = easingIndex + 1
else
self.previousUpdateEasingIndex = easingIndex
return easing, easingIndex
end
end
-- we didn't the correct part
print("Sequence warning: couldn't find sequence part. clampedTime probably out of bound.", clampedTime, self.duration)
return self.easings[1]
end
function Sequence:get( time )
if not self then return nil end
if self:isEmpty() then
return 0
end
time = time or self.time
-- try to get cached result
if self.cachedResultTimestamp==time then
return self.cachedResult
end
-- we calculate and cache the result
local clampedTime = self:getClampedTime(time)
local easing = self:getEasingByTime(clampedTime)
local result = easing.fn(clampedTime-easing.timestamp, easing.from, easing.to-easing.from, easing.duration, table.unpack(easing.params or {}))
-- cache
self.cachedResultTimestamp = clampedTime
self.cachedResult = result
return result
end
function Sequence:updateCallbacks( dt )
if #self.callbacks==0 then
return
end
local callTimeRange = function( clampedStart, clampedEnd)
if clampedStart>clampedEnd then
clampedStart, clampedEnd = clampedEnd, clampedStart
end
for index, cbObject in pairs(self.callbacks) do
if cbObject.timestamp>=clampedStart and cbObject.timestamp<=clampedEnd then
if type(cbObject.fn)=="function" then
cbObject.fn()
end
end
end
end
-- most straightforward case: no loop
if not self.loopType then
local clampedTime = self:getClampedTime( self.time )
callTimeRange(clampedTime, clampedTime+dt)
return
end
--
-- now we handle loops
-- probably rare case but we have to handle it
if dt>self.duration then
callTimeRange(0, self.duration)
end
local clampedTime, isForward = self:getClampedTime( self.time )
local endTime = clampedTime
if isForward then
endTime = endTime + dt
else
endTime = endTime - dt
end
if endTime<0 then
callTimeRange(0, math.max(clampedTime, self:getClampedTime( endTime )))
elseif endTime>self.duration then
if self.loopType=="loop" then
callTimeRange(clampedTime, self.duration)
callTimeRange(0, self:getClampedTime( endTime ))
else
callTimeRange(math.min(clampedTime, self:getClampedTime( endTime )), self.duration)
end
else
callTimeRange(clampedTime, endTime)
end
end
-- get the time clamped in the sequence duration
-- manage time using loop setting
function Sequence:getClampedTime( time )
time = time or self.time
local isForward = true
-- time is looped
if self.loopType=="loop" then
return time%self.duration, isForward
-- time is mirrored / yoyo
elseif self.loopType=="mirror" then
time = time%(self.duration*2)
if time>self.duration then
isForward = false
time = self.duration + self.duration - time
end
return time, isForward
end
-- time is normally clamped
return math.clamp(time, 0, self.duration), isForward
end
function Sequence:addRunning()
if self:isEmpty() or self.isRunning then
return
end
table.insert(_runningSequences, self)
self.isRunning = true
end
function Sequence:removeRunning()
local indexInRunningTable = table.indexOfElement(_runningSequences, self)
if indexInRunningTable then
table.remove(_runningSequences, indexInRunningTable)
end
self.isRunning = false
end
function Sequence:start()
self:addRunning()
return self
end
function Sequence:stop()
self:removeRunning()
self.time = 0
self.cachedResultTimestamp = nil
self.previousUpdateEasingIndex = nil
return self
end
function Sequence:pause()
self:removeRunning()
return self
end
function Sequence:restart()
self.time = 0
self.cachedResultTimestamp = nil
self.previousUpdateEasingIndex = nil
self:start()
return self
end
function Sequence:isDone()
return self.time>=self.duration and (not self.loopType)
end
function Sequence:isEmpty()
return self.easingCount==0
end
-- new easing function
function _easings.flat(t, b, c, d)
return b
end
math.clamp = math.clamp or function(a, min, max)
if min > max then
min, max = max, min
end
return math.max(min, math.min(max, a))
end

View File

@@ -1,47 +0,0 @@
--
-- Signal library by Dustin Mierau
--
import "CoreLibs/object"
class("Signal").extends()
function Signal:init()
self.listeners = {}
end
function Signal:add(key, bind, fn)
local t = self.listeners[key]
local v = {fn = fn, bind = bind}
if not t then
self.listeners[key] = {v}
else
t[#t + 1] = v
end
end
function Signal:remove(key, fn)
local t = self.listeners[key]
if t then
for i, v in ipairs(t) do
if v.fn == fn then
table.remove(t, i)
break
end
end
if #t == 0 then
self.listeners[key] = nil
end
end
end
function Signal:dispatch(key, ...)
local t = self.listeners[key]
if t then
for _, v in ipairs(t) do
v.fn(v.bind, key, ...)
end
end
end
Signal = Signal()

View File

@@ -1,293 +0,0 @@
--- Animation states using a spritesheet/imagetable. Ideal for use with `NobleSprite` objects. Suitable for other uses as well.
-- @module Noble.Animation
--
Noble.Animation = {}
--- Setup
-- @section setup
--- Create a new animation "state machine". This function is called automatically when creating a new `NobleSprite`.
-- @string __view This can be: the path to a spritesheet image file or an image table object (`Graphics.imagetable`). See Playdate SDK docs for imagetable file naming conventions.
-- @return `animation`, a new animation object.
-- @usage
-- local myHero = MyHero("path/to/spritesheet")
-- @usage
-- -- When extending NobleSprite (recommended), you don't call Noble.Animation.new(),
-- -- but you do feed its __view argument into MySprite.super.init()...
-- MyHero = {}
-- class("MyHero").extends(NobleSprite)
--
-- function MyHero:init()
-- MyHero.super.init(self, "assets/images/Hero")
-- -- ...
-- -- A new NobleSprite creates a Noble.Animation object named "self.animation"
-- self.animation:addState("idle", 1, 30)
-- self.animation:addState("jump", 31, 34, "float")
-- self.animation:addState("float", 35, 45)
-- self.animation:addState("turn", 46, 55, "idle")
-- self.animation:addState("walk", 56, 65)
-- -- ...
-- end
-- @usage
-- local myAnimation = Noble.Animation.new("path/to/spritesheet")
-- @usage
-- -- When extending playdate.graphics.Sprite, Noble.Animation.new() must be called manually...
-- MyHero = {}
-- class("MyHero").extends(Graphics.sprite)
--
-- function MyHero:init()
-- MyHero.super.init(self)
-- -- ...
-- self.animation = Noble.Animation.new("assets/images/Hero")
-- self.animation:addState("idle", 1, 30)
-- self.animation:addState("jump", 31, 34, "float")
-- self.animation:addState("float", 35, 45)
-- self.animation:addState("turn", 46, 55, "idle")
-- self.animation:addState("walk", 56, 65)
-- -- ...
-- end
-- @see NobleSprite:init
function Noble.Animation.new(__view)
local animation = {}
--- Properties
-- @section properties
--- The currently set animation state.
--
-- This is intended as `read-only`. You should not modify this property directly.
-- @see setState
animation.current = nil
--- The name of the current animation state. Calling this instead of `animation.current.name` is <em>just</em> a little faster.
--
-- This is intended as `read-only`. You should not modify this property directly.
animation.currentName = nil
--- The current frame of the animation. This is the index of the imagetable, not the frame of the current state.
--
-- Most of the time, you should not modify this directly, although you can if you're feeling saucy and are prepared for unpredictable results.
-- @see draw
animation.currentFrame = 1
--- This controls the flipping of the image when drawing. DIRECTION_RIGHT is unflipped, DIRECTION_LEFT is flipped on the X axis.
-- @usage
-- function MyHero:goLeft()
-- self.animation.direction = Noble.Animation.DIRECTION_LEFT
-- -- ...
-- end
animation.direction = Noble.Animation.DIRECTION_RIGHT
--- This animation's spritesheet. You can replace this with another `playdate.graphics.imagetable` object, but generally you would not want to.
-- @see new
if (type(__view) == "userdata") then
animation.imageTable = __view
else
animation.imageTable = Graphics.imagetable.new(__view)
end
-- The current count of frame durations. This is used to determine when to advance to the next frame.
animation.frameDurationCount = 1
-- The previous number of frame durations in the animation
animation.previousFrameDurationCount = 1
local empty = true
--- Setup
-- @section setup
--- Add an animation state. The first state added will be the default set for this animation.
--
-- <strong>NOTE:</strong> Added states are first-degree member objects of your Noble.Animation object, so do not use names of already existing methods/properties ("current", "draw", etc.).
-- @string __name The name of the animation, this is also used as the key for the animation.
-- @int __startFrame This is the first frame of this animation in the imagetable/spritesheet
-- @int __endFrame This is the final frame of this animation in the imagetable/spritesheet
-- @string[optional] __next By default, animation states will loop, but if you want to sequence an animation, enter the name of the next state here.
-- @bool[opt=true] __loop If you want a state to "freeze" on its final frame, instead of looping, enter `false` here.
-- @param[optional] __onComplete This function will run when this animation is complete. Be careful when using this on a looping animation!
-- @int[opt=1] __frameDuration This is the number of ticks between each frame in this animation. If not specified, it will be set to 1.
-- @usage
-- -- You can reference an animation's state's properties using bog-standard lua syntax:
--
-- animation.idle.startFrame -- 30
-- animation.walk.endFrame -- 65
-- animation.["walk"].endFrame -- 65
-- animation.jump.name -- "jump"
-- animation.["jump"].next -- "float"
-- animation.idle.next -- nil
function animation:addState(__name, __startFrame, __endFrame, __next, __loop, __onComplete, __frameDuration)
local loop = true
local frameDuration = 1
if (__loop ~= nil) then loop = __loop end
if (__frameDuration ~= nil) then frameDuration = __frameDuration end
self[__name] = {
name = __name,
startFrame = __startFrame,
endFrame = __endFrame,
next = __next,
loop = loop,
onComplete = __onComplete,
frameDuration = frameDuration,
}
-- Set this animation state as default if it is the first one added.
if (empty == true) then
empty = false
self.currentFrame = __startFrame
self.current = self[__name]
self.currentName = __name
self.frameDuration = frameDuration
end
end
--- Methods
-- @section methods
--- Sets the current animation state. This can be run in a object's `update` method because it only changes the animation state if the new state is different from the current one.
-- @tparam string|Noble.Animation __animationState The name of the animation to set. You can pass the name of the state, or the object itself.
-- @bool[opt=false] __continuous Set to true if your new state's frames line up with the previous one's, i.e.: two walk cycles but one is wearing a cute hat!
-- @tparam string|Noble.Animation __unlessThisState If this state is the current state, do not set the new one.
-- @usage animation:setState("walk")
-- @usage animation:setState(animation.walk)
-- @usage
-- animation:setState(animation.walkNoHat)
-- --
-- animation:setState(animation.walkYesHat, true)
-- @usage
-- function MyHero:update()
-- -- Input
-- -- ...
--
-- -- Physics/collisions
-- -- ...
--
-- -- Animation states
-- if (grounded) then
-- if (turning) then
-- self.animation:setState(self.animation.turn)
-- elseif (math.abs(self.velocity.x) > 15) then
-- self.animation:setState(self.animation.walk, false, self.animation.turn)
-- else
-- self.animation:setState(self.animation.idle, false, self.animation.turn)
-- end
-- else
-- self.animation:setState(self.animation.jump, false, self.animation.float)
-- end
--
-- groundedLastFrame = grounded
-- end
function animation:setState(__animationState, __continuous, __unlessThisState)
if (__unlessThisState ~= nil) then
if (type(__unlessThisState) == "string") then
if (self.currentName == __unlessThisState) then return end
elseif (type(__unlessThisState) == "table") then
if (self.current == __unlessThisState) then return end
end
end
local newState = nil
if (type(__animationState) == "string") then
if (self.currentName == __animationState) then return end
newState = self[__animationState]
self.currentName = __animationState
elseif (type(__animationState) == "table") then
if (self.current == __animationState) then return end
newState = __animationState
self.currentName = __animationState.name
end
local continuous = Utilities.handleOptionalBoolean(__continuous, false)
if (continuous) then
local localFrame = self.currentFrame - self.current.startFrame
self.currentFrame = newState.startFrame + localFrame
else
self.currentFrame = newState.startFrame
end
self.current = newState
end
--- Draw the current frame.
--
-- When attached to a NobleSprite, this is called by `NobleSprite:draw()` when added to a scene. For non-NobleSprite sprites, put this method inside your sprite's `draw()` method, or inside @{NobleScene:update|NobleScene:update}.
-- @number[opt=0] __x
-- @number[opt=0] __y
-- @bool[opt=true] __advance Advances to the next frame after drawing this one. Noble.Animation is frame-based, not "delta time"-based, so its speed is dependent on your game's framerate.
-- @usage
-- function MySprite:draw()
-- animation:draw()
-- end
-- @usage
-- function MyScene:update()
-- animation:draw(100,100)
-- end
function animation:draw(__x, __y, __advance)
--print(self.currentName .. " > " .. self.currentFrame .. " >> " .. tostring(self.current.loop))
if (__advance == nil) then __advance = true end
if (self.currentFrame < self.current.startFrame or self.currentFrame > self.current.endFrame + 1) then
self.currentFrame = self.current.startFrame -- Error correction.
elseif (self.currentFrame == self.current.endFrame + 1) then -- End frame behavior.
if (self.current.next ~= nil) then
self.currentFrame = self.current.next.startFrame -- Set to first frame of next animation.
self.frameDurationCount = 1 -- Reset ticks.
self.previousFrameDurationCount = self.frameDuration
self:setState(self.current.next) -- Set next animation state.
elseif (self.current.loop == true) then
self.currentFrame = self.current
.startFrame -- Loop animation state. (TO-DO: account for continuous somehow?)
self.frameDurationCount = 1 -- Reset ticks.
self.previousFrameDurationCount = self.frameDuration
elseif (__advance) then
self.currentFrame = self.currentFrame -
1 -- Undo advance frame because we want to draw the same frame again.
end
if (self.current.onComplete ~= nil) then
self.current.onComplete()
end
end
local x = __x or 0
local y = __y or 0
self.imageTable:drawImage(self.currentFrame, x, y, self.direction)
if (__advance == true) then
self.frameDurationCount += 1
if ((self.frameDurationCount - self.previousFrameDurationCount) >= self.current.frameDuration) then
self.currentFrame = self.currentFrame + 1
self.previousFrameDurationCount += self.current.frameDuration
end
end
--previousAnimationName = self.currentName
end
--- Sometimes, you just want to draw a specific frame.
-- Use this for objects or sprites that you want to control outside of update loops, such as score counters, flipbook-style objects that respond to player input, etc.
-- @int __frameNumber The frame to draw from the current state. This is not an imagetable index. Entering `1` will draw the selected state's `startFrame`.
-- @string[opt=self.currentName] __stateName The specific state to pull the __frameNumber from.
-- @number[opt=0] __x
-- @number[opt=0] __y
-- @param[opt=self.direction] __direction Override the current direction.
function animation:drawFrame(__frameNumber, __stateName, __x, __y, __direction)
local x = __x or 0
local y = __y or 0
local stateName = __stateName or self.currentName
local direction = __direction or self.direction
local frameNumber = self[stateName].startFrame - 1 + __frameNumber
self.imageTable:drawImage(frameNumber, x, y, direction)
end
return animation
end
--- Constants
-- @section constants
--- A re-contextualized instance of `playdate.graphics.kImageUnflipped`
Noble.Animation.DIRECTION_RIGHT = Graphics.kImageUnflipped
--- A re-contextualized instance of `playdate.graphics.kImageFlippedX`
Noble.Animation.DIRECTION_LEFT = Graphics.kImageFlippedX

View File

@@ -1,108 +0,0 @@
--- Engine-specific error handling.
-- Noble Engine overrides/supersedes some Playdate SDK behavior. A "bonk" is what happens when your game breaks the engine.
--
-- Most bonks will throw during normal operation, but others ("debug bonks") introduce some execution overhead so are not
-- checked by default.
--
-- @module Noble.Bonk
--
Noble.Bonk = {}
local bonksAreSetup = false
local checkingForBonks = false
local debugBonks = {}
-- You cannot run this directly. Run Noble.new() with __enableDebugBonkChecking as true to enable debug bonk checking.
function Noble.Bonk.enableDebugBonkChecking()
if (bonksAreSetup == false) then
if (Noble.engineInitialized() == false) then
debugBonks.update = playdate.update
debugBonks.pause = playdate.gameWillPause
debugBonks.resume = playdate.gameWillResume
debugBonks.crankDocked = playdate.crankDocked
debugBonks.crankUndocked = playdate.crankUndocked
bonksAreSetup = true
else
error("BONK-BONK: You cannot run this directly. Run Noble.new() with __enableDebugBonkChecking as true.")
end
else
print("BONK-BONK: You have already run Noble.new() with __enableDebugBonkChecking as true, you cannot run this directly.")
end
end
--- Begin checking for debug bonks, <strong>on every frame</strong>. This introduces needless overhead, so don't do it in a release build.
-- You can only run this if you ran previously `Noble.new()` with `__enableDebugBonkChecking` as true, which you should also not do in a release build.
-- @see Noble.new
function Noble.Bonk.startCheckingDebugBonks()
if (checkingForBonks == false) then
if (bonksAreSetup) then
checkingForBonks = true
else
error("BONK-BONK: You cannot run this unless debug bonk checking is enabled.")
end
end
end
--- Stop checking for debug bonks on every frame.
--
-- <strong>NOTE: You can only run this if debug bonk checking is enabled.</strong>
function Noble.Bonk.stopCheckingDebugBonks()
if (checkingForBonks) then
if (bonksAreSetup) then
checkingForBonks = false
else
error("BONK-BONK: You cannot run this unless debug bonk checking is enabled.")
end
end
end
--- Disable the ability to check for debug bonks. It frees up some memory. Once you disable debug bonk checking, you cannot re-enable it.
--
-- <strong>NOTE: You can only run this if debug bonk checking is enabled.</strong>
function Noble.Bonk.disableDebugBonkChecking()
if (bonksAreSetup) then
debugBonks = {}
bonksAreSetup = false
else
error("BONK-BONK: You cannot run this unless debug bonk checking is enabled.")
end
end
--- Are we debug bonk checking for debug bonks?
-- @treturn bool
function Noble.Bonk.checkingDebugBonks()
return checkingForBonks
end
--- Manually check for debug bonks.
-- This method runs every frame when `checkingDebugBonks` is true, but you may call it manually instead.
--
-- <strong>NOTE: You can only run this if debug bonk checking is enabled.</strong>
function Noble.Bonk.checkDebugBonks()
if (playdate.crankDocked ~= debugBonks.crankDocked) then
error("BONK: Don't manually define playdate.crankDocked(). Create a crankDocked() inside of an inputHandler instead.")
end
if (playdate.crankUndocked ~= debugBonks.crankUndocked) then
error("BONK: Don't manually define playdate.crankUndocked(). Create a crankUndocked() inside of an inputHandler instead.")
end
if (playdate.update ~= debugBonks.update) then
error("BONK: Don't manually define playdate.update(). Put update code in your scenes' update() methods instead.")
end
if (playdate.gameWillPause ~= debugBonks.pause) then
error("BONK: Don't manually define playdate.gameWillPause(). Put pause code in your scenes' pause() methods instead.")
end
if (playdate.gameWillResume ~= debugBonks.resume) then
error("BONK: Don't manually define playdate.gameWillResume(). Put resume code in your scenes' resume() methods instead.")
end
if (Graphics.sprite.getAlwaysRedraw() == false) then
error("BONK: Don't use Graphics.sprite.setAlwaysRedraw(false) unless you know what you're doing...")
end
if (Noble.currentScene.backgroundColor == Graphics.kColorClear) then
error("BONK: Don't set a scene's backgroundColor to Graphics.kColorClear, silly.")
end
end

Some files were not shown because too many files have changed in this diff Show More