Browse Source

working on scroll offset

master
poikilos 9 years ago
committed by Jacob Gustafson
parent
commit
0198781407
  1. 12
      README.md
  2. 6
      web/chunkymap.php

12
README.md

@ -91,11 +91,13 @@ world_path
wget https://github.com/expertmm/minetest-chunkymap/raw/master/install-chunkymap-on-ubuntu-from-web.sh wget https://github.com/expertmm/minetest-chunkymap/raw/master/install-chunkymap-on-ubuntu-from-web.sh
chmod +x install-chunkymap-on-ubuntu-from-web.sh chmod +x install-chunkymap-on-ubuntu-from-web.sh
./install-chunkymap-on-ubuntu-from-web.sh ./install-chunkymap-on-ubuntu-from-web.sh
rm update-chunkymap-on-ubuntu-from-web.sh #or later run:
wget https://github.com/expertmm/minetest-chunkymap/raw/master/update-chunkymap-on-ubuntu-from-web.sh #rm update-chunkymap-on-ubuntu-from-web.sh
sleep 1 #wget https://github.com/expertmm/minetest-chunkymap/raw/master/update-chunkymap-on-ubuntu-from-web.sh
chmod +x update-chunkymap-on-ubuntu-from-web.sh #chmod +x update-chunkymap-on-ubuntu-from-web.sh
./update-chunkymap-on-ubuntu-from-web.sh #./update-chunkymap-on-ubuntu-from-web.sh
sudo python chunkymap/singleimage.py
sudo python chunkymap/generator.py
OPTION 2: IF you are using Ubuntu go to a terminal, cd to this directory, OPTION 2: IF you are using Ubuntu go to a terminal, cd to this directory,
then switch user to the one that will run minetestserver then switch user to the one that will run minetestserver
(since install-chunkymap-on-ubuntu.sh DOES replace "/home/owner" with current user's home [replace-with-current-user.py, which is automatically called by install, will change /home/owner to current user's directory in each script that install copies to $HOME/chunkymap]) (since install-chunkymap-on-ubuntu.sh DOES replace "/home/owner" with current user's home [replace-with-current-user.py, which is automatically called by install, will change /home/owner to current user's directory in each script that install copies to $HOME/chunkymap])

6
web/chunkymap.php

@ -1095,8 +1095,10 @@ function echo_chunkymap_canvas($show_player_names_enable, $decachunks_enable, $c
my_canvas.addEventListener("mouseup", handle_mouseup, false); my_canvas.addEventListener("mouseup", handle_mouseup, false);
my_canvas.addEventListener("mouseout", handle_mouseout, false); my_canvas.addEventListener("mouseout", handle_mouseout, false);
my_canvas.addEventListener("mousemove", function(e) { my_canvas.addEventListener("mousemove", function(e) {
mouse_point.x = parseInt(e.clientX-my_canvas.offsetLeft); var xOffset=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);
mouse_point.y = parseInt(e.clientY-my_canvas.offsetTop); var yOffset=Math.max(document.documentElement.scrollTop,document.body.scrollTop);
mouse_point.x = parseInt(e.clientX+xOffset-my_canvas.offsetLeft);
mouse_point.y = parseInt(e.clientY+yOffset-my_canvas.offsetTop);
//var this_text = "on your screen: "+mouse_point.x+","+mouse_point.y+" mousemove"; //var this_text = "on your screen: "+mouse_point.x+","+mouse_point.y+" mousemove";
//change_widget(label4, this_text); //change_widget(label4, this_text);

Loading…
Cancel
Save