Event Tutorial

Lesson 1. Programming FKiSS Events

 

  1. This tutorial will show you how to program simple FKiSS events that can add dynamic effects to your KiSS set.  Ensure that UltraKiss is showing the main logo screen.  Close any existing set.

     

  2. Use File-New.  This will create a new KiSS set at size (448,320) with a black border and one empty page.

     

  3. Use File-Properties to change the new KiSS configuration (CNF) file properties.  The attributes section of the Properties dialog will show a playfield size of (448,320).  Press the small button beside this attribute and change the screen size to (800,600).  Exit the configuration Properties dialog by pressing the OK button.

     

  4. The first page of our set will be a menu page.  We will add two buttons to this page to switch to other pages in the set.  Each button will have a 'press' event attached to it.  The 'press' event will have the FKiSS code that we use to switch to a new page.

    On the main UltraKiss screen use Edit-Import Image to New Object.  Select the button1.cel file from the Tutorial/FKiSS directory.  This is a truecolor or Cherry Kiss cel so you will not see a prompt for anassociated palette file.  The image will be loaded and positioned at the upper left corner of the playfield.

    Drag the button to the center of the screen.  Repeat this step to import button2.cel.  Position the second button below the first button.

     

  5. Right-click on the first button to display the button property dialog. We want to fix the button in place so that it cannot be moved. Press the little button beside the Lock Value attribute and change the value to 9999 in the popup window. Click OK and observe that the button properties now indicates that the button is fixed.

    Repeat this step for button2.cel.

     

  6. Use Edit-Unselect All to remove the selection boxes or right-click anywhere on the background.  Next, right-click on the first button again. This time the contexual selection popup window will show. Select Object Properties and then select Event Wizard.

     

  7. The FKiSS Event Wizard dialog will show. The Event Source should be set to 'Group n button1.cel', the first button, where 'n' is probably 1 but could be another object number. Follow the instructions in the Wizard window. Choose the 'press' event from the Event selection box.

     

  8. The text area should now display the generated FKiSS code for a 'press' event on the selected button object. The object number '#n' from above is used. A default action statement to display a notify dialog is automatically generated for you.

    You can edit the FKiSS code if you wish. We will replace the default action statement in Lesson 2.

     

  9. Click OK to create the new event. If there are no syntax errors in the event code it will become part of the new event code for the set and you can actually try out the event.  Press the button.  See the notify dialog.

    If there is a syntax error you will receive an error message and the Text Editor will be automatically invoked so that the error can be corrected.

     

  10. Next, right-click on the second button. We will define an event on the cel this time, rather than on the group.  When the contexual selection popup window shows, select Image Properties and then select Event Wizard.

     

  11. Once again the FKiSS Event Wizard dialog will show. The Event Source should be set to 'KissCel n button2.cel ', the second button, where 'n' is probably 2 but could be another cel number. Follow the instructions in the Wizard window. Choose the 'catch' event from the Event selection box.

     

  12. The text area should now display the generated FKiSS code for a 'catch ' event on the selected button object. The cel name'button2.cel' should be used. Again, a default action statement to display a notify dialog is automatically generated for you.

    You can edit the FKiSS code if you wish. We will replace the default action statement in Lesson 2.

     

  13. Click OK to create the new event. If there are no syntax errors in the event code it will become part of the new event code for the set and you can actually try out the event.  Press the button.  See the notify dialog.

    If there is a syntax error you will receive an error message and the Text Editor will be automatically invoked so that the error can be corrected.

     

  14. Use File-Save As to save your work.  Save the new KiSS set to the Tutorial/FKiSS directory or a directory of your choice.  The configuration element name should be CNF1.cnf if you began this tutorial after first starting UltraKiss.  You can overwrite any existing element of the same name.

     

 


Next Document:  Event Tutorial Lesson 2
Prior Document:  UltraKiss Tutorials

Copyright (c) 2002-2005 WSM Information Systems Inc.