Hello list,

I've just committed a couple of changes to menu.py.  This is the first
change I'm committing and it *should* be quite backwards compatible,
so let me know if I broke lots of code.

The commit fixes a couple of problems I saw the menu had when placed
with some vertical alignment that wasn't centered.  You can see these
problems by checking test/test_menu_top_left.py and test/
test_menu_bottom_right.py (before updating!)

First, when moving over the items with the mouse, the area where each
item was being selected wasn't matching up with the items properly, it
was too hight when the menu was aligned with BOTTOM, and too low when
the menu was aligned with top.

Then, reading the code it seems that when the menu is place with a TOP
vertical alignment the idea was to place the menu right below the
title, but instead it was placing it just outside of the top of the
screen.

Finally, I added a ImageMenuItem that allows you to, well, use an
image as a menu item.  I've added a sample to test/test_menu_items.py

If you like the changes, I was thinking of a couple of other not-so-
backwards-compatible changes that might be a good idea, let me know
what you think:

- I added a BaseMenuItem to factor out the common functionallity of a
menu item, to not break all the MenuItems out there.  I really feel
that what now is BaseMenuItem should be MenuItem, and MenuItem should
be renamed to LabelMenuItem or sth.
- Change the font_item and font_item_selected dictionaries defined by
menu to something less label-oriented -- currently ImageMenuItem uses
the font_size to calculate at what height to show itself, but this is
a bit of a kludge.
- Add a ColorMenuItem (alright, this has no reason to be not-backwards-
compatible, I'm just writing ideas) to be able to select from a
palette of colors.
- Factor out the layout calculation, to be able to implement different
layouts: horizontal menu, fixed position menu, etc.

Salads,

achuni.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cocos-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to