|
Last change
on this file since 8010 was
7732,
checked in by konrad, 15 years ago
|
|
Credits Menu is now scrollable
|
-
Property svn:eol-style set to
native
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 1 | -- CreditsMenu.lua |
|---|
| 2 | |
|---|
| 3 | local P = createMenuSheet("CreditsMenu") |
|---|
| 4 | |
|---|
| 5 | P.buttonList = {} |
|---|
| 6 | P.scrollbarWidth = 13 |
|---|
| 7 | |
|---|
| 8 | function P.onLoad() |
|---|
| 9 | local item = { |
|---|
| 10 | ["button"] = winMgr:getWindow("orxonox/CreditsBackButton"), |
|---|
| 11 | ["function"] = P.CreditsBackButton_clicked |
|---|
| 12 | } |
|---|
| 13 | P.buttonList[1] = item |
|---|
| 14 | end |
|---|
| 15 | |
|---|
| 16 | function P.onShow() |
|---|
| 17 | --indices to iterate through buttonlist |
|---|
| 18 | P.oldindex = -2 |
|---|
| 19 | P.index = -1 |
|---|
| 20 | |
|---|
| 21 | local description = winMgr:getWindow("orxonox/CreditsText") |
|---|
| 22 | description:setProperty("HorzFormatting", "WordWrapLeftAligned") |
|---|
| 23 | description:setProperty("VertFormatting", "TopAligned") |
|---|
| 24 | description:setText(" Orxonox version 0.0.3 \n\n Programming Language: C++ - lua - tcl \n Environment: OpenAL - Ogre - OIS - CEGUI - enet - ODE \n Licence: GNU General Public Licence - Creative Commons \n http://www.orxonox.net \n \n Credits:") |
|---|
| 25 | |
|---|
| 26 | description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0))) |
|---|
| 27 | height = getStaticTextWindowHeight(description) |
|---|
| 28 | description:setHeight(CEGUI.UDim(0, height)) |
|---|
| 29 | end |
|---|
| 30 | |
|---|
| 31 | function P.CreditsBackButton_clicked(e) |
|---|
| 32 | hideMenuSheet(P.name) |
|---|
| 33 | end |
|---|
| 34 | |
|---|
| 35 | function P.onKeyPressed() |
|---|
| 36 | buttonIteratorHelper(P.buttonList, code, P, 1, 1) |
|---|
| 37 | end |
|---|
| 38 | |
|---|
| 39 | return P |
|---|
| 40 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.