globook_manual

globook manual WORK IN PROGRESS
Current version: 0.0.2a


data | items | graphicElements


data

this is the minimal structure for a globook data file

{ “gloBook”: {

“version”:”0.0.2a”

}}


this is a basic globook_data.txt


{ “gloBook”: {

version“:”0.0.2a”,
debug“: 0,
numberOfPages“:3,
pageNumbers“:{”show”:true},
width“:400,
height“:500,
pageColor1“:”0xFFFFFF”,
pageColor2“:”0xE4E4E4″,
items“:[],
graphicElements“:[]

}}

version [string] optional:no
specifies current globook version

debug [boolean] optional:yes (default: 0)
if enabled debug mode will be turned on (for developers)

numberOfPages [int] optional:yes (default: 15)
the number of pages for this book

ALFA PROPERTY
pageNumbers [int] optional:yes (default: false)
show page numbers

width [int] optional:yes (default: 400)
book width

height [int] optional:yes (default: 500)
book height

pageColor1 [hex number|"transparent"] optional:yes (default: 0xFFFFFF)
default page background for face0
you can specify “transparent” to obtain a transparent page

pageColor2 [hex number|"transparent"] optional:yes (default: 0xEFEFEF)
default page background for face1
you can specify “transparent” to obtain a transparent page

items [array] optional:yes (default: [])
collection of items that will be used to populate the pages
see below

graphicElements [array] optional:yes (default: [])
graphics elements shared by page items
see below



items

supported objects: text | rectangle | roundRectangle | circle | image | polygon


text

x:0, [100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
y:0, [100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
font:’Verdana’,
size:10,
color:0×0000FF,
width:_cfg.width, [X,Y,100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
height:_cfg.height, [X,Y,100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
align:”left”,
blockIndent:0,
bold:false,
bullet:false,
indent:0,
italic:false,
kerning:false,
leading:0,
leftMargin:0,
letterSpacing:0,
rightMargin:0,
tabStops:[],
target:”",
underline:false,
url:”",
alpha:1,
zIndex


rectangle, rect

x:10, [100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
y:10, [100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
width:20, [X,Y,100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
height:20, [X,Y,100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
filled:true,
color:0xFF0000,
borderWidth:0,
borderColor:0×000000,
borderAlpha:1,
alpha:1
gradientFill [id of gradientFillObject],
zIndex


roundRectangle, roundRect

x:10, [100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
y:10, [100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
width:20, [X,Y,100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
height:20, [X,Y,100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
filled:true,
color:0xFF0000,
borderWidth:0,
borderColor:0×000000,
borderAlpha:1,
ellipseWidth:25,
ellipseHeight:25,
alpha:1
gradientFill [id of gradientFillObject],
zIndex


circle

x:10, [100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
y:10, [100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
radius:20,
filled:true,
color:0xFF0000,
borderWidth:0,
borderColor:0×000000,
borderAlpha:1,
alpha:1,
zIndex


img, image

x:10, [100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
y:10, [100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
src:”,
width [X,Y,100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
height [X,Y,100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
scale,
alpha:1
zIndex

Loads a SWF, JPEG, progressive JPEG, unanimated GIF, or PNG (8 and 24 bit with transparency)

if width and height are null globook uses image real dimensions
if we use scale without specifing width and height properties we can resize the image

scale 0.5 reduces by half
scale 2 double size


poly, polygon

x:10, [100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
y:10, [100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
src:”,
width [X,Y,100%,CENTERX,CENTERY,WIDTH,HEIGHT + (two operands only) a-b || a+b || a*c || a/b || a%b]
height [X,Y,100%,CENTERX,CENTERY,WIDTH,HEIGHT + (with two operands) a-b || a+b || a*c || a/b || a%b]
scale,
coordinates REQUIRED array with x,y coordinates
alpha:1
zIndex

if width and height are null globook uses image real dimensions
if we use scale without specifing width and height properties we can resize the image

scale 0.5 reduces by half
scale 2 double size



gfx elemnts.

supported objects: gradient fill



gradientFill
AS3 reference


{ “gloBook”: {

“version”:”0.0.2a”,
“debug”: 0,
“numberOfPages”:3,
“pageNumbers”:{”show”:false},
“height”:500,
“width”:400,
“pageColor1″:”0xFFFFFF”,
“pageColor2″:”0xE4E4E4″,
“graphicElements”:[
{
"id":"gf1",
"type":"gradientFill",
"colors":["0xFF0000","0xFFFF00"],
ratios“:[127,255],
matrix“:[50,50,90,0,0]
},
{
id“:”gf2″,
type“:”gradientFill”,
colors“:["0x333333","0x777777"],
ratios“:[127,255],
matrix“:[400,0,0,0,0]
}
],

..
.

id [string] optional:no
object identifier

type [string] optional:no
use gradientFill to specify a gradientFill object type

gradientType [string] optional:yes (default:"GradientType.LINEAR")
type of the gradient

colors [array] optional:yes (default: [0x00FF00,0xFF0000])
array with colors

alphas [array] optional:yes (default: [1,1])
gradient fill alpha values

ratios [array] optional:yes (default: [20,127])
gradient fill ratios

matrix [object] optional:yes (default:{width:20,height:20,rotation:0,tx:0,ty:0})
gradient fill matrix

spreadMethod [string] optional:yes (default: "SpreadMethod.PAD")
gradient spread method

interpolationMethod [string] optional:yes (default: "InterpolationMethod.RGB")
gradient interpolation method

focalPointRatio [int] optional:yes (default: 0)
gradient focal point


Leave a Reply

 (required)

plain