[Xerte] Trying to overlay a grid for positioning in Xerte 2.10
Paul Swanson
Paul.Swanson at harlandfs.com
Wed Apr 7 17:24:43 BST 2010
I'm working on a routine to create gridlines to assist in positioning
some rectangles that I draw with code. I've got the gridlines working,
but they end up under the framework for the individual lessons and I
need them on top. Here's the approach I'm using:
I have a flag variable to turn it on and off in my setup script, and the
graphic icon I draw it on, and the code to draw the gridlines, are in
the main entry frame of the interface icon. This works until I enter
another framework, at which point the other framework sits on top of my
gridlines. I've tried using swapDepths with a numeric value of 10000,
which should be higher than the depth of any other icon, and I've also
tried using the id of the framework in place of the numeric value. I've
even moved the code to the page where I draw the rectangle, and used the
icon id of the screen shot graphic with swapDepths, but it always
appears under the framework. Anyone have any idea?
More details:
Setup script has:
gridLines = true; // set to false to turn off
In Interface icon Entry Frame I have a graphic icon with an ID of 'grid'
Script icon that draw gridlines has following code:
if (gridLines) {
// set grid to high depth
grid.swapDepths(10000);
// grid line intervals
gridInterval = 50;
grid.lineStyle(1,0x000000,100);
// vertical grids
for (gridX = 0; gridX <= stageWidth; gridX) {
grid.moveTo(gridX, 0);
grid.lineTo(gridX, stageHeight);
gridX = gridX + gridInterval;
}
// horizontal grids
for (gridY = 0; gridY <= stageHeight; gridY) {
grid.moveTo(0, gridY);
grid.lineTo(stageWidth, gridY);
gridY = gridY + gridInterval;
}
}
_____________________________
Paul Swanson
Instructional Designer
Harland Financial Solutions
800.274.7280 Ext. 2462
Paul.Swanson at harlandfs.com
_____________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20100407/120ee39a/attachment.html
More information about the Xerte
mailing list