Strange that the program is so polished, yet they have neglected to make it play along with AGK. Still, it's nice to see that some folks find it useful!
Me, I ended up writing a rough Photoshop script which converts a Photoshop document to a level in AGK.
psd2level.jsx
/******************************************************************************
FILE: psd2level.jsx
Version: 1.0 (kinda finished)
This is an extremely simple script which save each layer as a type
with an x and y position.
This script generates a text file in a folder called "Output", which must be in the same
folder as the .psd
if you have a layer named tFloor, this is how it is saved:
setSpriteVisible ( tWalls[1].sprID, 1)
tWalls[1].isActive = 1
setSpritePosition(tWalls[1].sprID, 130, 200)
Of course, it would first need to exist as a type in your game:
type floorType
sprID as integer
isActive as integer
endtype
Global tFloor as floorType[500]
global floorImg as integer
floorImg = LoadImage ("floor.png")
for i = 1 to tFloor.length
tFloor[i].sprID = createSprite(floorImg)
tFloor[i].isActive = FALSE
setSpriteVisible (tFloor[i].sprID, FALSE)
next
Layers with // in their name are ignored.
******************************************************************************/
#target photoshop
/******************************************************************************
SETTINGS
******************************************************************************/
// Name of folder to save in, relative to the .psd file location
outputFolderName = "Output";
var linialBackup = preferences.rulerUnits; // Settings saved
preferences.rulerUnits = Units.PIXELS; // Settings changed
layerTitleArray = [];
layerTitleCountArray = [];
collector = ""
/*
layerTitleArray[0] = "pete";
layerTitleArray[1] = "markus";
layerTitleArray[2] = "niels";
layerTitleArray[3] = "kaj";
layerTitleCountArray[0] = 1;
layerTitleCountArray[1] = 1;
layerTitleCountArray[2] = 1;
layerTitleCountArray[3] = 1;
*/
//alert (layerTitleCountArray.length)
//addSprite ("pete", 12, 12)
if (app.documents.length == 0) alert("You need to have an image open in Photoshop for this script to work!");
else {
docRefSource = app.activeDocument;
var mappe = Folder(docRefSource.path + "/" + outputFolderName + "/");
if (mappe instanceof Folder && mappe.exists) {
docRefCopy = docRefSource.duplicate();
app.activeDocument = docRefCopy;
/******************************************************************************
RUN ON EACH VISIBLE LAYER
******************************************************************************/
for (var firstLvlLayerRef = 0; firstLvlLayerRef < docRefCopy.layers.length; firstLvlLayerRef++){
docRefCopy.activeLayer = docRefCopy.layers[firstLvlLayerRef];
if (docRefCopy.activeLayer.name.indexOf("//") == -1) { //Only run if the layer is not a comment
//testLayerName (docRefCopy.activeLayer)
addSprite (docRefCopy.activeLayer)
}
}
docRefCopy.close(SaveOptions.DONOTSAVECHANGES);
var targ = new File(docRefSource.path + "/" + outputFolderName + "/generatedLoader.agc");
targ.open("w");
targ.write(collector);
targ.close();
} else alert("The folder " + docRefSource.path + "/" + outputFolderName + "/" + " does not exist.");
} // else
function testLayerName (newLayerRef) {
aa = newLayerRef.name
alert (aa)
}
function addSprite (XLayerRef) {
layerIncluded = false;
activeArrayNumber = 0;
sprTitle = XLayerRef.name;
// Clear spriteTitle
sprTitle = removeCrapText (sprTitle);
// check if the sprite already exists in the array
for (i = 0; i < layerTitleArray.length; i++) {
if (layerTitleArray[i] == sprTitle) {
layerIncluded = true;
activeArrayNumber = i;
//alert( sprTitle+" exists")
}
}
if (layerIncluded == true) { // if the sprite already exist in the array, just add to the count
layerTitleCountArray[activeArrayNumber] = layerTitleCountArray[activeArrayNumber] + 1;
//alert (layerTitleCountArray[activeArrayNumber]) // working
}
else {
// If the sprite doesn't exist in the array, add the sprite, setting the count to 1
layerTitleArray.push(sprTitle); // push a cleaned version of the layer name into the array
layerTitleCountArray.push(1);
activeArrayNumber = layerTitleArray.length-1;
}
// Then, add the sprite
layerCords = XLayerRef.bounds;
xleft = parseInt(layerCords[0]);
xtop = parseInt(layerCords[1]);
//alert( "NAME: " + sprTitle + " X: " + xleft + " Y: " + xtop + " array: " + activeArrayNumber )
collector = collector + "\n"
collector = collector + "setSpriteVisible ( "+sprTitle+"["+layerTitleCountArray[activeArrayNumber]+"].sprID, 1)\n";
collector = collector + sprTitle+"["+layerTitleCountArray[activeArrayNumber]+"].isActive = 1\n";
collector = collector + "setSpritePosition("+sprTitle+"["+layerTitleCountArray[activeArrayNumber]+"].sprID, "+xleft+", "+xtop+")\n";
}
function removeCrapText (layerNameText) {
if (layerNameText.indexOf("noAction") != -1) layerNameText = layerNameText.split("noAction").join("");
if (layerNameText.indexOf(" copy") != -1) {
for (b = 200; b > 1; b--) {
layerNameText = layerNameText.split(" copy " + b).join("");
}
layerNameText = layerNameText.split(" copy").join("");
}
layerNameText = layerNameText.split(" ").join("");
layerNameText = layerNameText.split(" ").join("");
layerNameText = layerNameText.split(" ").join("");
layerNameText = layerNameText.split(" ").join("");
layerNameText = layerNameText.split(" ").join("");
layerNameText = layerNameText.split(" ").join("");
layerNameText = layerNameText.split(" ").join("");
layerNameText = layerNameText.split(" ").join("");
layerNameText = layerNameText.split(" ").join("");
layerNameText = layerNameText.split(" ").join("");
layerNameText = layerNameText.split(" ").join("");
layerNameText = layerNameText.split(" ").join("");
return layerNameText;
}
preferences.rulerUnits = linialBackup; // Settings restored