From 13ad8e2a090eec97f31a1c62e2052a51dcff4434 Mon Sep 17 00:00:00 2001 From: v-rob Date: Mon, 16 Mar 2020 14:56:48 -0700 Subject: Formspecs: Add starting frame to `animated_image` (#9411) --- games/minimal/mods/test/formspec.lua | 25 ++++++++++++++++----- .../minimal/mods/test/textures/test_animation.jpg | Bin 3696 -> 4376 bytes .../minimal/mods/test/textures/test_animation.png | Bin 1048 -> 3161 bytes 3 files changed, 19 insertions(+), 6 deletions(-) (limited to 'games') 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 Binary files a/games/minimal/mods/test/textures/test_animation.jpg and b/games/minimal/mods/test/textures/test_animation.jpg 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 Binary files a/games/minimal/mods/test/textures/test_animation.png and b/games/minimal/mods/test/textures/test_animation.png differ -- cgit v1.2.3