From f0c37e4000a4ff0bb33e008761ac7d7f6a444de9 Mon Sep 17 00:00:00 2001 From: Mitchell Adair Date: Tue, 5 Apr 2022 22:50:55 -0400 Subject: [PATCH 1/3] add/update gitignore --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b7875e --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.vscode/settings.json + +# Ignores all files/directories not within src/SFramework +# This allows you to create any necessary test files/folders at the root of SFramework +# without affecting the repo +src/* +!src/SFramework \ No newline at end of file From 5b60685c74add5a15169c68609f6fb586b45c28a Mon Sep 17 00:00:00 2001 From: Mitchell Adair Date: Tue, 5 Apr 2022 22:52:13 -0400 Subject: [PATCH 2/3] update table.length, related doc --- docs/API/LUA_Library_Extensions/table.md | 2 +- src/SFramework/LUA Extensions/table.lua | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/API/LUA_Library_Extensions/table.md b/docs/API/LUA_Library_Extensions/table.md index b0c2e39..f92d873 100644 --- a/docs/API/LUA_Library_Extensions/table.md +++ b/docs/API/LUA_Library_Extensions/table.md @@ -20,7 +20,7 @@ local index = table.indexOf(myTable, 4) --should return 3 ``` ## table.length -Returns the length of the given table +Returns the length of the given table. This is an alias for `table.getn` ### Arguments - `t` - `table` (required) the table to get the length of ### Example diff --git a/src/SFramework/LUA Extensions/table.lua b/src/SFramework/LUA Extensions/table.lua index b3c0338..1ae2b84 100644 --- a/src/SFramework/LUA Extensions/table.lua +++ b/src/SFramework/LUA Extensions/table.lua @@ -30,9 +30,5 @@ end @return the length of the table ]]-- function table.length(t) - local count = 0 - for k,v in pairs(t) do - count = count + 1 - end - return count + return table.getn(t) end \ No newline at end of file From 9155fc6d772655b6371ca52b67330ff1af73b161 Mon Sep 17 00:00:00 2001 From: Mitchell Adair Date: Tue, 5 Apr 2022 22:53:27 -0400 Subject: [PATCH 3/3] fix doc bug --- docs/API/Components/SpriteRenderer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/API/Components/SpriteRenderer.md b/docs/API/Components/SpriteRenderer.md index 379d31a..80c65cb 100644 --- a/docs/API/Components/SpriteRenderer.md +++ b/docs/API/Components/SpriteRenderer.md @@ -49,7 +49,7 @@ Sets the animation of the SpriteRenderer to the given spritesheet Font asset self.gameObject.spriteRenderer:SetAnimation(CS.FindAsset("Sprites/Sample/Animations/Idle", "Font")) ``` -## SpriteRenderer:SetAnimatinFrameDuration +## SpriteRenderer:SetAnimationFrameDuration Sets the animation's frame duration of the SpriteRenderer to the given number of game ticks. Keep in mind that there are 60 ticks per second in CraftStudio. So for instance, if you want to play an animation at 5 frames per second then you would divide 60 by 5 to get the number of ticks. The default frame duration is 5 ticks. ### Arguments - `ticks` - `number` (required) the number of game ticks per frame of the animation