1
0
mirror of https://github.com/minetest/minetest.git synced 2025-07-12 12:40:20 +02:00

Formspecs: Add starting frame to animated_image (#9411)

This commit is contained in:
v-rob
2020-03-16 14:56:48 -07:00
committed by GitHub
parent 1441281809
commit 13ad8e2a09
8 changed files with 115 additions and 92 deletions

View File

@ -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", {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB