Thread: MAKI Cheats
View Single Post
Old 11th September 2002, 06:16   #28
Major Dude
frisbeemonkey's Avatar
Join Date: Jun 2002
Posts: 851
MouseOver Drawer Script

// 1. Define a MouseOver drawer group in your XML. (see example below)
// 2. Add your background layer to the group, something like:
// <layer id="MODrawer" image="player.MODrawer" x="0" y="0" sysregion="1"/>
// You can change any of the values but the id and sysregion
// 3. Add a layer to pass info to this script, something like:
// <layer id="MODrawerInfo" x="54" y="151"/>
// Set x and y to where you want your drawer to slide to
// 3. Add any other objects(layers, buttons, sliders, etc) to your group
// 4. Copy this script (and mouseoverdrawer.maki) to your scripts folder.
// 5. If you don't have mouseoverdrawer.maki, compile this script.
// 6. Add this line to the group that you want to be a drawer:
// <script id="mouseoverdrawer" file="scripts/mouseoverdrawer.maki"/>
// 7. Refresh your skin(F5) and try it out.

//<groupdef id="MouseOverDrawerGroup" w="121" h="33">
// <!-- This layer is the background for the drawer, also catches mouse coords for opening/closing-->
// <layer id="MODrawer" image="player.MODrawer" x="0" y="0" sysregion="1" move="0"/>
// <!-- This layer passes info to the drawer script, see script for details +22y-->
// <layer id="MODrawerInfo" x="54" y="151"/>
// //add other objects that you want to move with the drawer here
// <script id="mouseoverdrawer" file="scripts/mouseoverdrawer.maki"/>
// ***Don't forget to place your group somewhere in your layout!***
// <group id="DrawerGroup" x="47" y="0"/>

Note: This is not very useful as is. The drawer will close when the mouse
goes over anything you put in the drawer. I put my animated layers
in the MAKI skin by setting them ghost="1", but most things you'll want
to put in the drawer require mouse input. To add mouse-dependent
objects (buttons, sliders, etc) make sure they are not ghosted and then
you will have to add to this script and recompile it.

You'll need to follow these steps for each object you want to add:
-Create a new global variable of whatever type(Button, Slider, etc)
Ex. Global Button SomeButton;
-Get the object from the XML
Ex. SomeButton = MODrawerGrp.findObject("SomeButtonName");
-Define an onEnterArea() for your new object
Ex. SomeButton.onEnterArea() {
Doing this for all objects will prevent the drawer from closing prematurely.
In 99% of the cases, you won't need an onLeaveArea for anything you add.
Attached Files
File Type: zip (2.7 KB, 1910 views)
frisbeemonkey is offline   Reply With Quote