PDA

View Full Version : AMS5: user customizable images?



gnetcanada
11-27-2003, 05:20 PM
Hi,

I know this was talked about, wondering if AMS gives the user of the end application the ability to change images, so if they wanted to change the background of the application they could do so by either replacing the image file, or having AMS look at the image file location from a ini file and then using the ini file variable as the image to display? Or is everything still put in a diff format and thrown into a directory?

Shawn

Corey
11-27-2003, 05:23 PM
Yes absolutely, You can switch the image any way you like.

The new image actions are great such as Image.Load for your purposes. Check out the free trial, you'll love it, this is a major new version. Major... :)

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

John_Klassek
11-28-2003, 12:47 AM
I've been attempting to change the skin of one of the pages in a project I'm working on, but to no avail.

image_back = File.DoesExist(_SourceFolder.."\\AutoPlay\\Images\\c9a.png");
if image_back == true then
Image.Load("image_back", "AutoPlay\\Images\\c9a_m.png");
end

I've gone in the wrong direction in the above, or missed something...

So I thought it would be time to ask for help.

I've attached a screen capture of the kind of change intended.

Thanks.

John

PS Of course, the easy way would be to create a completely new page with a different skin...

Corey
11-28-2003, 02:55 AM
Hi John. Well for your scenario your merely need to toggle an image as in the attached example here (click your logo to toggle background, exit button works) my code's clunky, I know there's a slicker way to toggle a value just using the not ~ operator but I can't remember the syntax.

BTW you can use

if image_back then

Instead of:

if image_back == true then

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

Corey
11-28-2003, 03:14 AM
BTW John here's a second example attached, this time using Image.Load. The first one is great is you only have two images total, but if you have more than two this second one is a better method. Note, your app is not draggable if you have no title bar and an image object covers the entire stage... A solution could be to snip away a common portion from the skins, in your case the logo, and apply that to the background, then you could note (drag logo to drag app or whatever. Of course this isn't a worry in any apps which have title bars...

Again, as in the first example, you click your logo to toggle skins, and all actions can be found on the hotspot above your logo in AMS.

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

John_Klassek
11-28-2003, 07:39 AM
Thanks Corey.

Sure appreciate the thought you've given to this one. Thanks for the two examples which takes this further.

Just one question: from what I understand, we can't assign an object name to a background image, can we? Because if we could, then the background image would simply be replaced and inherit/retain the click-and-drag capabilites of the page.

I'll continue to explore this one over the weekend.

Thanks again.

John

Corey
11-28-2003, 12:15 PM
I don't think so, nothing I can see in there. Lorne or Brett might be able to offer some official confirmation on this... I agree though, that would be nifty for sure. :)

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

JimS
11-28-2003, 01:52 PM
Technically, I think it should be possible to change the ‘skin’ of a project, including the background image. A while back, I built a little sample project I called Presto-Change-O that changed the transparency mask of a project, and you should be able to use a similar method to change the background image.

Two things that are important to note, my method is more than a bit kludgy, and I’m still using AMS4, so you’ll need to make the appropriate changes to make it work in AMS5.

Here is a brief synopsis of the method I used:
The first step is to build the project using the original background image.
Next you need to go through the ‘DATA’ folder to find the image that you used for the background image. AMS renames all the files you used, so this step can take a bit of time. (hint: use file size to help you limit your search. hint 2: I just built a test project on this end, and AMS4 renamed the background image ‘Menu1.brl’, remember AMS5 may use different re-naming conventions).

The good news is that that’s the hard part, the rest is pretty easy. After you know what data file AMS is using for the background image, you just need to replace that file with the second background image you want to use.

The whole thing might work something like this (remember the file names on your project are likely to have different names):

When your user clicks on your button to change the background image the following actions occur:

the background2 image (background2.png) that is located in the Distribution folder, gets renamed to Menu1.brl and copied to the DATA folder, overwriting the old Menu1.brl.

The last step is the real kludgy part, and you’re going to have to experiment a bit here to find out which method works best. Simply reloading the page might work for you here to get it to display the new background image, I’m not sure. When I changed the transparency map in AMS 4, I needed to restart the project in order to get the page to use the new mask. I think that this is because transparency maps are project wide. Since background images can be different from page to page, I wouldn’t be surprised if a simple page reload would work for you.

In all, it’s probably more difficult than just building a second page with the second background image, but I thought it was a fun exercise to see if it could be done.

If you do end up using this method, be sure to post back here, I’d be interested to know if the new background image is displayed with a page refresh, or if it was necessary to restart the whole project like was necessary when I changed the background mask.

By the way, I found my old post with my sample project, but the link to the zip file is broken, since it was posted in the old forums. I checked on my machine, but I can’t find the file there either. That’s why I explained the process I used rather than just uploading a sample project. Good luck, let us know what way you end up going on this.