Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "API:Objects"

From Roll20 Wiki

Jump to: navigation, search
(Created page with "There are several different types of objects that are used throughout the Roll20 API. Here's a quick listing of each, what it is, and what properties it contains (along with t...")

Revision as of 02:05, 23 April 2013

There are several different types of objects that are used throughout the Roll20 API. Here's a quick listing of each, what it is, and what properties it contains (along with the default values). As a general rule of thumb, properties that begin with an underscore (_) are read-only and cannot be changed.


Contents

Path

{    
  _id: "-Abc123", //unique ID for this object. globally unique across all objects in this campaign    
  fill: "transparent", //fill color. "transparent" or a color HEX    
  stroke: "#000000", // stroke color    
  rotation: 0, //rotation (in degrees)    
  layer: "", //current layer, one of "gmlayer", "objects", "map", "walls" (dynamic lighting) -- Paths on the "walls" layer are automatically used to block light.    
  stroke_width: 5,    
  width: 0,    
  height: 0,    
  top: 0,    
  left: 0,    
  scaleX: 1,    
  scaleY: 1,    
  _type: "path", //can be used to identify the object as a Path. read-only.
  _pageid: "-Abc123" //The ID of the page this object is in
}

Text

{    
  _id: "-Abc123",    
  top: 0,    
  left: 0,    
  width: 0,    
  height: 0,    
  text: "",    
  font_size: 16, //for best results stick to the pre-sets in the text editing menu    
  rotation: 0,    
  color: "#000000",    
  font_family: "unset", //see values of select element in text editing menu    
  layer: "",    
  _type: "text", //identifies the object is text. read-only.
  _pageid: "-Abc123"
}

Graphic (Token/Map/Card/Etc.)

{    
  _id: "-Abc123",    
  left: 0,    
  top: 0,   
  width: 0,    
  height: 0,    
  rotation: 0.0,    
  layer: "",    
  isdrawing: false, //advanced -> is drawing?    
  flipv: false, //flip vertically    
  fliph: false, //flip horizontally    
  name: "", //Token Name    
  gmnotes: "", //GM Notes    
  bar1_value: "", //Current value of Bar 1 (number OR text)    
  bar1_max: "", //Max value of Bar 1    
  _bar1_link: "", //Set to an ID if Bar 1 is linked to a Character Attrbute. read-only.    
  bar2_value: "",    
  bar2_max: "",    
  _bar2_link: "",    
  bar3_value: "",    
  bar3_max: "",    
  _bar3_link: "",    
  aura1_radius: "", //Radius (integer or float) of the aura. Set to empty string ("") for none.    
  aura1_color: "#FFFF99", //HEX color    
  aura1_square: false, //Is the aura square?    
  aura2_radius: "",    aura2_color: "#59E594",    
  aura2_square: false,    
  tint_color: "transparent", //HEX color or "transparent"    
  status_redmarker: false, //show the red marker on the token    
  status_bluemarker: false,    
  status_greenmarker: false,    
  status_brownmarker: false,    
  status_purplemarker: false,    
  status_dead: false,    
  showname: false, //show the nameplate    
  showplayers_name: false, //show the name to all players    
  showplayers_bar1: false,    
  showplayers_bar2: false,    
  showplayers_bar3: false,    
  showplayers_aura1: false,    
  showplayers_aura2: false,    
  playersedit_name: false, // allow controlling players to edit the name. also show the name to controlling players even if showplayers_name is false    
  playersedit_bar1: false,    
  playersedit_bar2: false,    
  playersedit_bar3: false,    
  playersedit_aura1: false,    
  playersedit_aura2: false,    
  light_radius: "", //dynamic lighting radius    
  light_dimradius: "", //dim radius    
  light_otherplayers: false, //show light to all players    
  _type: "graphic", //identifies the object as a graphic. read-only.    
  _subtype: "token", //"token" (tokens and maps) or "card"    
  _cardid: "", //set to a value if the graphic represents a card.
  _pageid: ""
}

Page (Read Only)

{    
  _id: "-Abc123",    
  name: "", //Page's title    
  showgrid: true, //are we showing the grid?    
  showdarkness: false, //Is the Fog of War active?    
  showlighting: false, //Is Dynamic Lighting active?    
  width: 25, //width in units    
  height: 25, //height in units    
  snapping_increment: 1.0, //the size of a grid space in units    
  grid_opacity: 0.50, //opacity of the grid    
  fog_opacity: 0.35, //opacity of the fog of war for the GM    
  background_color: "#ffffff", //background color (HEX)    
  gridcolor: "#C0C0C0", //grid color (HEX)    
  grid_type: "square", //eitehr "square", "hexv", or "hexh"    
  scale_number: 5, //1 unit = how much distance    
  scale_units: "ft", //scale is in these units    
  gridlabels: false, //show grid labels for hex grid    
  diagonaltype: "foure", //one of "foure", "pythagorean" (Euclidean), "threefive", or "manhattan"
}