PDA

View Full Version : A couple easy (I hope) scripting questions


kltv
07-30-2004, 10:37 PM
Hi everybody,
I'm trying to do my first ToasterScript and I've managed to confuse myself a little. A couple questions...

I'm trying to build a simplified custom skin for the CG module with a bunch of buttons to insert text strings into a template with specific text layers and to toggle the "DoNotDraw" on a few specific image layers.

Do I need to worry about the exisiting mask colors in the Default skin at all? I'm not really using any buttons from the standard skin, but I may have used mask colors defined in the default skin. I haven't checked, but I started worrying about it.

I believe I've written the code for my custom button functions correctly, but I'm not exactly sure how the CreateControl(r,g,b,"name") works. Does the name call the function or even matter at all? If I have a function built called KrisButton() how should I code the CreateControl line to define the button?

Sorry if these are really easy and I'm just not getting it. It's been quite a while since I've tried on my computer programming hat...

Thanks everybody,
Kris:)

bradl
07-31-2004, 12:49 AM
Not being a programmer but having fooled with the skins just enough to give this clumsy, generalized, not at my machine answer. The mask file defines regions that correspond to mouse actions. These regions are defined by unique colors or more specifically rgb values. You can create or modify existing masks in Photoshop fairly easily to match your module's visible skins. Now in one script (look at existing skin scripts for examples) you associcate your unique rgb values to a name of a command and in another script you have your command defined.

Bottom-line is, your mask file must match in size and shape your skin and the different colors must coinside with each clickalble region or 'button' you create on the main skins.

kltv
07-31-2004, 01:07 AM
I think I've got all my layers from Photoshop setup correctly, I'm just not exactly sure if the "Name" part of the CreateControl refers to my command function's name or if I have to do something like KrisButton = CreateControl(0,0,255, "KrisButton"). I'm not at the Toaster machine either, so I haven't tested out my script.

I've been looking at some of the skin mods, but they use all the existing functions and mask colors of the default skin, just with a different image look. I need to create new functions and new buttons, but I can't find a good example of that.

Thanks for your help,
Kris

Blake
08-03-2004, 12:24 PM
The name in CreateControl actually refers to the type of control you're creating. The ToasterScript Docs (ftp://ftp.newtek.com/products/vt3/ToasterScriptDocs2.zip) have examples of this. I encourage you to read Section 2.4, as it will probably help solve your problem.

-Blake Royer

kltv
08-03-2004, 09:18 PM
Thanks Blake. I've got that part figured out now. I read over that part several times before and it didn't quite sink in what the different names were doing. I was mostly looking at section 3.3's Buttons - Skin Control Sub Control stuff.

Kris