Thread: [GridMaps]
View Single Post
  #3  
Unread 25th of January, 2013, 05:39
Gralhruk's Avatar
Gralhruk
Ghost of ORP Past [Epic Admin]

User is offline
 
Join Date: Jan 2002
Member: #13
Location: The Netherworld
Posts: 10,847 (1.88 per day)
Moving a token from one position to another is as easy as editing the post and updating the appropriate [token] tag with the new location - in other words, if I want to move the green dot from B3 to K7, I just edit that token line:

[gridmap squares=24x22 grid=20]
[token=background][img]http://img254.imageshack.us/img254/1381/dr3.jpg[/img][/token]
[token=k7][img]http://online-roleplaying.com/forums/images/smilies/smiley - green.png[/img][/token]
[token=c4][b][color=red]Mf[/color][/b][/token]
[token=F12][img]http://online-roleplaying.com/forums/images/smilies/smiley - red.png[/img][/token]
[token=j19][img]http://online-roleplaying.com/forums/images/smilies/smiley - black.png[/img][/token]
[/gridmap]

And so it is:
A B C D E F G H I J K L M N O P Q R S T U V W X
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Mf
 
 
 
 


Here is a complete breakdown of the syntax and parameters for each tag:
[gridmap squares|pixels=wwxhh grid=gg color=aaaaa|none]
[token=xy|background color=bbbbb fade=nn layer=ll squares|pixels=wwxhh text=ttttt scale=yes|no]xxxxx[token]
[/gridmap]

Where:
  • wwxhh is the width and height of the grid or token in pixels (if you specify "pixels=") or squares (if you specify "squares=") - something 800 pixels wide by 600 pixels high would be written as pixels=800x600
  • gg is the number of pixels of each square on the grid, so you'd put 20 if you want your squares to be 20 pixels by 20 pixels
  • aaaaa is the color of the grid lines - you can use either a color name (Black, Red, DarkOliveGreen, etc.) or the hex color value. The special value "none" will make the grid lines invisible.
  • xy is the column/row location of the upper left corner of your token, use the text "background" if this is the background image. This is specified excel style, so C7 is column 3, row 7
  • bbbbb is the background color of the grid - you can use either a color name (Black, Red, DarkOliveGreen, etc.) or the hex color value
  • nn is the fade value for the background map or token you are working with. Higher fade means the item will be more transparent. I think it's useful for marking dead enemies on the grid - set them to fade=50 or something.
  • ll is an integer from 1 to 100 indicating the layer this token should appear on (or z-index, if you prefer). The background image is located on layer 0.
  • ttttt is the tooltip text that will appear when you hover over the token. Right now it defaults to the location and contents of the square
  • yes|no indicates whether or not the token should scale to fit the size specified on the pixels|squares parameter. This currently defaults to "yes".
  • xxxxx is the value that will appear on the grid for your token. You can use BB codes or image tags or whatever.

If you have noted the "squares" parameter on the token tag, you might deduce that a token can take up more than one square. You would be correct - in that case, the location indicates the upper right corner of the token. Combined with the "color" and "fade" parameters, this also makes a great way to indicate a swath of map covered by an area of webs or black tentacles or some other effect.

The "text" parameter creates a tooltip when you hover over the token, which is a good way to give more information than what you can fit in a little square - say, the name, status, or conditions of the token.

The "layer" parameter is used to determine which tokens should appear on top when you have tokens that overlap one another.

Now, for the caveats:
  • The board limit is in effect for the number of images per post - which means you cannot have more than 10 images in a post. The more astute will glean that this is the reason I needed to split things up into several posts.
  • While we don't have an actual hard limit constraint on image size, we are expecting you to keep your images to 500kb or less. This should be relatively easy if you fool around with the jpg settings when you save.
  • This only works if you are using a browser that supports a reasonably modern version of CSS. Newer versions of both Chrome and Firefox will give the best results. Images sometimes are offset by one pixel - I thought it was just in Chrome but I'm hearing some versions of Firefox as well. I'll be looking to correct that once I figure out the root cause. Internet Explorer is known for not really adhering terribly well to CSS standards so I'm sure you'll see some issues there.
  • There are limits on the number of squares, grid size, and such which I doubt you'll run into. But if you are trying to create a map that is 99000x99000 or a grid box 1 pixel high and it doesn't work don't be surprised.
  • While every effort is made to deliver a quality product, it should be noted that there may be bugs we are unaware of so if you come across anything please let us know. Also, this hasn't been load tested at all - if it starts causing performance issues things may need to change.

Now get off of my lawn.
Reply With Quote