Page 1 of 1

Formspec alignment problems

PostPosted: Wed Feb 17, 2016 02:51
by Byakuren
I am having trouble lining up formspec elements. I have this image, artifice_straight_diag.png:
Image
And am generating the formspec
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
background[0.5,0.5;8,8;default_stone.png]
image_button[1.6,0.6;0.8,0.8;default_tree.png^progress_tree_check.png^\[colorize:#00FF00:50;wood;]tooltip[wood;Wood]
image_button[4.6,2.6;0.8,0.8;default_wood.png^progress_tree_check.png^\[colorize:#00FF00:50;plank;]tooltip[plank;Plank]
image[2,1;3,2;artifice_straight_diag.png]

I expected this to draw a line between the centers of the two image buttons, but instead I get this:
Image

What am I doing wrong?

Re: Formspec alignment problems

PostPosted: Wed Feb 17, 2016 03:14
by kaadmy
I have had similar problems before, see this and maybe figure a way around ithttps://github.com/minetest/minetest/ ... .cpp#L2005

Re: Formspec alignment problems

PostPosted: Wed Feb 17, 2016 03:28
by Byakuren
kaadmy wrote:I have had similar problems before, see this and maybe figure a way around ithttps://github.com/minetest/minetest/ ... .cpp#L2005


Thank you kaadmy. Multiplying my widths by 5/4 and my heights by 15/13 worked.