Results 1 to 3 of 3

Thread: trouble with simple text example

  1. #1

    trouble with simple text example

    I was able to compile the example that comes with phoenix but when I try to use that as an example for a simplier program I get stuck.. with this it seems to freeze on my screen.. I am just trying to print text at a certain location.



    Code:
    program Fonts2;
    
    {$APPTYPE CONSOLE}
    {$IFDEF FPC}
    {$mode objfpc}{$H+}
    {$ENDIF}
    
    
    uses
      ClASSES, SysUtils,
    
      dglOpenGL,
    
      phxBase,
      phxScreen,
      phxTypes,crt,
      phxFonts;
    
    var Screen: TPHXScreen;
        Fonts : TPHXFontList;
        xxend : char;
    begin
    // Create the window
      Screen:= TPHXScreen.getInstance;
    
      // Open the window
      if not Screen.Open('Dexters Font Demo', -1, -1, 800, 600) then Exit;
    
      Fonts := TPHXFontList.Create;
    
      Fonts.LoadFont('Font1.phxfnt');
      Fonts.LoadFont('Font2.phxfnt');
      //repeat
       repeat
        //Timer.Update;
        // Clear the window
        Screen.Clear();
    
      Fonts[0].TextOut(4,4,'test');
      Fonts[0].TextOut(4,4,'test');
      //repeat
       //until (Screen.Visible = False);
      // xxend := readkey();
        until (Screen.Visible = False);
       Fonts.Free;
    end.
    http://dexrow.blogspot.com/2007/09/land-of-cigo-roguelike-w-source.html

  2. #2

    trouble with simple text example

    dont forget to flip the screen in the game loop


    Code:
      repeat
         Screen.Clear;
         // Render
        Screen.Flip;
      until Screen.Visible = false;
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  3. #3

    trouble with simple text example

    Now that I know it is important I will make sure I use it (compiles fine now)... This seems to work alot better on my machine than sdl. Realy nice a little work to use .fon though.. thanks alot..
    http://dexrow.blogspot.com/2007/09/land-of-cigo-roguelike-w-source.html

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •