aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorv-rob <robinsonvincent89@gmail.com>2020-03-16 14:56:48 -0700
committerGitHub <noreply@github.com>2020-03-16 22:56:48 +0100
commit13ad8e2a090eec97f31a1c62e2052a51dcff4434 (patch)
treef13d97357516f5ed427143a045f5daf14876a8be /games
parent1441281809d9961ff7498df86601db151956b030 (diff)
downloadminetest-13ad8e2a090eec97f31a1c62e2052a51dcff4434.tar.gz
minetest-13ad8e2a090eec97f31a1c62e2052a51dcff4434.tar.bz2
minetest-13ad8e2a090eec97f31a1c62e2052a51dcff4434.zip
Formspecs: Add starting frame to `animated_image` (#9411)
Diffstat (limited to 'games')
-rw-r--r--games/minimal/mods/test/formspec.lua25
-rw-r--r--games/minimal/mods/test/textures/test_animation.jpgbin3696 -> 4376 bytes
-rw-r--r--games/minimal/mods/test/textures/test_animation.pngbin1048 -> 3161 bytes
3 files changed, 19 insertions, 6 deletions
diff --git a/games/minimal/mods/test/formspec.lua b/games/minimal/mods/test/formspec.lua
index a836a811d..d2123b4af 100644
--- a/games/minimal/mods/test/formspec.lua
+++ b/games/minimal/mods/test/formspec.lua
@@ -17,7 +17,7 @@ local clip_fs = [[
scrollbar[0,9;3,0.8;horizontal;x9;3]
tablecolumns[text;text]
table[0,10;3,1;x10;one,two,three,four;1]
- animated_image[0,11;3,1;test_animation.png:4,100]
+ animated_image[-0.5,11;4.5,1;;test_animation.png;4;100]
]]
@@ -172,11 +172,19 @@ local pages = {
[[
formspec_version[3]
size[12,12]
- animated_image[0.5,0.5;1,1;test_animation.png:4,100]
- animated_image[1.75,0.5;1,1;test_animation.png:100,100]
- animated_image[0.5,1.75;1,1;test_animation.jpg:4,100]
- animated_image[3,0.5;5,2;test_animation.png:4,100]
- animated_image[3,2.75;5,2;test_animation.jpg:4,100]
+ animated_image[0.5,0.5;1,1;;test_animation.png;4;100]
+ animated_image[0.5,1.75;1,1;;test_animation.jpg;4;100]
+ animated_image[1.75,0.5;1,1;;test_animation.png;100;100]
+ animated_image[3,0.5;1,1;ani_img_1;test_animation.png;4;1000]
+ button[4.25,0.5;1,1;ani_btn_1;Current
+Number]
+ animated_image[3,1.75;1,1;ani_img_2;test_animation.png;4;1000;2]
+ button[4.25,1.75;1,1;ani_btn_2;Current
+Number]
+ animated_image[3,3;1,1;;test_animation.png;4;0]
+ animated_image[3,4.25;1,1;;test_animation.png;4;0;3]
+ animated_image[5.5,0.5;5,2;;test_animation.png;4;100]
+ animated_image[5.5,2.75;5,2;;test_animation.jpg;4;100]
]]
}
@@ -198,6 +206,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
return true
end
+ if fields.ani_img_1 and fields.ani_btn_1 then
+ minetest.chat_send_all(fields.ani_img_1)
+ elseif fields.ani_img_2 and fields.ani_btn_2 then
+ minetest.chat_send_all(fields.ani_img_2)
+ end
end)
minetest.register_node("test:node", {
diff --git a/games/minimal/mods/test/textures/test_animation.jpg b/games/minimal/mods/test/textures/test_animation.jpg
index c4f125d5a..b98ca2677 100644
--- a/games/minimal/mods/test/textures/test_animation.jpg
+++ b/games/minimal/mods/test/textures/test_animation.jpg
Binary files differ
diff --git a/games/minimal/mods/test/textures/test_animation.png b/games/minimal/mods/test/textures/test_animation.png
index b58715bf8..1752362ff 100644
--- a/games/minimal/mods/test/textures/test_animation.png
+++ b/games/minimal/mods/test/textures/test_animation.png
Binary files differ