Class TTimeMessagesManager

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TTimeMessagesManager = class(TObject)

Description

Hierarchy

Overview

Fields

Public maxMessagesCount: integer;
Public messageDuration: TMilisecTime;
Public glwin: TGLWindow;

Methods

Public procedure Show(const s: string); overload;
Public procedure Show(s: TStrings); overload;
Public procedure Clear;
Public procedure Idle;
Public procedure Draw2d(GLMaxX, GLMaxY, PixelWidth, PixelHeight: integer);
Public function DrawNeeded: boolean;
Public constructor Create(Aglwin: TGLwindow; AHorizMessgPosition: THorizPosition; AVertMessgPosition: TVertPosition; ADisplayPixelWidth: integer);
Public destructor Destroy; override;

Properties

Public property HorizMessgPosition: THorizPosition read FHorizMessgPosition;
Public property VertMessgPosition: TVertPosition read FVertMessgPosition;
Public property DisplayPixelWidth: integer read FDisplayPixelWidth;
Public property Color: TVector3Single read FColor write FColor;
Public property MessageFont: TGLBitmapFont_Abstract read FMessageFont;

Description

Fields

Public maxMessagesCount: integer;

ile messagy może byc maksymalnie na ekranie

Public messageDuration: TMilisecTime;

ile czasu message może pozostac na ekranie. Message "wypada" jesli zajdzie choc jeden z 2 warunkow - koniec czasu lub potrzeba miejsce na nowy string.

Public glwin: TGLWindow;

okienko do ktorego beda wysylane PostRedisplay gdy zajdzie potrzeba jego przemalowania (bo pojawi sie nowy mesage lub zniknie stary message). Moze byc = nil jezeli nie chcesz zeby bylo wtedy wysylane PostRedisplay gdziekolwiek.

Methods

Public procedure Show(const s: string); overload;

Show = zglos nowy message. W wersji (s: string) znaki nl beda automatycznie rozpoznane w s wiec s moze tak naprawde oznaczac wiele linijek tekstu. Ponadto jezeli DisplayPixelWidth > 0 to tekst moze zostac polamany tak zeby zmiescil sie na DisplayPixelWidth.

Public procedure Show(s: TStrings); overload;
 
Public procedure Clear;
 
Public procedure Idle;

wywoluj Idle co jakis czas w programie. (typowo, w glw.OnIdle)

Public procedure Draw2d(GLMaxX, GLMaxY, PixelWidth, PixelHeight: integer);

Draw2d, konstruktor i destruktor to jedyne metody jakie potrzebuja aktywnego kontekstu OpenGL'a zeby dzialac.

Rysuj Messagy. Matrix powinna byc MODELVIEW, modyfikuje currrent matrix (chcesz, to otocz ta proc glPush/PopMatrix). Ta proc rysuje zakladajac ze dostepny ekran to 0..GLMaxX, 0..GLMaxY, przy czym mniejsze X-y sa w lewo a mniejsze Y-ki sa w dol. Jesli nie chcesz, nie musisz podawac tutaj rozmiarow calego okienka.

Musisz podac PixelWidth/Height ktore mowia ile rzeczywistych pixli ma ten obszar ekranu. (Uzywamy fontow bitmapowych wiec zeby moc je wysuwac na srodek ekranu itp. musimy operowac nie tylko na wspolrzednych OpenGL'a ale tez wiedziec jak one sie maja do rzeczywistych pixeli).

Public function DrawNeeded: boolean;

This returns whether Draw2d will actually draw anything. This just checks whether we have any messages that we want to display — if not, then you don't need to call Draw2d, as it will not do anything.

This function is useful only if you want to draw some background under TimeMessages, like in "The Castle". Then you want to know whether the background is needed now or not — that's where this function is usefull.

Public constructor Create(Aglwin: TGLwindow; AHorizMessgPosition: THorizPosition; AVertMessgPosition: TVertPosition; ADisplayPixelWidth: integer);

konstrukctor i destruktor musza byc uruchomione w tym kontekscie OpenGL'a w ktorym pozniej maja wyswietlac message'y. (typowo - w glw.OnInit / OnClose.

Public destructor Destroy; override;
 

Properties

Public property HorizMessgPosition: THorizPosition read FHorizMessgPosition;
 
Public property VertMessgPosition: TVertPosition read FVertMessgPosition;
 
Public property DisplayPixelWidth: integer read FDisplayPixelWidth;

DisplayPixelWidth > 0 oznacza ze znana jest z gory szerokosc PixelWidth obszaru na ktorym bedziemy rysowac przez Draw2d. To pozwoli nam automatycznie lamac zbyt dlugie message przekazane nam przez Show;

Public property Color: TVector3Single read FColor write FColor;

Color used to draw messages. Default value is yellow.

Public property MessageFont: TGLBitmapFont_Abstract read FMessageFont;

Font used to draw messages. Read-only for now, in the future you should be allowed to change it.


Generated by PasDoc 0.11.0 on 2008-09-12 11:58:33