Download
Imagine a scenario where we have built a fully functional Director application with a not so pleasant user interface and you are thinking of an application which could enhance your interface with those nice little buttons…this is what Zav’s Asset Builder for.
Automated Button Graphic Generator is a Director Application which helps you to create images well suited for buttons. Multiple shapes, multiple colors and different text…this is the beauty of this utility. Download this and enjoy!
Step 1: Create Buttons
- Automated Button Graphic Generator is a Director file with the external casts to it. Download the zab.zip and extract it.
- Open the file zav’s asset builder 024.dir and play the movie
- Choose a button template
- Choose the size and adjust the text alignment
- Edit the button text. Here, if you enter multiple lines, each line will be a different button.
- Finally, hit ‘Create Assets’
- Go to cast ‘Assets’ and there you will find each button in four states.
Please Note: This utility also has a feature to export as JPEG, PICT or PNG and it uses SharpExport xtra which is not D11 ready yet. So until then please don’t hit these buttons :)
Step 2: Use the buttons
We will use a sample file to show how to use the button graphics created in the earlier step. Later on you can use the scripts mentioned in any director file.
- Open usingButtons.dir
- Open external cast assets.cst where you have created the button graphics.
- copy the Button Graphics into the internal cast.
- Select active and mask together and drag it on to the stage so that the mask image is on top of active image.
- select the mask image and change the ink to ‘matte’ and blend to 0
- drag the ‘Button sprite specific subclass - sprite – 1’ script on top of the mask image.
- Play the movie and check the buttons. You can see how all the button states appear as and when required.
- Create a behavior with a handler called “Success” and put it on the mask sprite. Put the things you want the button to do in that handler.
Note that if the registration points of the masks appear to be off by 1 pixel on the x axis (you can check by using onion skinning in the paint window) the regpoint can be adjusted with the following code:
on FixRegPoint memberNum, castNum
adjustX = 1
adjustY = 0
myMember = member memberNum of castLib castNum
AdjustRegpointH myMember, adjustX, adjustY
end
on AdjustRegpointH myMember, x,y
the regPoint of member myMember = the regPoint of member myMember + point(x,y) end |