ENIGMA Forums
Sharing is caring => Tips, Tutorials, Examples => Topic started by: Benxamix2 on September 05, 2013, 02:55:58 pm
-
If you didn't know, LGM allows to use your own editors for coding, image editing, background editing, and sound editing.
This isn't issued within the wiki, so I'm making a tutorial here.
To find your external editors, you have to go to "File > Preferences" in the LateralGM menu. There, you'll see a tab called "External Editors".
(https://dl.dropboxusercontent.com/u/52212606/imagenes/capturas%20de%20pantalla/enigmaexample0.png)
(https://dl.dropboxusercontent.com/u/52212606/imagenes/capturas%20de%20pantalla/enigmaexample5.png)
To set an external editor, you have to make an execution command for it. What do I mean? Well, do you know how does Windows shortcuts work, don't you? They store a "destination" value, more likely a Windows command (http://en.wikipedia.org/wiki/Command_Prompt), to be executed when you double click them. These destinations are formatted so they compose of 2 noticeable elements:
- Address. This is what the shortcut points to; whether an application, a webpage, etc... It's always set within quotes.
- Parameters (also called launch options), is a group of specific variables that the adress receives. And is never within quotes.
The "execution command" for external editors work pretty much the same as the shortcuts' destination.
Now you will ask me, "how do I get those destination things?"... I'll do an example for you.
I will be configuring Paint.NET (http://www.getpaint.net/) as my Sprite Editor.
- Go to the location where the software is located, via your Windows File Explorer. In my case, Hard Drive (C:) > Program Files > Paint.NET.
- Now, click on the address bar. It will turn into an address to that location.
(https://dl.dropboxusercontent.com/u/52212606/imagenes/capturas%20de%20pantalla/enigmaexample2.png)
- Copy and paste that address to the external editor field you want to setup. Don't forget to add the quotes.
(https://dl.dropboxusercontent.com/u/52212606/imagenes/capturas%20de%20pantalla/enigmaexample1.png)
- Now, add a backslash to that address, and write the full filename of the application you're going to run (obviously, it has to be located inside the folder you just addressed).
(https://dl.dropboxusercontent.com/u/52212606/imagenes/capturas%20de%20pantalla/enigmaexample3.png)
- Finally, add a %s to the field, after address outside the quotes. That %s is a parameter. It will force the program to start up AND open a file given by LGM. So, when you click into sprite editing, it will send a temporary file to the program. It's a bit complicated to explain, but I'm trying to make it understandable.
(https://dl.dropboxusercontent.com/u/52212606/imagenes/capturas%20de%20pantalla/enigmaexample4.png)
And that's how it's done.
If you have any problems, feel free to ask!
-
... Ben, I don't know how you did that, but I thought I never added that functionality o_O for me the image editor just loads paint dot net.
-
Robert: That is part of LGM's original functionality. I have no idea what compelled you to map that properties file to a UI dialog without mentioning, "by the way, %s indicates the filename and, odds are, your program will want to know that."
Thanks for sharing, Ben.
-
... Ben, I don't know how you did that, but I thought I never added that functionality o_O for me the image editor just loads paint dot net.
That's weird; for me it used to load the default MSPaint...
This works as much for GIMP or any other image editing software than PaintDotNet (I say so because I tested it).
Robert: That is part of LGM's original functionality. I have no idea what compelled you to map that properties file to a UI dialog without mentioning, "by the way, %s indicates the filename and, odds are, your program will want to know that."
Thanks for sharing, Ben.
Yeah, I read about the %s parameter somewhere and figured out how to use this thing, though I don't remember where I did.
I think someone wrote it within these forums :P
-
Josh, Ben, I thought I only implemented that UI temporarily though I thought I never made it do anything is what I meant because I was still thinking how I wanted it to look, but anyway glad it works. ^_^
Ben, you also do know there are native themes for LGM that don't make it look like garbage right? The default Swing one is grotesque.
-
I know. I just like the default because the others don't suit my color preference, and the Windows-theme-based ones (Native, Windows, Windows Classic, Nimbus, CDE/Motif) are kind of buggy;
(https://dl.dropboxusercontent.com/u/52212606/imagenes/capturas%20de%20pantalla/enigmasc1.png)
-
@Ben, its not buggy, you have to restart after changing the themes :P
-
Most people would expect you to write the setting without attempting to change the theme knowing it would fail.
-
@Ben, its not buggy, you have to restart after changing the themes :P
Darn...
Thanks, man :)
-
By default, it will load whatever your System Default Image Editor is.
This is why it's loading different editors for you guys.
I programmed it that way, which is why Robert wasn't aware of it.
Thanks for documenting it, Benxamix2. Someone should probably add a wiki page for it if there isn't already one.