testgui program. This program runs guitest.lua at the root of the Zippy distribution and enters an event loop until the user presses <Escape>.
Note: The implementation for this interface will be available in releases from 0.0.4 onwards. This implementation is in a very early stage, so you should expect it to change several times before it stabilizes
draw event handler whenever the screen is refreshed. See ZippyGuiObjects#EventHandlers for details.
GuiObject:hide()
Calling this method removes the object from the list of active objects (preventing it from receiving any event notifications) and prevents its draw handler from being called when the screen is refreshed.
GuiObject:set_position(left, top, right, bottom)
Sets the position of the object so its left edge is left pixels from the left edge of the screen, and likewise for the top, right, and bottom edges of the object. This should be called at least once before the object is drawn for the first time.
GuiObject:focus()
Causes the object to receive all of the keyboard events from the user via the key_event handler (See ZippyGuiObjects#EventHandlers). Only one object may have focus at any given time, so this function will automatically cause the object that is in focus currently to become out of focus.
GuiObject:draw_outline()
Renders the object as a strip of four lines along the four edges of the object. Currently there is no way to specify the line color. This should be called from within the draw handler of the object (see ZippyGuiObjects#EventHandlers).
GuiObject:draw_textured(texture)
If texture is a valid texture created by the Texture() function (see ZippyGuiObjects#GuiTextures), this will render the object as a textured quadrilateral covering the entire area of the object.
GuiObject:draw_text(text)
If text is a string, this function renders the string in the standard Egoboo font within the area of the object, starting from the upper left corner. Newlines are interpreted naturally, and lines that extend past the right-hand boundary of the object will be wrapped. If the text extends below the bottom edge of the object, it will be clipped at that edge. Currently "~" is used to represent a tab, but the standard "\t" will also work, and this feature may change in the near future.
object.listen_to_mouse
This is a boolean field that determines whether the object receives events from the mouse (see below).
self has keyboard focus and key is pressed (direction == "down") or released (direction == "up") with mod. See ZippyKeysyms for information about how to use key and mod to determine which key was pressed, and with which modifiers. This method should return true if the object handles the event (this will usually result in a screen refresh).
mouse_event(self, event, x, y)
This method is called when self.listen_to_mouse is true and some mouse event occurs at location , which is gauranteed to be within the boundaries of self (with one exception, read on). Possible values of event are:
"down": A button was pressed at .
"up": A button was released at .
"motion": The cursor moved to within the object.
"enter": The cursor moved into the object at .
"exit": The cursor moved out of the object, and is now at (which is outside of the object).
update(self)
This method is called on every game update (not currently used).
filename, which must be a Windows bitmap file. If alpha_filename is provided and is the filename of a grayscale bitmap in Windows bitmap format, the texture created will use that grayscale image as an alpha channel. If color_key is provided instead, it must be a color; the resultant texture will have an alpha of zero wherever that color appears in the source image.
-- ElminI - 07 Jan 2005
| Topic ZippyGuiObjects . { Edit | Attach | Ref-By | Printable | Diffs | r1.3 | > | r1.2 | > | r1.1 | More } |
|
Revision r1.3 - 13 Apr 2005 - 15:56 GMT - ElminI Parents: WebHome > MakingZippyObjects |
Copyright © 1999-2003 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding EgoWiki? Send feedback. |