Dzień dobry, zrobiłem dokładnie tak jak było opisane w artykule,
robiłem to już trzy razy, żeby sprawdzić czy gdzieś się nie pomyliłem :(
Czy gdzieś jest błąd, bo tak skompilowany kod, zmienia rozdzielczość
do 640x480 i robi się czarny ekran, nic więcej :( czarna pustka :(
Co robić ? ;( ;( ;(
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DXClass, DXSprite, DXInput, DXDraws;
type
TForm1 = class(TDXForm)
DXDraw: TDXDraw;
DXImages: TDXImageList;
DXInput: TDXInput;
DXEngine: TDXSpriteEngine;
DXTimer: TDXTimer;
procedure FormCreate(Sender: TObject);
procedure DXTimerTimer(Sender: TObject; LagCount: Integer);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
TAnimation = class(TImageSprite);
var
Form1: TForm1;
Quon : TAnimation;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
ShowCursor(False);
Quon := TAnimation.Create(DXEngine.Engine);
Quon.Image := DXImages.Items.Find('Quon');
Quon.X := 200;
Quon.Y := 200;
end;
procedure TForm1.DXTimerTimer(Sender: TObject; LagCount: Integer);
begin
with DXDraw.Surface.Canvas do
begin
Brush.Style := bsClear; *ustawiamy styl
Font.Color := clBlack; *color fontu
Font.Size := 5; *wielkosc fontu
Font.Style := [fsBold]; *pogrubiony font
TextOut(10,10, 'FPS : ' + IntToStr(DXTimer.FrameRate)); *napisz FPS
Release; *wypusc Surface
end;
DXDraw.Flip; *rysuj
DXImages.Items.Find('Land').Draw(DXDraw.Surface, 0,0,0);
DXEngine.Engine.Move(1); *odpal Engine
DXEngine.Draw; *rysuj Engine
DXDraw.Flip; *rysuj
end;
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = vk_escape then Close;
if not (Quon.X > 600) then
if Key = vk_right then
Quon.X := Quon.X + 15;
if not (Quon.X < 30) then
if Key = vk_left then
Quon.X := Quon.X - 15;
if (Quon.Y > 160) then
if Key = vk_up then
Quon.Y := Quon.Y - 15;
if (Quon.y < 435) then
if Key = vk_down then
Quon.Y := Quon.Y + 15;
end;
end.--__________________________________
Pozdrawiam...
piechnat