Differences

This shows you the differences between the selected revision and the current
version of the page.


wmebook:ch12_1 2007/12/21 12:14 wmebook:ch12_1 2008/01/10 14:25 current
Line 19: Line 19:
  * **Scripts** - every window can have scripts attached to it (similary to entities) which define window's behavior.   * **Scripts** - every window can have scripts attached to it (similary to entities) which define window's behavior.
  * **ParentNotify** - if you click inside the window you can set ParentNotify to true, which makes the parent container to get the input as well. This would be extremely useful for buttons for example, because you can have one script attached to window handling all buttons at one place. More about this later.   * **ParentNotify** - if you click inside the window you can set ParentNotify to true, which makes the parent container to get the input as well. This would be extremely useful for buttons for example, because you can have one script attached to window handling all buttons at one place. More about this later.
-  * **Transparent** - (true) means that window **doesn't** capture mouse clicks. They got through. Such window is only for decoration purposes (for example health-bar).+  * **Transparent** - (true) means that window **doesn't** capture mouse clicks - they got through. If such a window contains some controls though, they can be clicked!
  * **Menu** - (true) defines that the window hides if you click outside of the window.   * **Menu** - (true) defines that the window hides if you click outside of the window.
  * **InGame** - (true) means that the window is a part of the scene rather then stay on top. By default your inventory and other gui is painted the last which overlaps the scene, but you might need sometimes windows as a part of a scene (puzzles, etc.) and the behavior of them overlapping the inventory box for example is not wanted.   * **InGame** - (true) means that the window is a part of the scene rather then stay on top. By default your inventory and other gui is painted the last which overlaps the scene, but you might need sometimes windows as a part of a scene (puzzles, etc.) and the behavior of them overlapping the inventory box for example is not wanted.
Line 29: Line 29:
  * **Title Rectangle** - the area meant for displaying window caption (if any).   * **Title Rectangle** - the area meant for displaying window caption (if any).
  * **Drag Rectangle** - the area where you can drag your window for moving it around if needed.   * **Drag Rectangle** - the area where you can drag your window for moving it around if needed.
 +**4. Appearance**
 +  * **Text** - caption of the window.
 +  * **Font** - font used for window texts.
 +  * **FontInactive** - font used for the window when it's not active.
 +  * **Cursor** - mouse cursor used when you hover the mouse over the window.
 +  * **Image** - background image for the window.
 +  * **ImageInactive** - background image for the window in inactive mode.
 +  * **TiledImage** - special image coupled with a definition file. See chapter //need to supply the number// for explanation of tiled images.
 +  * **TiledImageInactive** - the same but for inactive window.
 +  * **TextAlign** - general text align for the window.
 +  * **ClipContents** - (true) is very useful for example for windows with scrolling texts. You can simply scroll the text and it's clipped by the window size so you see the scrolling only inside of the window - box.
 +  * **AlphaColor** - Okay. This will take some explaining thanks to our friends in Microsoft(tm) who messed it up a bit. Basically you can set here either RGB (red, green, blue) values of the color tint of the window. So you can make red window by putting there 255; 0; 0 or you can optionally set transparency level for such window by specifying alpha value (where normally 0 is fully transparent - invisible and 255 is solid so you can choose in between). But in case of this you have to provide not RGBA but ARGB and moreover the alpha value is only in the range of 0-254. If you set 255 here, it's percieved only as RGB. so If you need half-transparent green window, you set here 128; 0; 255; 0 (alpha 128 means half, red 0, green full and blue 0) and for solid window 254; 0; 255; 0. The logic behind this is that for fully transparent color you don't need alpha channel. So remember - it's ARGB where alpha is in the range of [0-254] and you're ok.
 +  * **FadeColor** - is a color tint respecting the same logic as the AlphaColor and it's applied to the background behind the window. So you can make for example upon opening the menu everything greyish to indicate that the menu is exclusive or system exclusive.
 +  * **Disabled** - means that the control is disabled so even if this window contains controls, they can't be clicked.
 +  * **Visible** - means that the control is visible or invisible. It's sometimes good idea to have windows loaded in memory and only set their visibility to true or false when needed. For example if you have special decoration window for talking, it's a necessity as opposed to loading / destroying it all the time.
 +
 +Okay. Time for spicing out our little window a little bit:
 +{{wmebook:ch12_2_1.jpg|}}
 +Click on the Add Button icon in the section 4 and then click-drag the button on the window to adjust its size. You should get the following result:
 +{{wmebook:ch12_1_2.jpg|}}
 +
 +If we have this newly created button hilighted, our property grid changed and we can easily see, that we can set some extra parameters to it (I'm mentioning only those which weren't already mentioned above):
 +
 +**Pressed** - means that the button's default state is pressed down.
 +**CenterImage** - means that you can assign the image to the button and then center it in the buttons region.
 +**PixelPerfect** - is the same as with the sprite. If it's true, the mouseclick is accepted only on the active parts of the image (non transparent).
 +**Focusable** - means that it's possible to set focus to the button.
 +
 +**WORK IN PROGRESS...**
 +
 +
 
wmebook/ch12_1.1198235673.txt.gz · Last modified: 2007/12/21 12:14 by metamorphium
Recent changes RSS feed Creative Commons License Driven by DokuWiki