Image Library and Button Icons

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
bysteven
Posts: 3
Joined: Tue May 02, 2006 9:42 pm

Image Library and Button Icons

Post by bysteven » Tue May 02, 2006 10:57 pm

Hi All,
Jumping back into the x-Talk world after more than 10 years away from SuperCard so I'm getting in with Rev Media for atarters. I'm attempting to prototype a thick client UI, and I've added a set of images to an image library I've created. When I attempt to use the inspector to set a button icon to be one of those images, neither my library or the images appear in the pull down choices. All I get are the "standard icons, patterns this stack" etc.(I was able to set and see the icons by scripting their IDs which I copied from my library tooltips). When I view the stack in the player, the button icons aren't visible any more. How do I get my icons to be recognized, or move my library items to be visible in the inspector?

Thanks!

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Thu May 04, 2006 12:09 am

Dear bysteven,

In your Documents folder, create another folder called My Revolution Media. Within that folder, create a folder Resources. In the Reserouces folder, create a folder Icon Libraries. These folders are automatically created by Revolution, if you use the built-in Image Library to create a new custom library.

Create a stack with all pictures on the first card (at least, that's what worked for me in Rev 2.2 or so, when I made my custom image libraries). Its name must start with "revLib", for example "revLibThese are my pics". Put this stack in the Icon Libraries folder. If it doesn't show up in the built-in image library immediately, quit and restart Revolution.

Let me know if there is still a problem.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

bysteven
Posts: 3
Joined: Tue May 02, 2006 9:42 pm

Post by bysteven » Mon May 08, 2006 7:21 pm

Thanks Mark. I don't think this is my problem - I can see my custom revLibs OK. The issue seems to be that I can use the Image Library to import & place images, but if I want to have a button use that image as an icon, the image isn't visible in the icon selector unless I have already placed the image on the syack somewhere.

I was hoping to be able to create a single library that all my stacks buttons could reference. The first workaround I applied was to get the image ID from the custom image library then assign it using a script. Worked fine while in runtime mode in Media, but the icons didn't show up in the button under either Windows or Mac players. My current workaround is to place the images then hide them so that I can use the icon picker. Only works on a stack by stack basis I presume... Seems clunky to me - there must be a better way! :-)

Regards,
Byron

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Mon May 08, 2006 7:36 pm

Hi Byron,

I believe I understand the problem now. The images appear fine in the Media IDE but not if the stack is running in a player. I can understand that this is confusing and I believe that a tool that helps you to put the main stack and the necessary libraries and substacks into one folder for distribution, would be very useful.

Since there is no such tool AFAIK, you need to do this manually. Copy the custom library stacks to the same folder as your main stack and start using them. This should be something like this:

set the itemdel to slash
put item 1 to -2 of the effective filename of this stack into myLib
put slash & "Your Library" after myLib
start using stack myLib

(You can also use a similar script using the defaultfolder and referring to the file names of the stacks rather than the complete file path).

I hope this helps.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

bysteven
Posts: 3
Joined: Tue May 02, 2006 9:42 pm

Post by bysteven » Mon May 08, 2006 9:18 pm

Ah, OK thanks for the info. I'll give this a try when I get some spare time :-). Thanks again

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”