Hello
To bring back the popularity of the Asphyre Extreme 3.1 era, I believe we need simple to understand examples like the one attached...
This way it can become a product for global use.
The code is currently too complex for beginners, although it is amazing.
My sample:

Thanks
To bring back the popularity of the Asphyre Extreme 3.1 era, I believe we need simple to understand examples like the one attached...
This way it can become a product for global use.
The code is currently too complex for beginners, although it is amazing.
My sample:
Code:
unit MainFm;
interface
uses
System.Types, System.Classes, Vcl.Graphics, Vcl.Forms, Vcl.Dialogs, Vcl.Controls, PXT.Types, PXT.Graphics,
PXT.Controls, MyAsphyreDevice;
type
TMainForm = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
public
procedure CreateRenderingControl;
procedure RenderingControlResize(Sender: TObject);
procedure RenderingControlPaint(Sender: TObject);
end;
var
MainForm: TMainForm;
implementation
{$R *.dfm}
uses
System.SysUtils, System.Math, PXT.Headers, PXT.Graphics.Consts;
procedure TMainForm.CreateRenderingControl;
begin
FRenderingControl := TRenderingControl.Create(nil);
FRenderingControl.Parent := Self;
FRenderingControl.Align := alClient;
FRenderingControl.Width := 256;
FRenderingControl.Height := 256;
FRenderingControl.OnPaint := RenderingControlPaint;
FRenderingControl.OnResize := RenderingControlResize;
end;
procedure TMainForm.FormCreate(Sender: TObject);
begin
CreateRenderingControl;
MyAsphyreDevice.CreateAsphyreDevice(MainForm.PixelsPerInch, MainForm.ClientWidth, MainForm.ClientHeight);
end;
procedure TMainForm.FormDestroy(Sender: TObject);
begin
MyAsphyreDevice.DestroyAsphyreDevice;
end;
procedure TMainForm.RenderingControlResize(Sender: TObject);
begin
MyAsphyreDevice.AsphyreRenderingControlResize;
end;
procedure TMainForm.RenderingControlPaint(Sender: TObject);
var
MyTextPosition: TPoint2f;
begin
MyAsphyreDevice.CanvasBeginScene;
MyAsphyreDevice.SetupFont;
MyTextPosition.X := 150.0;
MyTextPosition.Y := 50.0;
FTextRenderer.DrawCentered(MyTextPosition, 'Hello World!', ColorPair($FF00FF00, $FFFFFFFF));
MyAsphyreDevice.CanvasEndScene;
end;
end.
Thanks

Comment