Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 35 | chris | 1 | unit app_glscene_highscore; |
| 2 | |||
| 3 | interface |
||
| 4 | |||
| 5 | uses OpenGL, GLaux, glExt, sux_constant, sux_object, app_constant, |
||
| 6 | resource_texture, resource_shader; |
||
| 7 | |||
| 8 | type |
||
| 9 | TSettings=record |
||
| 10 | end; |
||
| 11 | SAGLSHighScore=class(SUXObject) |
||
| 12 | settings:TSettings; |
||
| 13 | |||
| 14 | procedure onTimerView; |
||
| 15 | procedure onTimerEnter; |
||
| 16 | |||
| 17 | procedure initialize; |
||
| 18 | constructor Create(parent:TObject); |
||
| 19 | destructor Destroy; override; |
||
| 20 | end; |
||
| 21 | |||
| 22 | implementation |
||
| 23 | |||
| 24 | uses sux_main, gl_main, main; |
||
| 25 | |||
| 26 | |||
| 27 | // --- SAGLSHighScore |
||
| 28 | |||
| 29 | |||
| 30 | procedure SAGLSHighScore.onTimerView; |
||
| 31 | var s: SXInt; |
||
| 32 | y: SXFloat; |
||
| 33 | begin |
||
| 34 | app.scene.renderOutlineText(320, 60, SX_GLFONT_ALIGN_CENTER, 4.0, 'High Score'); |
||
| 35 | |||
| 36 | for s := 0 to SX_MAX_HIGHSCORE do |
||
| 37 | begin |
||
| 38 | y := 150 + s * 30; |
||
| 39 | with app.game.highscore.settings.scores[s] do |
||
| 40 | begin |
||
| 41 | app.scene.renderOutlineText(130, y, SX_GLFONT_ALIGN_LEFT, 1.5, name); |
||
| 42 | app.scene.renderOutlineText(500, y, SX_GLFONT_ALIGN_RIGHT, 1.5, sx.convert.intToStr(score)); |
||
| 43 | end; |
||
| 44 | end; |
||
| 45 | end; |
||
| 46 | |||
| 47 | |||
| 48 | procedure SAGLSHighScore.onTimerEnter; |
||
| 49 | begin |
||
| 50 | app.scene.renderOutlineText(320, 120, SX_GLFONT_ALIGN_CENTER, 4.0, 'Enter High Score'); |
||
| 51 | |||
| 52 | app.scene.renderOutlineText(320, 220, SX_GLFONT_ALIGN_CENTER, 2.5, |
||
| 53 | 'Player ' + sx.convert.intToStr(app.game.settings.highscore.playerindex) |
||
| 54 | + ', your name please:'); |
||
| 55 | app.scene.renderOutlineText(320, 270, SX_GLFONT_ALIGN_CENTER, 2.5, app.game.settings.highscore.name); |
||
| 56 | end; |
||
| 57 | |||
| 58 | |||
| 59 | |||
| 60 | |||
| 61 | procedure SAGLSHighScore.initialize; |
||
| 62 | begin |
||
| 63 | end; |
||
| 64 | |||
| 65 | |||
| 66 | constructor SAGLSHighScore.Create(parent:TObject); |
||
| 67 | begin |
||
| 68 | inherited Create(parent,'GL High Score'); |
||
| 69 | end; |
||
| 70 | |||
| 71 | |||
| 72 | destructor SAGLSHighScore.Destroy; |
||
| 73 | begin |
||
| 74 | inherited; |
||
| 75 | end; |
||
| 76 | |||
| 77 | |||
| 78 | end. |