Last active
September 17, 2015 12:44
-
-
Save sdsykes/0c441d4cd854e197c8ce to your computer and use it in GitHub Desktop.
Scripts to move each direction for TotalSpaces2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'totalspaces2' | |
current = TotalSpaces2.current_space | |
spaces = TotalSpaces2.number_of_spaces | |
columns = TotalSpaces2.grid_columns | |
new_space = current + columns | |
if new_space <= spaces | |
TotalSpaces2.move_to_space(new_space) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'totalspaces2' | |
wrap = true # set to false if you don't want wrap | |
current = TotalSpaces2.current_space | |
spaces = TotalSpaces2.number_of_spaces | |
columns = TotalSpaces2.grid_columns | |
new_space = current - 1 | |
if new_space > 0 | |
if wrap || current % columns != 1 | |
TotalSpaces2.move_to_space(new_space) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'totalspaces2' | |
wrap = true # set to false if you don't want wrap | |
current = TotalSpaces2.current_space | |
spaces = TotalSpaces2.number_of_spaces | |
columns = TotalSpaces2.grid_columns | |
new_space = current + 1 | |
if new_space <= spaces | |
if wrap || new_space % columns != 1 | |
TotalSpaces2.move_to_space(new_space) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'totalspaces2' | |
current = TotalSpaces2.current_space | |
spaces = TotalSpaces2.number_of_spaces | |
columns = TotalSpaces2.grid_columns | |
new_space = current - columns | |
if new_space > 0 | |
TotalSpaces2.move_to_space(new_space) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment